diff mbox series

swupdate.bbclass: add SWU_BOOTLOADER='none' support

Message ID 20240703121756.2164672-1-ch@denx.de (mailing list archive)
State New
Headers show
Series swupdate.bbclass: add SWU_BOOTLOADER='none' support | expand

Commit Message

Claudius Heine July 3, 2024, 12:17 p.m. UTC
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.

Signed-off-by: Claudius Heine <ch@denx.de>
---
 classes/swupdate.bbclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index e91238d..aa0af00 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -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