summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-11-21 23:21:06 +0000
committerRichard Purdie <richard@openedhand.com>2006-11-21 23:21:06 +0000
commite2f9e1a4aa15ace73ec174aa24dd0db1a0924148 (patch)
treef758eb2d6e8af9e772e5c9b59a03ba3b39d9f201
parent01b1dbaefdfcb78aef2f5a480046b56a04f90e6f (diff)
downloadpoky-e2f9e1a4aa15ace73ec174aa24dd0db1a0924148.tar.gz
Factor common code out of rootfs_xxx.bbclass into image.bbclass. Add error detection code for roofs_deb.bbclass
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@936 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r--meta/classes/image.bbclass62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 752b2de0b0..8375d7133e 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -1,5 +1,7 @@
1inherit rootfs_${IMAGE_PKGTYPE} 1inherit rootfs_${IMAGE_PKGTYPE}
2 2
3PACKAGES = ""
4
3# We need to recursively follow RDEPENDS and RRECOMMENDS for images 5# We need to recursively follow RDEPENDS and RRECOMMENDS for images
4BUILD_ALL_DEPS = "1" 6BUILD_ALL_DEPS = "1"
5do_rootfs[recrdeptask] = "do_package_write" 7do_rootfs[recrdeptask] = "do_package_write"
@@ -9,6 +11,8 @@ EXCLUDE_FROM_WORLD = "1"
9 11
10USE_DEVFS ?= "0" 12USE_DEVFS ?= "0"
11 13
14PID = "${@os.getpid()}"
15
12DEPENDS += "makedevs-native" 16DEPENDS += "makedevs-native"
13PACKAGE_ARCH = "${MACHINE_ARCH}" 17PACKAGE_ARCH = "${MACHINE_ARCH}"
14 18
@@ -26,6 +30,17 @@ DEPENDS += "${@get_image_deps(d)}"
26IMAGE_DEVICE_TABLE ?= "${@bb.which(bb.data.getVar('BBPATH', d, 1), 'files/device_table-minimal.txt')}" 30IMAGE_DEVICE_TABLE ?= "${@bb.which(bb.data.getVar('BBPATH', d, 1), 'files/device_table-minimal.txt')}"
27IMAGE_POSTPROCESS_COMMAND ?= "" 31IMAGE_POSTPROCESS_COMMAND ?= ""
28 32
33# some default locales
34IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
35
36LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}"
37
38ROOTFS_POSTPROCESS_COMMAND ?= ""
39
40do_rootfs[nostamp] = 1
41do_rootfs[dirs] = ${TOPDIR}
42do_build[nostamp] = 1
43
29# Must call real_do_rootfs() from inside here, rather than as a separate 44# Must call real_do_rootfs() from inside here, rather than as a separate
30# task, so that we have a single fakeroot context for the whole process. 45# task, so that we have a single fakeroot context for the whole process.
31fakeroot do_rootfs () { 46fakeroot do_rootfs () {
@@ -56,3 +71,50 @@ fakeroot do_rootfs () {
56 71
57 ${IMAGE_POSTPROCESS_COMMAND} 72 ${IMAGE_POSTPROCESS_COMMAND}
58} 73}
74
75log_check() {
76 set +x
77 for target in $*
78 do
79 lf_path="${WORKDIR}/temp/log.do_$target.${PID}"
80
81 echo "log_check: Using $lf_path as logfile"
82
83 if test -e "$lf_path"
84 then
85 rootfs_${IMAGE_PKGTYPE}_log_check $target $lf_path
86 else
87 echo "Cannot find logfile [$lf_path]"
88 fi
89 echo "Logfile is clean"
90 done
91
92 set -x
93}
94
95# set '*' as the rootpassword so the images
96# can decide if they want it or not
97
98zap_root_password () {
99 sed 's%^root:[^:]*:%root:*:%' < ${IMAGE_ROOTFS}/etc/passwd >${IMAGE_ROOTFS}/etc/passwd.new
100 mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd
101}
102
103create_etc_timestamp() {
104 date +%2m%2d%2H%2M%Y >${IMAGE_ROOTFS}/etc/timestamp
105}
106
107# Turn any symbolic /sbin/init link into a file
108remove_init_link () {
109 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
110 LINKFILE=${IMAGE_ROOTFS}`readlink ${IMAGE_ROOTFS}/sbin/init`
111 rm ${IMAGE_ROOTFS}/sbin/init
112 cp $LINKFILE ${IMAGE_ROOTFS}/sbin/init
113 fi
114}
115
116# export the zap_root_password, create_etc_timestamp and remote_init_link
117EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs
118
119addtask rootfs before do_build after do_install
120