diff mbox series

[isar-cip-core] swupdate-handler-roundrobin: Silence fetcher warnings with different SWUPDATE_BOOTLOADER

Message ID 1d91a4c3-cba0-44cb-b069-82232e877679@siemens.com (mailing list archive)
State New
Headers show
Series [isar-cip-core] swupdate-handler-roundrobin: Silence fetcher warnings with different SWUPDATE_BOOTLOADER | expand

Commit Message

Jan Kiszka April 10, 2024, 9:32 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

If SWUPDATE_BOOTLOADER is set to something else than efibootguard, e.g.
u-boot, we get warnings like this:

Unable to get checksum for swupdate-handler-roundrobin SRC_URI entry swupdate.handler.u-boot.ini: file could not be found

Our recipe only supports efibootguard, and downstream layers may not
even use it when a different bootloader is used. If downstream actually
wants to use out recipe and also provide some own swupdate.handler.ini,
it should rather override SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../swupdate-handler-roundrobin_0.1.bb                    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb
index 70ba522b..a185f253 100644
--- a/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb
+++ b/recipes-core/swupdate-handler-roundrobin/swupdate-handler-roundrobin_0.1.bb
@@ -17,8 +17,8 @@  SRCREV_swupdate-handler-roundrobin ?= "e6936b8c29a20cb6a6893faae57e12499ebbc342"
 
 SWUPDATE_LUASCRIPT = "swupdate-handler-roundrobin/swupdate_handlers_roundrobin.lua"
 
-SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG ?= "swupdate.handler.${SWUPDATE_BOOTLOADER}.ini"
-SRC_URI += "${@('file://' + d.getVar('SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG')) if d.getVar('SWUPDATE_BOOTLOADER') else ''}"
+SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG ?= "${@ 'swupdate.handler.efibootguard.ini' if d.getVar('SWUPDATE_BOOTLOADER') == 'efibootguard' else ''}"
+SRC_URI += "${@('file://' + d.getVar('SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG')) if d.getVar('SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG') else ''}"
 
 # The lua version used by swupdate to search for additional handler is hard coded in debian/rules
 # see https://salsa.debian.org/debian/swupdate/-/blob/6ccd44a8539ebb880bf0dac408d5db5de7e2de99/debian/rules#L13
@@ -37,7 +37,7 @@  do_install() {
     if [ -e ${WORKDIR}/${SWUPDATE_LUASCRIPT} ]; then
         install -m 0644 ${WORKDIR}/${SWUPDATE_LUASCRIPT} ${D}/usr/share/lua/${SWUPDATE_LUA_VERSION}/swupdate_handlers.lua
     fi
-    if [ -e ${WORKDIR}/${SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG} ]; then
-       install -m 0644 ${WORKDIR}/${SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG} ${D}/etc/swupdate.handler.ini
+    if [ -n "${SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG}" ] && [ -e ${WORKDIR}/${SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG} ]; then
+        install -m 0644 ${WORKDIR}/${SWUPDATE_ROUND_ROBIN_HANDLER_CONFIG} ${D}/etc/swupdate.handler.ini
     fi
 }