diff options
authorPatrick Ohly <patrick.ohly@intel.com>2016-04-27 11:20:26 +0200
committerJoshua Lock <joshua.g.lock@intel.com>2016-04-27 11:16:46 +0100
commit84febd1aff9e25c456b6990d263e7338cb141df2 (patch)
parent0fcbdc45f4d4daee04dd9a89621a9d5f25c43c98 (diff)
swupdbundle.bbclass: support arbitrary bundle features
Choosing bundle features based on some (rather arbitrary) bundle name suffix does not scale. Currently it does not support ptest-pkgs and dbg-pkgs. Adding support for those via bundle name suffix would become rather awkward. So instead we now allow (and require!) that bundle features for a bundle named "foo" are set explicitly in BUNDLE_FEATURES[foo]. The corresponding content has to be in BUNDLE_CONTENTS[foo]. There's no sanity checking that features listed there are really suitable for a bundle. Features adding content (like ptest-pkgs, dbg-pkgs, dev-pkgs) are okay, features changing the os-core are not (like debug-tweaks). This cannot be checked automatically by meta-swupd because there is no definite list of acceptable features. This is an API change. Users of meta-swupd need to be adapted. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
1 files changed, 12 insertions, 17 deletions
diff --git a/classes/swupdbundle.bbclass b/classes/swupdbundle.bbclass
index 819dd85..cc1423b 100644
--- a/classes/swupdbundle.bbclass
+++ b/classes/swupdbundle.bbclass
@@ -37,11 +37,9 @@ python swupdbundle_virtclass_handler () {
e.data.setVar("BUNDLE_NAME", bundle)
# -dev bundles enable the dev-pkgs image feature for the bundle they are derived from,
# i.e. they have the same content of the base but also the development files.
- if bundle.endswith('-dev'):
- basebundle = bundle[0:-len('-dev')]
- d.appendVar('IMAGE_FEATURES', ' dev-pkgs')
- else:
- basebundle = bundle
+ features = d.getVarFlag("BUNDLE_FEATURES", bundle, True) or ""
+ if features:
+ d.appendVar('IMAGE_FEATURES', ' ' + features)
# Not producing any real images, only the rootfs directory.
e.data.setVar("IMAGE_FSTYPES", "")
@@ -56,24 +54,21 @@ python swupdbundle_virtclass_handler () {
if contents:
return contents.split()
- bb.fatal('%s/%s: BUNDLE_CONTENTS[%s] is not set, this should list the packages to be included in the bundle.' % (basebundle, bundle, bndl))
+ bb.fatal('%s/%s: BUNDLE_CONTENTS[%s] is not set, this should list the packages to be included in the bundle.' % (bundle, bundle, bndl))
if bundle == 'mega':
bundles = (e.data.getVar('SWUPD_BUNDLES', True) or "").split()
- # If any of our bundles contains development files, we also need
+ # If any of our bundles uses special features, we also need
# to enable that for the mega image.
- dodev = False
+ features = set()
for bndl in bundles:
- if bndl.endswith('-dev'):
- basebndl = bndl[0:-len('-dev')]
- dodev = True
- else:
- basebndl = bndl
- curr_install += get_bundle_contents(basebndl)
- if dodev:
- d.appendVar('IMAGE_FEATURES', ' dev-pkgs')
+ newfeatures = (d.getVarFlag("BUNDLE_FEATURES", bundle, True) or "").split()
+ curr_install += get_bundle_contents(bndl)
+ features.update(newfeatures)
+ if features:
+ d.appendVar('IMAGE_FEATURES', ' ' + ' '.join(features))
- curr_install += get_bundle_contents(basebundle)
+ curr_install += get_bundle_contents(bundle)
e.data.setVar('IMAGE_INSTALL', ' '.join(curr_install))