diff mbox series

[isar-cip-core,v3,2/3] Add check for sign-swu executable

Message ID 20240916125518.614224-3-Quirin.Gylstorff@siemens.com (mailing list archive)
State Accepted
Headers show
Series Separate swu signing script from key | expand

Commit Message

Quirin Gylstorff Sept. 16, 2024, 12:54 p.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This ensure a clear error message in case of missing packages.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 classes/swupdate.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index 06418e5..642fd79 100644
--- a/classes/swupdate.bbclass
+++ b/classes/swupdate.bbclass
@@ -233,6 +233,10 @@  IMAGE_CMD:swu() {
             cpio_files="${SWU_DESCRIPTION_FILE}"
 
             if [ -n "$sign" ]; then
+                if [ ! -x /usr/bin/sign-swu ]; then
+                    echo "Could not find the executable '/usr/bin/sign-swu'" 1>&2
+                    exit 1
+                fi
                 signature_file="${SWU_DESCRIPTION_FILE}.${SWU_SIGNATURE_EXT}"
                 if ! /usr/bin/sign-swu "${SWU_DESCRIPTION_FILE}" "$signature_file" > /dev/null 2>&1 || \
                         [ ! -f "$signature_file" ]; then