diff options
| author | Lianhao Lu <lianhao.lu@intel.com> | 2012-07-03 12:43:32 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-03 14:55:01 +0100 |
| commit | 286b2666dc109ef467ea040be8abc0039d53ace6 (patch) | |
| tree | 631b0b49e04f555a8069fbfd901f0769f4a50e5f | |
| parent | 6121186ff9b1577b304bc237caa80e4207d04470 (diff) | |
| download | poky-286b2666dc109ef467ea040be8abc0039d53ace6.tar.gz | |
image/core-image: Handle conflicting IMAGE_FEATURES.
IMAGE_FEATURES such as 'ssh-server-dropbear' and 'ssh-server-openssh'
can't be both enabled. User can use the following variables to define
the relationship of image features:
IMAGE_FEATURES_REPLACES_foo = "bar" means including image feature "foo"
would replace the image feature "bar".
IMAGE_FEATURES_CONFLICTS_foo = "bar" means including both image features
"foo" and "bar" would cause an parsing error.
(From OE-Core rev: e36d12a9c1cf69540079e48a1dfadbc343758e48)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/core-image.bbclass | 11 | ||||
| -rw-r--r-- | meta/classes/image.bbclass | 17 | ||||
| -rw-r--r-- | meta/recipes-sato/images/core-image-sato-sdk.bb | 2 |
3 files changed, 29 insertions, 1 deletions
diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass index 25f5c5a8dc..6b207d7cfa 100644 --- a/meta/classes/core-image.bbclass +++ b/meta/classes/core-image.bbclass | |||
| @@ -47,6 +47,14 @@ PACKAGE_GROUP_ssh-server-openssh = "task-core-ssh-openssh" | |||
| 47 | PACKAGE_GROUP_package-management = "${ROOTFS_PKGMANAGE}" | 47 | PACKAGE_GROUP_package-management = "${ROOTFS_PKGMANAGE}" |
| 48 | PACKAGE_GROUP_qt4-pkgs = "task-core-qt-demos" | 48 | PACKAGE_GROUP_qt4-pkgs = "task-core-qt-demos" |
| 49 | 49 | ||
| 50 | |||
| 51 | # IMAGE_FEAETURES_REPLACES_foo = 'bar1 bar2' | ||
| 52 | # Including image feature foo would replace the image features bar1 and bar2 | ||
| 53 | IMAGE_FEATURES_REPLACES_ssh-server-openssh = "ssh-server-dropbear" | ||
| 54 | |||
| 55 | # IMAGE_FEATURES_CONFLICTS_foo = 'bar1 bar2' | ||
| 56 | # An error exception would be raised if both image features foo and bar1(or bar2) are included | ||
| 57 | |||
| 50 | CORE_IMAGE_BASE_INSTALL = '\ | 58 | CORE_IMAGE_BASE_INSTALL = '\ |
| 51 | task-core-boot \ | 59 | task-core-boot \ |
| 52 | task-base-extended \ | 60 | task-base-extended \ |
| @@ -60,7 +68,8 @@ IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}" | |||
| 60 | 68 | ||
| 61 | X11_IMAGE_FEATURES = "x11-base apps-x11-core package-management" | 69 | X11_IMAGE_FEATURES = "x11-base apps-x11-core package-management" |
| 62 | ENHANCED_IMAGE_FEATURES = "${X11_IMAGE_FEATURES} apps-x11-games apps-x11-pimlico package-management" | 70 | ENHANCED_IMAGE_FEATURES = "${X11_IMAGE_FEATURES} apps-x11-games apps-x11-pimlico package-management" |
| 63 | SATO_IMAGE_FEATURES = "${ENHANCED_IMAGE_FEATURES} x11-sato ssh-server-dropbear" | 71 | SSHSERVER_IMAGE_FEATURES ??= "ssh-server-dropbear" |
| 72 | SATO_IMAGE_FEATURES = "${ENHANCED_IMAGE_FEATURES} x11-sato ${SSHSERVER_IMAGE_FEATURES}" | ||
| 64 | 73 | ||
| 65 | inherit image | 74 | inherit image |
| 66 | 75 | ||
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 24fd868087..f1b829fe18 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
| @@ -94,6 +94,23 @@ python () { | |||
| 94 | deps += " %s:do_populate_sysroot" % dep | 94 | deps += " %s:do_populate_sysroot" % dep |
| 95 | d.appendVarFlag('do_build', 'depends', deps) | 95 | d.appendVarFlag('do_build', 'depends', deps) |
| 96 | 96 | ||
| 97 | #process IMAGE_FEATURES, we must do this before runtime_mapping_rename | ||
| 98 | #Check for replaces image features | ||
| 99 | features = set(oe.data.typed_value('IMAGE_FEATURES', d)) | ||
| 100 | remain_features = features.copy() | ||
| 101 | for feature in features: | ||
| 102 | replaces = set((d.getVar("IMAGE_FEATURES_REPLACES_%s" % feature, True) or "").split()) | ||
| 103 | remain_features -= replaces | ||
| 104 | |||
| 105 | #Check for conflict image features | ||
| 106 | for feature in remain_features: | ||
| 107 | conflicts = set((d.getVar("IMAGE_FEATURES_CONFLICTS_%s" % feature, True) or "").split()) | ||
| 108 | temp = conflicts & remain_features | ||
| 109 | if temp: | ||
| 110 | bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN', True), feature, ' '.join(list(temp)))) | ||
| 111 | |||
| 112 | d.setVar('IMAGE_FEATURES', ' '.join(list(remain_features))) | ||
| 113 | |||
| 97 | # If we don't do this we try and run the mapping hooks while parsing which is slow | 114 | # If we don't do this we try and run the mapping hooks while parsing which is slow |
| 98 | # bitbake should really provide something to let us know this... | 115 | # bitbake should really provide something to let us know this... |
| 99 | if d.getVar('BB_WORKERCONTEXT', True) is not None: | 116 | if d.getVar('BB_WORKERCONTEXT', True) is not None: |
diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb b/meta/recipes-sato/images/core-image-sato-sdk.bb index 75ed64fd6b..39742efadb 100644 --- a/meta/recipes-sato/images/core-image-sato-sdk.bb +++ b/meta/recipes-sato/images/core-image-sato-sdk.bb | |||
| @@ -8,6 +8,8 @@ form a standalone SDK." | |||
| 8 | IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} dev-pkgs tools-sdk qt4-pkgs" | 8 | IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES} dev-pkgs tools-sdk qt4-pkgs" |
| 9 | EXTRA_IMAGE_FEATURES += "tools-debug tools-profile tools-testapps debug-tweaks" | 9 | EXTRA_IMAGE_FEATURES += "tools-debug tools-profile tools-testapps debug-tweaks" |
| 10 | 10 | ||
| 11 | SSHSERVER_IMAGE_FEATURES = "ssh-server-openssh" | ||
| 12 | |||
| 11 | LICENSE = "MIT" | 13 | LICENSE = "MIT" |
| 12 | 14 | ||
| 13 | inherit core-image | 15 | inherit core-image |
