aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-07-26 16:44:33 +0200
committerJoshua Lock <joshua.g.lock@intel.com>2016-07-26 16:45:40 +0100
commitb51f7d56101a4b094170bac42667291ee177168a (patch)
tree0a4d83aef5d297df0ea2cffe52d259eda74f6812
parent6d1b1c4d392d01f9a3d9ce81810be471c04b4f1f (diff)
downloadmeta-swupd-b51f7d56101a4b094170bac42667291ee177168a.tar.gz
meta-swupd-b51f7d56101a4b094170bac42667291ee177168a.tar.bz2
meta-swupd-b51f7d56101a4b094170bac42667291ee177168a.zip
swupd-image.bbclass: fix special code path for "no swupd bundles"
When there are no additional bundles, there's no need to create a separate "mega bundle" rootfs and several copy operations can be skipped because the rootfs created for the main image recipe already represents the final content. That particular code path is taken for SWUPD_BUNDLES = "". In some functions, the special handling of that configuration was missing, leading to: Exception: subprocess.CalledProcessError: Command 'tar --xattrs --xattrs-include='' -cf - -C None -p . | tar -p --xattrs --xattrs-include='' -xf - -C .../ostro-image-swupd/1.0-r0/rootfs' returned non-zero exit status 2 Fixes: IOTOS-1725 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--classes/swupd-image.bbclass17
1 files changed, 14 insertions, 3 deletions
diff --git a/classes/swupd-image.bbclass b/classes/swupd-image.bbclass
index 7e00181..229107e 100644
--- a/classes/swupd-image.bbclass
+++ b/classes/swupd-image.bbclass
@@ -207,6 +207,11 @@ def swupd_create_rootfs(d):
bb.debug(2, "Skipping swupd_create_rootfs() in bundle image %s for bundle %s." % (pn, bndl))
return
+ havebundles = (d.getVar('SWUPD_BUNDLES', True) or '') != ''
+ if not havebundles:
+ bb.debug(2, "Skipping swupd_create_rootfs(), original rootfs can be used because no additional bundles are defined")
+ return
+
# Sanity checking was already done in swupdimage.bbclass.
# Here we can simply use the settings.
imagebundles = d.getVarFlag('SWUPD_IMAGES', imageext, True).split() if imageext else []
@@ -286,9 +291,15 @@ fakeroot python do_copy_bundle_contents () {
manifest_cmd = 'cd %s && find . ! -path . > %s' % (rootfs, outfile)
subprocess.call(manifest_cmd, shell=True, stderr=subprocess.STDOUT)
- # Copy the entire mega image's contents, we'll prune this down to only
- # the files in the manifest in do_prune_bundle
- copyxattrtree(d.getVar('MEGA_IMAGE_ROOTFS', True), bundledir)
+ havebundles = (d.getVar('SWUPD_BUNDLES', True) or '') != ''
+ if havebundles:
+ # Copy the entire mega image's contents, we'll prune this down to only
+ # the files in the manifest in do_prune_bundle
+ copyxattrtree(d.getVar('MEGA_IMAGE_ROOTFS', True), bundledir)
+ else:
+ # Copy the original rootfs. There isn't any other rootfs because we
+ # don't have extra bundles.
+ copyxattrtree(d.getVar('IMAGE_ROOTFS', True), bundledir)
create_bundle_manifest(d, bndl)
}