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_ipk.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_ipk.bbclass')
-rw-r--r-- | meta/classes/rootfs_ipk.bbclass | 88 |
1 files changed, 16 insertions, 72 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index f59f2b2137..42c50d35f8 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass | |||
@@ -8,23 +8,8 @@ | |||
8 | DEPENDS_prepend="ipkg-native ipkg-utils-native fakeroot-native " | 8 | DEPENDS_prepend="ipkg-native ipkg-utils-native fakeroot-native " |
9 | DEPENDS_append=" ${EXTRA_IMAGEDEPENDS}" | 9 | DEPENDS_append=" ${EXTRA_IMAGEDEPENDS}" |
10 | 10 | ||
11 | PACKAGES = "" | ||
12 | |||
13 | do_rootfs[nostamp] = "1" | ||
14 | do_rootfs[dirs] = "${TOPDIR}" | ||
15 | do_build[nostamp] = "1" | ||
16 | |||
17 | IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" | 11 | IPKG_ARGS = "-f ${T}/ipkg.conf -o ${IMAGE_ROOTFS}" |
18 | 12 | ||
19 | ROOTFS_POSTPROCESS_COMMAND ?= "" | ||
20 | |||
21 | PID = "${@os.getpid()}" | ||
22 | |||
23 | # some default locales | ||
24 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" | ||
25 | |||
26 | LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, bb.data.getVar('IMAGE_LINGUAS', d, 1).split()))}" | ||
27 | |||
28 | fakeroot rootfs_ipk_do_rootfs () { | 13 | fakeroot rootfs_ipk_do_rootfs () { |
29 | set -x | 14 | set -x |
30 | 15 | ||
@@ -78,64 +63,23 @@ fakeroot rootfs_ipk_do_rootfs () { | |||
78 | log_check rootfs | 63 | log_check rootfs |
79 | } | 64 | } |
80 | 65 | ||
81 | log_check() { | 66 | rootfs_ipk_log_check() { |
82 | set +x | 67 | target="$1" |
83 | for target in $* | 68 | lf_path="$2" |
84 | do | 69 | |
85 | lf_path="${WORKDIR}/temp/log.do_$target.${PID}" | 70 | lf_txt="`cat $lf_path`" |
86 | 71 | for keyword_die in "Cannot find package" "exit 1" ERR Fail | |
87 | echo "log_check: Using $lf_path as logfile" | 72 | do |
88 | |||
89 | if test -e "$lf_path" | ||
90 | then | ||
91 | lf_txt="`cat $lf_path`" | ||
92 | |||
93 | for keyword_die in "Cannot find package" "exit 1" ERR Fail | ||
94 | do | ||
95 | 73 | ||
96 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") &>/dev/null | 74 | if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") &>/dev/null |
97 | then | 75 | then |
98 | echo "log_check: There were error messages in the logfile" | 76 | echo "log_check: There were error messages in the logfile" |
99 | echo -e "log_check: Matched keyword: [$keyword_die]\n" | 77 | echo -e "log_check: Matched keyword: [$keyword_die]\n" |
100 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" | 78 | echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" |
101 | echo "" | 79 | echo "" |
102 | do_exit=1 | 80 | do_exit=1 |
103 | fi | ||
104 | done | ||
105 | test "$do_exit" = 1 && exit 1 | ||
106 | else | ||
107 | echo "Cannot find logfile [$lf_path]" | ||
108 | fi | 81 | fi |
109 | echo "Logfile is clean" | ||
110 | done | 82 | done |
111 | 83 | test "$do_exit" = 1 && exit 1 | |
112 | set -x | 84 | true |
113 | |||
114 | } | ||
115 | |||
116 | |||
117 | # set '*' as the rootpassword so the images | ||
118 | # can decide if they want it or not | ||
119 | |||
120 | zap_root_password () { | ||
121 | sed 's%^root:[^:]*:%root:*:%' < ${IMAGE_ROOTFS}/etc/passwd >${IMAGE_ROOTFS}/etc/passwd.new | ||
122 | mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd | ||
123 | } | ||
124 | |||
125 | create_etc_timestamp() { | ||
126 | date +%2m%2d%2H%2M%Y >${IMAGE_ROOTFS}/etc/timestamp | ||
127 | } | ||
128 | |||
129 | # Turn any symbolic /sbin/init link into a file | ||
130 | remove_init_link () { | ||
131 | if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then | ||
132 | LINKFILE=${IMAGE_ROOTFS}`readlink ${IMAGE_ROOTFS}/sbin/init` | ||
133 | rm ${IMAGE_ROOTFS}/sbin/init | ||
134 | cp $LINKFILE ${IMAGE_ROOTFS}/sbin/init | ||
135 | fi | ||
136 | } | 85 | } |
137 | |||
138 | # export the zap_root_password, create_etc_timestamp and remote_init_link | ||
139 | EXPORT_FUNCTIONS zap_root_password create_etc_timestamp remove_init_link do_rootfs | ||
140 | |||
141 | addtask rootfs before do_build after do_install | ||