@@ -296,8 +296,11 @@ def swupdate_add_artifacts(d, list_for_cpio):
fstypes = (d.getVarFlag("SWUPDATE_IMAGES_FSTYPES", image) or "").split()
encrypted = (d.getVarFlag("SWUPDATE_IMAGES_ENCRYPTED", image) or "")
if fstypes:
+ noappend_distro = d.getVarFlag("SWUPDATE_IMAGES_NOAPPEND_DISTRO", image)
noappend_machine = d.getVarFlag("SWUPDATE_IMAGES_NOAPPEND_MACHINE", image)
- if noappend_machine == "0": # Search for a file explicitly with MACHINE
+ if noappend_distro == "0" and noappend_machine == "0": # Search for a file explicitly with DISTRO and MACHINE
+ imagebases = [ image + '-' + d.getVar('DISTRO') + '-' + d.getVar('MACHINE') ]
+ elif 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
imagebases = [ image ]
@@ -23,9 +23,10 @@
# 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
-# 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
-# must be part of the image file name or not.
+# core-image-full-cmdline.ext4.gz gets added the swu archive. Optionally the variables
+# SWUPDATE_IMAGES_NOAPPEND_MACHINE and SWUPDATE_IMAGES_NOAPPEND_DISTRO allow to
+# explicitly define if the MACHINE and/or DISTRO names must be part of the image
+# file name or not.
# * image file name(s)
# Example:
# SWUPDATE_IMAGES = "core-image-full-cmdline.ext4.gz"
Currently, only images containing the MACHINE name are supported. With this change, when both SWUPDATE_IMAGES_NOAPPEND_DISTRO and SWUPDATE_IMAGES_NOAPPEND_MACHINE are set to 0, rootfs formatted as <image-name>-<DISTRO>-<MACHINE> will be searched too. This is particularly useful for STMicroelectronics (OpenSTLinux) BSPs, where the generated rootfs for a selected image always contains both the distro and the machine names. For example: core-image-full-cmdline-openstlinux-weston-stm32mp25-eval.rootfs.ext4.gz Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- classes-recipe/swupdate-common.bbclass | 5 ++++- classes-recipe/swupdate.bbclass | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-)