[oe-commits] Chris Larson : image: implement IMAGE_FEATURES

git version control git at git.openembedded.org
Wed Aug 10 12:35:37 UTC 2011


Module: openembedded-core.git
Branch: master
Commit: f9f4416a8cfbd37c7d3a8eb19ee82820e2e6b38c
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=f9f4416a8cfbd37c7d3a8eb19ee82820e2e6b38c

Author: Chris Larson <chris_larson at mentor.com>
Date:   Mon Aug  8 16:09:37 2011 -0700

image: implement IMAGE_FEATURES

IMAGE_FEATURES is analagous to DISTRO_FEATURES and MACHINE_FEATURES, for
root filesystem construction. Currently, the only supported features are
any defined package groups, as used by the oe.packagegroup python
module.

Example usage:

    PACKAGE_GROUP_myfeature = "vim iptables"
    IMAGE_FEATURES += "myfeature"

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 meta/classes/image.bbclass |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 243baa9..e057329 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -6,15 +6,26 @@ inherit imagetest-${IMAGETEST}
 LICENSE = "MIT"
 PACKAGES = ""
 MULTILIB_IMAGE_INSTALL ?= ""
-RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${MULTILIB_IMAGE_INSTALL}"
+RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${MULTILIB_IMAGE_INSTALL} ${FEATURE_INSTALL}"
+RRECOMMENDS += "${FEATURE_INSTALL_OPTIONAL}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
+# IMAGE_FEATURES may contain any available package group
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+
+# packages to install from features
+FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+
 # "export IMAGE_BASENAME" not supported at this time
+IMAGE_INSTALL ?= ""
+IMAGE_INSTALL[type] = "list"
 IMAGE_BASENAME[export] = "1"
-export PACKAGE_INSTALL ?= "${IMAGE_INSTALL}"
+export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${FEATURE_INSTALL}"
 export MULTILIB_PACKAGE_INSTALL ?= "${MULTILIB_IMAGE_INSTALL}"
-PACKAGE_INSTALL_ATTEMPTONLY ?= ""
+PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}"
 
 # Images are generally built explicitly, do not need to be part of world.
 EXCLUDE_FROM_WORLD = "1"





More information about the Openembedded-commits mailing list