[meta-swupdate][PATCH 0/1] handle IMAGE_MACHINE_SUFFIX

16 views
Skip to first unread message

Peter Marko

unread,
Apr 16, 2026, 4:03:09 AM (6 days ago) Apr 16
to swup...@googlegroups.com, Peter Marko
See commit message for details.

One thing to note is that I'm not sure why this suffix presence flag is
implemented. Possibly it's there because some images have empty
IMAGE_MACHINE_SUFFIX and instead of rework the code should be just
deleted. I have rather only fixed the problem at hand instead of rework
due to this uncertainty.

Peter Marko (1):
Fix image machine suffix handling

classes-recipe/swupdate-common.bbclass | 12 ++++++------
classes-recipe/swupdate.bbclass | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)

Peter Marko

unread,
Apr 16, 2026, 4:03:16 AM (6 days ago) Apr 16
to swup...@googlegroups.com, Peter Marko
From: Peter Marko <peter...@siemens.com>

oe-core image classes use IMAGE_MACHINE_SUFFIX, not MACHINE variable.
It works most of the time because it defaults to "-${MACHINE}", but with
non-default IMAGE_MACHINE_SUFFIX the logic is failing.

Signed-off-by: Peter Marko <peter...@siemens.com>
---
classes-recipe/swupdate-common.bbclass | 12 ++++++------
classes-recipe/swupdate.bbclass | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass
index 80a5d5b..0fbcd20 100644
--- a/classes-recipe/swupdate-common.bbclass
+++ b/classes-recipe/swupdate-common.bbclass
@@ -20,7 +20,7 @@ do_swuimage[dirs] = "${SWUDEPLOYDIR}"
do_swuimage[cleandirs] += "${SWUDEPLOYDIR}"
do_swuimage[sstate-inputdirs] = "${SWUDEPLOYDIR}"
do_swuimage[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
-do_swuimage[stamp-extra-info] = "${MACHINE}"
+do_swuimage[stamp-extra-info] = "${IMAGE_MACHINE_SUFFIX}"

python () {
deps = " " + swupdate_getdepends(d)
@@ -297,12 +297,12 @@ def swupdate_add_artifacts(d, list_for_cpio):
encrypted = (d.getVarFlag("SWUPDATE_IMAGES_ENCRYPTED", image) or "")
if fstypes:
noappend_machine = d.getVarFlag("SWUPDATE_IMAGES_NOAPPEND_MACHINE", image)
- if noappend_machine == "0": # Search for a file explicitly with MACHINE
- imagebases = [ image + '-' + d.getVar('MACHINE') ]
- elif noappend_machine == "1": # Search for a file explicitly without MACHINE
+ if noappend_machine == "0": # Search for a file explicitly with IMAGE_MACHINE_SUFFIX
+ imagebases = [ image + d.getVar('IMAGE_MACHINE_SUFFIX') ]
+ elif noappend_machine == "1": # Search for a file explicitly without IMAGE_MACHINE_SUFFIX
imagebases = [ image ]
- else: # None, means auto mode. Just try to find an image file with MACHINE or without MACHINE
- imagebases = [ image + '-' + d.getVar('MACHINE'), image ]
+ else: # None, means auto mode. Just try to find an image file with IMAGE_MACHINE_SUFFIX or without IMAGE_MACHINE_SUFFIX
+ imagebases = [ image + d.getVar('IMAGE_MACHINE_SUFFIX'), image ]
for fstype in fstypes:
image_found = False
for imagebase in imagebases:
diff --git a/classes-recipe/swupdate.bbclass b/classes-recipe/swupdate.bbclass
index 5390c9b..f7134ac 100644
--- a/classes-recipe/swupdate.bbclass
+++ b/classes-recipe/swupdate.bbclass
@@ -22,9 +22,9 @@
# Example:
# SWUPDATE_IMAGES = "core-image-full-cmdline"
# SWUPDATE_IMAGES_FSTYPES[core-image-full-cmdline] = ".ext4.gz"
-# For this example either a file core-image-full-cmdline-${MACHINE}.ext4.gz or a file
+# For this example either a file core-image-full-cmdline${IMAGE_MACHINE_SUFFIX}.ext4.gz or a file
# core-image-full-cmdline.ext4.gz gets added the swu archive. Optionally the variable
-# SWUPDATE_IMAGES_NOAPPEND_MACHINE allows to explicitly define if the MACHINE name
+# SWUPDATE_IMAGES_NOAPPEND_MACHINE allows to explicitly define if the IMAGE_MACHINE_SUFFIX name
# must be part of the image file name or not.
# * image file name(s)
# Example:
Reply all
Reply to author
Forward
0 new messages