Bläddra i källkod

Fix image machine suffix handling

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.marko@siemens.com>
Peter Marko 1 månad sedan
förälder
incheckning
ded281dd81
2 ändrade filer med 8 tillägg och 8 borttagningar
  1. 6 6
      classes-recipe/swupdate-common.bbclass
  2. 2 2
      classes-recipe/swupdate.bbclass

+ 6 - 6
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:

+ 2 - 2
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: