[1/3] image: set convenience variables in bitbake code

Message ID 20220719123954.310076-2-adriaan.schmidt@siemens.com
State Accepted, archived
Headers show
Series image and buildchroot tweaks | expand

Commit Message

Schmidt, Adriaan July 19, 2022, 4:39 a.m. UTC
Moving these variable assignments from Python code into regular
bitbake variables gives us tracking of their dependencies in signatures.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 meta/classes/image.bbclass | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 7eeed7db..0688b021 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -154,6 +154,11 @@  IMGCLASSES = "imagetypes imagetypes_wic imagetypes_vm imagetypes_container"
 IMGCLASSES += "${IMAGE_CLASSES}"
 inherit ${IMGCLASSES}
 
+# convenience variables to be used by CMDs
+IMAGE_FILE_HOST = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.${type}"
+IMAGE_FILE_CHROOT = "${PP_DEPLOY}/${IMAGE_FULLNAME}.${type}"
+SUDO_CHROOT = "sudo chroot ${BUILDCHROOT_DIR}"
+
 # hook up IMAGE_CMD_*
 python() {
     image_types = (d.getVar('IMAGE_FSTYPES') or '').split()
@@ -217,11 +222,6 @@  python() {
         if any([d.getVar(arg) is None for arg in required_args]):
             bb.fatal("IMAGE_TYPE '%s' requires these arguments: %s" % (image_type, ', '.join(required_args)))
 
-        # convenience variables to be used by CMDs
-        localdata.setVar('IMAGE_FILE_HOST', '${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.${type}')
-        localdata.setVar('IMAGE_FILE_CHROOT', '${PP_DEPLOY}/${IMAGE_FULLNAME}.${type}')
-        localdata.setVar('SUDO_CHROOT', localdata.expand('sudo chroot ${BUILDCHROOT_DIR}'))
-
         # imager install
         for dep in (d.getVar('IMAGER_INSTALL_' + bt_clean) or '').split():
             imager_install.add(dep)