aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-03-29 21:10:02 +0200
committerJoshua Lock <joshua.g.lock@intel.com>2016-03-30 21:36:41 +0100
commit53f6246f272d289a6211b3412cac617aba77ae01 (patch)
tree5787ccfe1ac901542e319eb6bb37c2ab7ac6b238
parent620ec4dcee13ff3edea30112e952d79060ab302e (diff)
downloadmeta-swupd-53f6246f272d289a6211b3412cac617aba77ae01.tar.gz
meta-swupd-53f6246f272d289a6211b3412cac617aba77ae01.tar.bz2
meta-swupd-53f6246f272d289a6211b3412cac617aba77ae01.zip
swupdbundle.bbclass: support -dev bundles
By convention, any bundle called "foobar-dev" is equal to the "foobar" bundle plus the "dev-pkgs" image feature, i.e. it has the same content as the base bundle plus the corresponding development files. Without this feature it is impossible to generate separate bundles for development files; the only option would be to put "dev-pkgs" into the shared image features, which would add development files also to the os-core and all bundles. Using this fixed naming convention was chosen over additional configuration options because a consistent naming automatically gets enforced and it was easier to implement than additional configuration options. A future optimization will be to declare a dependency of the -dev bundle on the base bundle and only provide the additional development files in the -dev bundle. Right now, the -dev bundle is simply a larger variant of the base bundle because all non-development files are present in both bundles. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--classes/swupdbundle.bbclass23
1 files changed, 20 insertions, 3 deletions
diff --git a/classes/swupdbundle.bbclass b/classes/swupdbundle.bbclass
index 986b80d..f008737 100644
--- a/classes/swupdbundle.bbclass
+++ b/classes/swupdbundle.bbclass
@@ -35,6 +35,13 @@ python swupdbundle_virtclass_handler () {
pn = 'bundle-' + pn + '-' + bundle
e.data.setVar("PN", pn)
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
# Not producing any real images, only the rootfs directory.
e.data.setVar("IMAGE_FSTYPES", "")
@@ -45,14 +52,24 @@ python swupdbundle_virtclass_handler () {
if contents:
return contents.split()
else:
- bb.fatal('BUNDLE_CONTENTS[%s] is not set, this should list the packages to be included in the bundle.' % bndl)
+ bb.fatal('%s/%s: BUNDLE_CONTENTS[%s] is not set, this should list the packages to be included in the bundle.' % (basebundle, 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
+ # to enable that for the mega image.
+ dodev = False
for bndl in bundles:
- curr_install += get_bundle_contents(bndl)
+ 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')
else:
- curr_install += get_bundle_contents(bundle)
+ curr_install += get_bundle_contents(basebundle)
e.data.setVar('IMAGE_INSTALL', ' '.join(curr_install))
}