summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2013-08-06 10:41:33 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-22 18:29:59 +0100
commita6a3ec1ea0382e8f7d8ded0a2d2c5e9b99f55f9b (patch)
treec1912553f3b3b205ba5df3c302cf61c5d179eff2 /meta/classes/image.bbclass
parent02521a40d36d06d269ec14ce9000f2941d6980af (diff)
downloadpoky-a6a3ec1ea0382e8f7d8ded0a2d2c5e9b99f55f9b.tar.gz
image.bbclass: Add basic support for PACKAGE_EXCLUDE
Add the foundation for the PACKAGE_EXCLUDE support. As part of this work, it was noticed that the PACKAGE_INSTALL and PACKAGE_INSTALL_ATTEMPTONLY were still using he 'normal' version for dependencies. This should no longer be necessary as of the change in the way the complementary package groups (dev, dbg, ptest and others) are defined. By making this change the dependency tree is more correct than before, and gives the ability for manipulating PACKAGE_INSTALL and PACKAGE_INSTALL_ATTEMPTONLY, while adjusting the dependencies at the same time. Warning messages will be generated if the user is trying to exclude a package that was previously in the PACKAGE_INSTALL or PACKAGE_INSTALL_ATTEMPTONLY variables. (See additional commits for package manager specific support.) Add documentation on PACKAGE_EXCLUDE and related variables. (From OE-Core rev: 208d4d5ef7c5ead35dc27b7808f92ed377377aa4) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass39
1 files changed, 27 insertions, 12 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 116bd226ea..909702ac23 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -11,8 +11,8 @@ inherit gzipnative
11LICENSE = "MIT" 11LICENSE = "MIT"
12PACKAGES = "" 12PACKAGES = ""
13DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross" 13DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross"
14RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${NORMAL_FEATURE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL}" 14RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
15RRECOMMENDS += "${NORMAL_FEATURE_INSTALL_OPTIONAL}" 15RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"
16 16
17INHIBIT_DEFAULT_DEPS = "1" 17INHIBIT_DEFAULT_DEPS = "1"
18 18
@@ -28,16 +28,6 @@ ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-manageme
28FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}" 28FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
29FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}" 29FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
30 30
31# packages to install from features, excluding dev/dbg/doc/ptest
32NORMAL_FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(normal_groups(d), d))}"
33NORMAL_FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(normal_groups(d), d))}"
34
35def normal_groups(d):
36 """Return all the IMAGE_FEATURES, with the exception of our special package groups"""
37 extras = set(d.getVarFlags('COMPLEMENTARY_GLOB').keys())
38 features = set(oe.data.typed_value('IMAGE_FEATURES', d))
39 return features.difference(extras)
40
41# Define some very basic feature package groups 31# Define some very basic feature package groups
42SPLASH ?= "psplash" 32SPLASH ?= "psplash"
43PACKAGE_GROUP_splash = "${SPLASH}" 33PACKAGE_GROUP_splash = "${SPLASH}"
@@ -277,6 +267,31 @@ read_only_rootfs_hook () {
277 fi 267 fi
278} 268}
279 269
270PACKAGE_EXCLUDE ??= ""
271PACKAGE_EXCLUDE[type] = "list"
272
273python rootfs_process_ignore() {
274 excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split()
275 inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
276 inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY", True).split()
277
278 d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs))
279 d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs))
280
281 for pkg in excl_pkgs:
282 if pkg in inst_pkgs:
283 bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s). It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
284 inst_pkgs.remove(pkg)
285
286 if pkg in inst_attempt_pkgs:
287 bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s). It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
288 inst_attempt_pkgs.remove(pkg)
289
290 d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
291 d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs))
292}
293do_rootfs[prefuncs] += "rootfs_process_ignore"
294
280# We have to delay the runtime_mapping_rename until just before rootfs runs 295# We have to delay the runtime_mapping_rename until just before rootfs runs
281# otherwise, the multilib renaming could step in and squash any fixups that 296# otherwise, the multilib renaming could step in and squash any fixups that
282# may have occurred. 297# may have occurred.