From f20fc6a32d9da903b6b7600be6c107154afe9277 Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Mon, 30 Jan 2023 13:25:35 +0100 Subject: [PATCH 1/2] fix(coreos-image): COREOS_IMAGE_EXTRACLASSES now work as expected COREOS_IMAGE_EXTRACLASSES is used to ihnerit classes dynamically during parsing, that mean that it can't depends on operator that operate after parsing, like ??=, :append, ... Now we use the ?= and += operator that operate during parsing --- .../meta-belden-coreos/classes/coreos-image.bbclass | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layers/meta-belden-coreos/classes/coreos-image.bbclass b/layers/meta-belden-coreos/classes/coreos-image.bbclass index 024c3fc..589bbae 100644 --- a/layers/meta-belden-coreos/classes/coreos-image.bbclass +++ b/layers/meta-belden-coreos/classes/coreos-image.bbclass @@ -91,11 +91,11 @@ IMAGE_ROOTFS_EXTRA_SPACE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'sys # Unified kernel image and swupdate support # ============================================================================== -COREOS_IMAGE_GENERATE_UKI ??= "${@bb.utils.contains('COMBINED_FEATURES', 'efi', '1', '0', d)}" -COREOS_IMAGE_GENERATE_SWU ??= "${@bb.utils.contains('IMAGE_FEATURES', 'swupdate', '1', '0', d)}" - # Support for Unified Kernel Image and Swupdate are optional -COREOS_IMAGE_EXTRACLASSES ??= "" -COREOS_IMAGE_EXTRACLASSES:append = "${@' coreos-image-uki' if d.getVar('COREOS_IMAGE_GENERATE_UKI') == '1' else ''}" -COREOS_IMAGE_EXTRACLASSES:append = "${@' coreos-image-swupdate' if d.getVar('COREOS_IMAGE_GENERATE_SWU') == '1' else ''}" +COREOS_IMAGE_GENERATE_UKI ?= "1" +COREOS_IMAGE_GENERATE_SWU ?= "1" + +COREOS_IMAGE_EXTRACLASSES += "${@'coreos-image-uki' if d.getVar('COREOS_IMAGE_GENERATE_UKI') == '1' else ''}" +COREOS_IMAGE_EXTRACLASSES += "${@'coreos-image-swupdate' if d.getVar('COREOS_IMAGE_GENERATE_SWU') == '1' else ''}" + inherit ${COREOS_IMAGE_EXTRACLASSES} From c65869b9c9a667fb689c5d3498ef21117d5ab648 Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Mon, 30 Jan 2023 13:28:15 +0100 Subject: [PATCH 2/2] fix(do_swuimage): use DEPENDS to get kernel arguments WKS_KERNEL_ARGS was using previously inside COREOS to pass the kernel arguments between the machine configuration and image generation. This was already replaced by the APPEND variable that do the same and is documented in oe-core. --- .../meta-belden-coreos/classes/coreos-image-swupdate.bbclass | 2 +- layers/meta-belden-coreos/files/sw-description | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass b/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass index 901a4c1..36357e7 100644 --- a/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass +++ b/layers/meta-belden-coreos/classes/coreos-image-swupdate.bbclass @@ -19,7 +19,7 @@ python () { inherit swupdate-image # Ensure than variable used in the sw-description files are watched for change -do_swuimage[vardeps] += "COREOS_KERNEL0_FILENAME COREOS_KERNEL1_FILENAME EFIBOOTGUARD_TIMEOUT COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY" +do_swuimage[vardeps] += "COREOS_KERNEL0_FILENAME COREOS_KERNEL1_FILENAME EFIBOOTGUARD_TIMEOUT COREOS_DISK_PARTLABEL_LOOKUP_DIRECTORY APPEND" do_swuimage[deptask] += "do_bundle_uki" SWUPDATE_IMAGES += "${COREOS_KERNEL0_NAME} ${COREOS_KERNEL1_NAME}" diff --git a/layers/meta-belden-coreos/files/sw-description b/layers/meta-belden-coreos/files/sw-description index 7ad1225..29fb378 100644 --- a/layers/meta-belden-coreos/files/sw-description +++ b/layers/meta-belden-coreos/files/sw-description @@ -31,7 +31,7 @@ software = bootenv: ( { name = "kernelparams"; - value = "root=PARTLABEL=platform0 @@WKS_KERNEL_ARGS@@"; + value = "root=PARTLABEL=platform0 @@APPEND@@"; }, { name = "watchdog_timeout_sec"; @@ -71,7 +71,7 @@ software = bootenv: ( { name = "kernelparams"; - value = "root=PARTLABEL=platform1 @@WKS_KERNEL_ARGS@@"; + value = "root=PARTLABEL=platform1 @@APPEND@@"; }, { name = "watchdog_timeout_sec";