From c7291625af9fa1aec1bbcd24d5f5210f0d280432 Mon Sep 17 00:00:00 2001 From: Sam Dolt Date: Fri, 17 Nov 2023 09:46:23 +0100 Subject: [PATCH] fix(coreos-image-swupdate): adapt the class to OE new image naming scheme Now the coreos-image-swupdate class and the related sw-description file use the IMAGE_LINK_NAME variable to retrieve the name of the image instead of hardcoding each components that form the image filename. This fix an issue with OE-Core master, as a .rootfs suffix was added --- .../classes/coreos-image-swupdate.bbclass | 3 ++- layers/meta-belden-coreos/files/sw-description | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass b/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass index 050dcd6..dacd87f 100644 --- a/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass +++ b/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass @@ -9,7 +9,8 @@ IMAGE_FSTYPES:append = " ext4.zst" python () { - image = d.getVar('IMAGE_BASENAME') + image = d.getVar('IMAGE_LINK_NAME') + d.setVarFlag("SWUPDATE_IMAGES_FSTYPES", image, ".ext4.zst") } diff --git a/layers/meta-belden-coreos/files/sw-description b/layers/meta-belden-coreos/files/sw-description index cbe8f14..e905567 100644 --- a/layers/meta-belden-coreos/files/sw-description +++ b/layers/meta-belden-coreos/files/sw-description @@ -7,14 +7,14 @@ software = copy0 = { images: ( { - filename = "@@PN@@-@@MACHINE@@.ext4.zst"; + filename = "@@IMAGE_LINK_NAME@@.ext4.zst"; compressed = "zstd"; installed-directly = true; # partlabel are stored inside the GPT partition table. # The partition table is flashed only once and never updated device = "/dev/disk/by-partlabel/rootfs0"; type = "raw"; - sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)"; + sha256 = "$swupdate_get_sha256(@@IMAGE_LINK_NAME@@.ext4.zst)"; } # Don't remove the trailing whitspace on the next line otherwise # it will not work due to a regex bug in meta-swupdate @@ -64,14 +64,14 @@ software = copy1 = { images: ( { - filename = "@@PN@@-@@MACHINE@@.ext4.zst"; + filename = "@@IMAGE_LINK_NAME@@.ext4.zst"; compressed = "zstd"; installed-directly = true; # partlabel are stored inside the GPT partition table. # The partition table is flashed only once and never updated device = "/dev/disk/by-partlabel/rootfs1"; type = "raw"; - sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)"; + sha256 = "$swupdate_get_sha256(@@IMAGE_LINK_NAME@@.ext4.zst)"; } # Don't remove the trailing whitspace on the next line otherwise # it will not work due to a regex bug in meta-swupdate