diff options
author | Richard Purdie <richard@openedhand.com> | 2006-11-22 15:28:28 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-11-22 15:28:28 +0000 |
commit | 0ac664d01a395d6349e6e1cbab6c787501d4baac (patch) | |
tree | 45e6c8c307aab0c21cb3b6f3f89987a335f09922 /meta/classes/rootfs_deb.bbclass | |
parent | fcbc597dbe624ff302beccab04f3923f55101364 (diff) | |
download | poky-0ac664d01a395d6349e6e1cbab6c787501d4baac.tar.gz |
rootfs_xxx.bbclass: Add missing checkins from the log_check updates
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@938 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/rootfs_deb.bbclass')
-rw-r--r-- | meta/classes/rootfs_deb.bbclass | 56 |
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 @@ | |||
1 | DEPENDS_prepend = "dpkg-native apt-native fakeroot-native " | 1 | DEPENDS_prepend = "dpkg-native apt-native fakeroot-native " |
2 | DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}" | 2 | DEPENDS_append = " ${EXTRA_IMAGEDEPENDS}" |
3 | 3 | ||
4 | PACKAGES = "" | ||
5 | |||
6 | do_rootfs[nostamp] = 1 | ||
7 | do_rootfs[dirs] = ${TOPDIR} | ||
8 | do_build[nostamp] = 1 | ||
9 | |||
10 | ROOTFS_POSTPROCESS_COMMAND ?= "" | ||
11 | |||
12 | PID = "${@os.getpid()}" | ||
13 | |||
14 | # some default locales | ||
15 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" | ||
16 | |||
17 | LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}" | ||
18 | |||
19 | fakeroot rootfs_deb_do_rootfs () { | 4 | fakeroot 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 | |||
109 | zap_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 | |||
114 | create_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 | 93 | rootfs_deb_log_check() { |
119 | remove_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 | ||
128 | EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs | ||
129 | |||
130 | addtask rootfs before do_build after do_install | ||