diff mbox series

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

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

Commit Message

Quirin Gylstorff Sept. 9, 2024, 11:21 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

This es 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(+)

Comments

Felix Moessbauer Sept. 11, 2024, 7:48 a.m. UTC | #1
On Mon, 2024-09-09 at 13:21 +0200, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> This es ensure a clear error message in case of missing packages.

Please check the commit message ;)
And please CC me in the v2 of this series.

Felix

> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  classes/swupdate.bbclass | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
> index 06418e5..f1af1ff 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
diff mbox series

Patch

diff --git a/classes/swupdate.bbclass b/classes/swupdate.bbclass
index 06418e5..f1af1ff 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