diff mbox series

[meta-swupdate] Use IMAGE_NAME_SUFFIX in the artifact name

Message ID 20241111093247.202588-1-stefano.babic@swupdate.org
State Accepted
Headers show
Series [meta-swupdate] Use IMAGE_NAME_SUFFIX in the artifact name | expand

Commit Message

Stefano Babic Nov. 11, 2024, 9:32 a.m. UTC
Since scarthgap, IMAGE_NAME_SUFFIX is set as default and this causes
breakages because the suffix must be added to SWUPDATE_IMAGE_FSTYPES,
else the artifact is not found. Fix this by adding the suffix to the
artifact name.

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 classes-recipe/swupdate-image.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--
2.43.0
diff mbox series

Patch

diff --git a/classes-recipe/swupdate-image.bbclass b/classes-recipe/swupdate-image.bbclass
index 0ca7b2d..32afc1f 100644
--- a/classes-recipe/swupdate-image.bbclass
+++ b/classes-recipe/swupdate-image.bbclass
@@ -20,7 +20,9 @@  SWUPDATE_IMAGES += "${IMAGE_BASENAME}"

 python () {
     image = d.getVar('IMAGE_BASENAME')
-    if d.getVarFlag("SWUPDATE_IMAGES_FSTYPES", image) is None:
+    t = d.getVarFlag("SWUPDATE_IMAGES_FSTYPES", image)
+    suffix = d.getVar("IMAGE_NAME_SUFFIX") or ""
+    if t is None:
        flag = d.getVarFlag("SWUPDATE_IMAGES_FSTYPES", d.getVar('IMAGE_BASENAME'))
        if flag:
           d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", image, flag)
@@ -30,8 +32,10 @@  python () {
               bb.fatal("SWUPDATE_IMAGES_FSTYPES[%s] is not set !" % image)
           for t in fstypes:
               bb.warn("SWUPDATE_IMAGES_FSTYPES[%s] not set, setting to %s" % (image, t))
-              d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", image, "." + t)
+              d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", image, suffix + "." + t)
               break
+    else:
+       d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", image, suffix + t)
 }

 python do_swupdate_copy_swdescription() {