diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2011-07-05 13:55:41 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-07-27 16:25:35 +0100 |
commit | af1cd61210619b97b362c40b875ff0aa81ff4546 (patch) | |
tree | ea86e622221b5f5aadbcae23cacbf505ca4cfb26 | |
parent | 44b3590509d7af2fe5a6c52a8bd2d1d7fb29ef7c (diff) | |
download | poky-af1cd61210619b97b362c40b875ff0aa81ff4546.tar.gz |
image.bbclass: Added variables for multilib support.
1. Added MULTILIB_PACKAGE_INSTALL for multilib instances of packages to
be installed in the rootfs.
2. MULTILIBRE_ALLOW_REP contains the regular expression to match the
files allow to be replaced by the conflicting files.
3. MULTILIBRE_FORCE_SAME contains the regular expression to match the
files allow to be replaced only if the conflicting files are identical.
4. Added shell function multilib_sanity_check() to check whether the
overwring for multilib situation is allowed.
(From OE-Core rev: 137a4626a7e8107fc8a71724d5124f44236293b9)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/image.bbclass | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 79a56f0408..243baa9c35 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -5,13 +5,15 @@ inherit imagetest-${IMAGETEST} | |||
5 | 5 | ||
6 | LICENSE = "MIT" | 6 | LICENSE = "MIT" |
7 | PACKAGES = "" | 7 | PACKAGES = "" |
8 | RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL}" | 8 | MULTILIB_IMAGE_INSTALL ?= "" |
9 | RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${MULTILIB_IMAGE_INSTALL}" | ||
9 | 10 | ||
10 | INHIBIT_DEFAULT_DEPS = "1" | 11 | INHIBIT_DEFAULT_DEPS = "1" |
11 | 12 | ||
12 | # "export IMAGE_BASENAME" not supported at this time | 13 | # "export IMAGE_BASENAME" not supported at this time |
13 | IMAGE_BASENAME[export] = "1" | 14 | IMAGE_BASENAME[export] = "1" |
14 | export PACKAGE_INSTALL ?= "${IMAGE_INSTALL}" | 15 | export PACKAGE_INSTALL ?= "${IMAGE_INSTALL}" |
16 | export MULTILIB_PACKAGE_INSTALL ?= "${MULTILIB_IMAGE_INSTALL}" | ||
15 | PACKAGE_INSTALL_ATTEMPTONLY ?= "" | 17 | PACKAGE_INSTALL_ATTEMPTONLY ?= "" |
16 | 18 | ||
17 | # Images are generally built explicitly, do not need to be part of world. | 19 | # Images are generally built explicitly, do not need to be part of world. |
@@ -91,6 +93,7 @@ do_rootfs[umask] = 022 | |||
91 | fakeroot do_rootfs () { | 93 | fakeroot do_rootfs () { |
92 | #set -x | 94 | #set -x |
93 | rm -rf ${IMAGE_ROOTFS} | 95 | rm -rf ${IMAGE_ROOTFS} |
96 | rm -rf ${MULTILIB_TEMP_ROOTFS} | ||
94 | mkdir -p ${IMAGE_ROOTFS} | 97 | mkdir -p ${IMAGE_ROOTFS} |
95 | mkdir -p ${DEPLOY_DIR_IMAGE} | 98 | mkdir -p ${DEPLOY_DIR_IMAGE} |
96 | 99 | ||
@@ -166,6 +169,55 @@ log_check() { | |||
166 | done | 169 | done |
167 | } | 170 | } |
168 | 171 | ||
172 | MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|" | ||
173 | MULTILIBRE_FORCE_SAME =. "${sysconfdir}|${datadir}|" | ||
174 | MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py" | ||
175 | MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib" | ||
176 | |||
177 | multilib_generate_python_file() { | ||
178 | cat >${MULTILIB_CHECK_FILE} <<EOF | ||
179 | import sys, os, os.path | ||
180 | import re,filecmp | ||
181 | |||
182 | allow_rep=re.compile(re.sub("\|$","","${MULTILIBRE_ALLOW_REP}")) | ||
183 | force_same=re.compile(re.sub("\|$","","${MULTILIBRE_FORCE_SAME}")) | ||
184 | error_promt="Multilib check error:" | ||
185 | |||
186 | files={} | ||
187 | dirs=raw_input() | ||
188 | for dir in dirs.split(): | ||
189 | for root, subfolers, subfiles in os.walk(dir): | ||
190 | for file in subfiles: | ||
191 | item=os.path.join(root,file) | ||
192 | key=str(os.path.join("/",os.path.relpath(item,dir))) | ||
193 | |||
194 | valid=True; | ||
195 | if files.has_key(key): | ||
196 | #check whether files are the same | ||
197 | if force_same.match(key): | ||
198 | if not filecmp.cmp(files[key],item): | ||
199 | valid=False | ||
200 | print("%s %s is not the same as %s\n" % (error_promt, item, files[key])) | ||
201 | sys.exit(1) | ||
202 | #check whether the file is allow to replace | ||
203 | elif allow_rep.match(key): | ||
204 | valid=True | ||
205 | else: | ||
206 | valid=False | ||
207 | print("%s duplicated files %s %s not allowed\n" % (error_promt, item, files[key])) | ||
208 | sys.exit(1) | ||
209 | |||
210 | #pass the check, add to list | ||
211 | if valid: | ||
212 | files[key]=item | ||
213 | EOF | ||
214 | } | ||
215 | |||
216 | multilib_sanity_check() { | ||
217 | multilib_generate_python_file | ||
218 | echo $@ | python ${MULTILIB_CHECK_FILE} | ||
219 | } | ||
220 | |||
169 | # set '*' as the rootpassword so the images | 221 | # set '*' as the rootpassword so the images |
170 | # can decide if they want it or not | 222 | # can decide if they want it or not |
171 | 223 | ||