aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-11-03 09:30:18 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2016-12-08 14:12:55 +0100
commit6ad54560444d08c88934b62d8ad8d7783df352ea (patch)
treecbfb754020fded880bfb00ad1080cad359aac598
parentfd2901996fa6b342587e53049e42741e95580233 (diff)
downloadmeta-swupd-6ad54560444d08c88934b62d8ad8d7783df352ea.tar.gz
meta-swupd-6ad54560444d08c88934b62d8ad8d7783df352ea.tar.bz2
meta-swupd-6ad54560444d08c88934b62d8ad8d7783df352ea.zip
swupd-image.bbclass: remove special cases with SWUPD_IMAGE_PN
That PN is different in the base image and virtual images led to various places which had to distinguish between the two. We can simplify that by introducing a variable SWUPD_IMAGE_PN which always has the PN value of the base image. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--classes/swupd-image.bbclass18
1 files changed, 9 insertions, 9 deletions
diff --git a/classes/swupd-image.bbclass b/classes/swupd-image.bbclass
index ecb5dca..dd0f964 100644
--- a/classes/swupd-image.bbclass
+++ b/classes/swupd-image.bbclass
@@ -15,7 +15,6 @@
#
# See docs/Guide.md for more information.
-DEPLOY_DIR_SWUPDBASE = "${DEPLOY_DIR}/swupd/${MACHINE}"
# Created for each bundle (including os-core) and the "full" directory,
# describing files and directories that swupd-server needs to include in the update
# mechanism (i.e. without SWUPD_FILE_BLACKLIST entries). Used by swupd-server.
@@ -25,6 +24,14 @@ SWUPD_ROOTFS_MANIFEST_SUFFIX = ".content.txt"
# used by swupdimage.bbclass.
SWUPD_IMAGE_MANIFEST_SUFFIX = ".extra-content.txt"
+# Name of the base image. Always set, constant (unlike PN, which is
+# different in the different virtual images).
+SWUPD_IMAGE_PN = "${@ d.getVar('PN_BASE', True) or d.getVar('PN', True)}"
+
+# Main directory in which swupd is invoked. The actual output which needs
+# to be published will be in the "www" sub-directory.
+DEPLOY_DIR_SWUPD = "${DEPLOY_DIR}/swupd/${MACHINE}/${SWUPD_IMAGE_PN}"
+
# User configurable variables to disable all swupd processing or deltapack
# generation.
SWUPD_GENERATE ??= "1"
@@ -56,6 +63,7 @@ python () {
bb.fatal("Invalid value for OS_VERSION (%s), must be a non-negative integer value." % ver)
havebundles = (d.getVar('SWUPD_BUNDLES', True) or '') != ''
+ deploy_dir = d.getVar('DEPLOY_DIR_SWUPD', True)
# Always set, value differs among virtual image recipes.
pn = d.getVar('PN', True)
@@ -95,12 +103,6 @@ python () {
d.setVar('PSEUDO_LOCALSTATEDIR', pseudo_state)
if pn_base is not None:
- # We want all virtual images from this recipe to deploy to the same
- # directory
- deploy_dir = d.getVar('DEPLOY_DIR_SWUPDBASE', True)
- deploy_dir = os.path.join(deploy_dir, pn_base)
- d.setVar('DEPLOY_DIR_SWUPD', deploy_dir)
-
# Swupd images must depend on the mega image having been
# built, as they will copy contents from there. For bundle
# images that is irrelevant.
@@ -110,8 +112,6 @@ python () {
return
- deploy_dir = d.expand('${DEPLOY_DIR_SWUPDBASE}/${IMAGE_BASENAME}')
- d.setVar('DEPLOY_DIR_SWUPD', deploy_dir)
# do_swupd_update requires the full swupd directory hierarchy
varflags = '%s/image %s/empty %s/www %s' % (deploy_dir, deploy_dir, deploy_dir, deploy_dir)
d.setVarFlag('do_swupd_update', 'dirs', varflags)