Skip to contentSkip to conversation

swupdate.bbclass: add SWU_BOOTLOADER='none' support

PATCH New Claudius Heine 1 participant 1 message Jul 3, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 swupdate.bbclass: add SWU_BOOTLOADER='none' support

On some systems the update process and bootloader integration is more complex and custom, thus integrated into handler and wrapper scripts.

Bootloader support on swupdate and the default cip-core update structure will not function correctly and need to be deactivated.

This change implements a none setting for SWU_BOOTLOADER which allows to deactive any SWU_DESCRIPITION_FILE_BOOTLOADER handling.

---
 classes/swupdate.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
classes/swupdate.bbclass +7 -3
index e91238d..aa0af00 100644
@@ -52,9 +52,11 @@ IMAGE_INSTALL += "${@'swupdate-certificates' if bb.utils.to_boolean(d.getVar('SW
 
 
 IMAGE_SRC_URI:swu = "file://${SWU_DESCRIPTION_FILE}.tmpl"
-IMAGE_SRC_URI:swu += "file://${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl"
+IMAGE_SRC_URI:swu += "${'file://${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl' \
+    if d.getVar('SWU_BOOTLOADER') not in ['', 'none'] else ''}"
 IMAGE_TEMPLATE_FILES:swu = "${SWU_DESCRIPTION_FILE}.tmpl"
-IMAGE_TEMPLATE_FILES:swu += "${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl"
+IMAGE_TEMPLATE_FILES:swu += "${'${SWU_DESCRIPITION_FILE_BOOTLOADER}.tmpl' \
+    if d.getVar('SWU_BOOTLOADER') not in ['', 'none'] else ''}"
 IMAGE_TEMPLATE_VARS:swu = " \
     SWU_ROOTFS_ARTIFACT_NAME \
     TARGET_IMAGE_UUID \
@@ -192,7 +194,9 @@ FILESEXTRAPATHS:append = ":${LAYERDIR_cip-core}/recipes-core/images/swu"
 
 do_image_swu[depends] += "${PN}:do_transform_template"
 do_image_swu[stamp-extra-info] = "${DISTRO}-${MACHINE}"
-do_image_swu[cleandirs] += "${WORKDIR}/swu ${WORKDIR}/swu-${SWU_BOOTLOADER}"
+do_image_swu[cleandirs] += "${WORKDIR}/swu"
+do_image_swu[cleandirs] += "${@'${WORKDIR}/swu-${SWU_BOOTLOADER}' \
+    if d.getVar('SWU_BOOTLOADER') not in ['', 'none'] else ''}"
 do_image_swu[prefuncs] = "do_extend_sw_description"
 IMAGE_CMD:swu() {
     rm -f '${DEPLOY_DIR_IMAGE}/${SWU_IMAGE_FILE}'*.swu
Signature · 1 line
2.45.2