summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_deb.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/rootfs_deb.bbclass')
-rw-r--r--meta/classes/rootfs_deb.bbclass56
1 files changed, 19 insertions, 37 deletions
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 7712911b02..fee7db9ae0 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -1,21 +1,6 @@
1DEPENDS_prepend = "dpkg-native apt-native fakeroot-native " 1DEPENDS_prepend = "dpkg-native apt-native fakeroot-native "
2DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}" 2DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}"
3 3
4PACKAGES = ""
5
6do_rootfs[nostamp] = 1
7do_rootfs[dirs] = ${TOPDIR}
8do_build[nostamp] = 1
9
10ROOTFS_POSTPROCESS_COMMAND ?= ""
11
12PID = "${@os.getpid()}"
13
14# some default locales
15IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
16
17LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}"
18
19fakeroot rootfs_deb_do_rootfs () { 4fakeroot rootfs_deb_do_rootfs () {
20 set +e 5 set +e
21 mkdir -p ${IMAGE_ROOTFS}/var/dpkg/{info,updates} 6 mkdir -p ${IMAGE_ROOTFS}/var/dpkg/{info,updates}
@@ -101,30 +86,27 @@ fakeroot rootfs_deb_do_rootfs () {
101 set -e 86 set -e
102 87
103 ${ROOTFS_POSTPROCESS_COMMAND} 88 ${ROOTFS_POSTPROCESS_COMMAND}
104}
105 89
106# set '*' as the rootpassword so the images 90 log_check rootfs
107# can decide if they want it or not
108
109zap_root_password () {
110 sed 's%^root:[^:]*:%root:*:%' < ${IMAGE_ROOTFS}/etc/passwd >${IMAGE_ROOTFS}/etc/passwd.new
111 mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd
112}
113
114create_etc_timestamp() {
115 date +%2m%2d%2H%2M%Y >${IMAGE_ROOTFS}/etc/timestamp
116} 91}
117 92
118# Turn any symbolic /sbin/init link into a file 93rootfs_deb_log_check() {
119remove_init_link () { 94 target="$1"
120 if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then 95 lf_path="$2"
121 LINKFILE=${IMAGE_ROOTFS}`readlink ${IMAGE_ROOTFS}/sbin/init` 96
122 rm ${IMAGE_ROOTFS}/sbin/init 97 lf_txt="`cat $lf_path`"
123 cp $LINKFILE ${IMAGE_ROOTFS}/sbin/init 98 for keyword_die in "E:"
124 fi 99 do
100 if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") &>/dev/null
101 then
102 echo "log_check: There were error messages in the logfile"
103 echo -e "log_check: Matched keyword: [$keyword_die]\n"
104 echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die"
105 echo ""
106 do_exit=1
107 fi
108 done
109 test "$do_exit" = 1 && exit 1
110 true
125} 111}
126 112
127# export the zap_root_password, create_etc_timestamp and remote_init_link
128EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs
129
130addtask rootfs before do_build after do_install