aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-10-08 20:07:23 -0700
committerChris Larson <chris_larson@mentor.com>2011-05-18 13:59:32 -0700
commitb7564c32452e9ce33d9790465b986471ef5a3cba (patch)
treed2a0583468fc9a0c909f14fac5de1c872965ba1a /meta/classes/image.bbclass
parent4610087f569b2cd8e74595b2947e636ca0b299e9 (diff)
downloadopenembedded-core-contrib-b7564c32452e9ce33d9790465b986471ef5a3cba.tar.gz
image.bbclass: switch to OE's IMAGE_FEATURES
Currently, all image features are assumed to be package groups defined with oe.packagegroup (PACKAGE_GROUP_<group> = "<list of packages>"). Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass41
1 files changed, 39 insertions, 2 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 2469442d70..3c626886b1 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -11,8 +11,45 @@ INHIBIT_DEFAULT_DEPS = "1"
# "export IMAGE_BASENAME" not supported at this time
IMAGE_BASENAME[export] = "1"
-export PACKAGE_INSTALL ?= "${IMAGE_INSTALL}"
-PACKAGE_INSTALL_ATTEMPTONLY ?= ""
+
+PACKAGE_INSTALL = "${@' '.join(oe.packagegroup.required_packages('${IMAGE_FEATURES}'.split(), d))}"
+PACKAGE_INSTALL_ATTEMPTONLY = "${@' '.join(oe.packagegroup.optional_packages('${IMAGE_FEATURES}'.split(), d))}"
+RDEPENDS += "${@' '.join(oe.packagegroup.active_packages('${IMAGE_FEATURES}'.split(), d))}"
+
+
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+IMAGE_FEATURES_prepend = "image_base "
+
+# Define our always included package group
+PACKAGE_GROUP_image_base = "${IMAGE_INSTALL}"
+
+# The following package groups allow one to add debugging, development, and
+# documentation files for all packages installed in the image.
+
+def string_set(iterable):
+ return ' '.join(set(iterable))
+
+def image_features_noextras(d):
+ for f in d.getVar("IMAGE_FEATURES", True).split():
+ if not f in ('dbg', 'dev', 'doc'):
+ yield f
+
+def dbg_packages(d):
+ from itertools import chain
+
+ features = image_features_noextras(d)
+ return string_set("%s-dbg" % pkg
+ for pkg in chain(oe.packagegroup.active_packages(features, d),
+ oe.packagegroup.active_recipes(features, d)))
+
+PACKAGE_GROUP_dbg = "${@dbg_packages(d)}"
+PACKAGE_GROUP_dbg[optional] = "1"
+PACKAGE_GROUP_dev = "${@string_set('%s-dev' % pn for pn in oe.packagegroup.active_recipes(image_features_noextras(d), d))}"
+PACKAGE_GROUP_dev[optional] = "1"
+PACKAGE_GROUP_doc = "${@string_set('%s-doc' % pn for pn in oe.packagegroup.active_recipes(image_features_noextras(d), d))}"
+PACKAGE_GROUP_doc[optional] = "1"
+
# Images are generally built explicitly, do not need to be part of world.
EXCLUDE_FROM_WORLD = "1"