[meta-swupdate][PATCH] classes: Fix swupdate-enc class

20 views
Skip to first unread message

Gabriel A Smith

unread,
Dec 30, 2025, 9:26:45 AM12/30/25
to swup...@googlegroups.com
From 2c94708cb5f8fad6e5a04fab6b9e3a25250367db Mon Sep 17 00:00:00 2001
From: Gabriel Smith <gabrie...@belden.com>
Date: Mon, 29 Dec 2025 16:15:48 -0500
Subject: [meta-swupdate][PATCH] classes: Fix swupdate-enc class

CONVERSIONTYPES does not appear to work unless image_types is inherited
by the class modifying CONVERSIONTYPES et al.

The conversion command was also incorrect, or perhaps just followed an
old standard. Conversion commands don't work on Yocto 5.3 when the
image name suffix is appended. Additionally, bitbake threw a warning if
there were no spaces around the "=" in the assignment of
CONVERSION_CMD:enc.

Signed-off-by: Gabriel Smith <gabrie...@belden.com>
---
classes-recipe/swupdate-enc.bbclass | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/classes-recipe/swupdate-enc.bbclass b/classes-recipe/swupdate-enc.bbclass
index d6826d2..1e28f02 100644
--- a/classes-recipe/swupdate-enc.bbclass
+++ b/classes-recipe/swupdate-enc.bbclass
@@ -1,3 +1,5 @@
+inherit image_types
+
#
# The key must be generated as described in doc
# with
@@ -20,4 +22,4 @@ swu_encrypt_file() {
CONVERSIONTYPES += "enc"

CONVERSION_DEPENDS_enc = "openssl-native coreutils-native"
-CONVERSION_CMD:enc="swu_encrypt_file ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.enc"
+CONVERSION_CMD:enc = "swu_encrypt_file ${IMAGE_NAME}.${type} ${IMAGE_NAME}.${type}.enc"
--
2.51.2


**********************************************************************
DISCLAIMER:
Privileged and/or Confidential information may be contained in this message. If you are not the addressee of this message, you may not copy, use or deliver this message to anyone. In such event, you should destroy the message and kindly notify the sender by reply e-mail. It is understood that opinions or conclusions that do not relate to the official business of the company are neither given nor endorsed by the company. Thank You.

Stefano Babic

unread,
Dec 30, 2025, 9:43:55 AM12/30/25
to Gabriel A Smith, swup...@googlegroups.com
Hi Gabriel,

On 12/30/25 15:20, 'Gabriel A Smith' via swupdate wrote:
> From 2c94708cb5f8fad6e5a04fab6b9e3a25250367db Mon Sep 17 00:00:00 2001
> From: Gabriel Smith <gabrie...@belden.com>
> Date: Mon, 29 Dec 2025 16:15:48 -0500
> Subject: [meta-swupdate][PATCH] classes: Fix swupdate-enc class
>
> CONVERSIONTYPES does not appear to work unless image_types is inherited
> by the class modifying CONVERSIONTYPES et al.
>
> The conversion command was also incorrect, or perhaps just followed an
> old standard.

This is in fact dead code - encryption is done by the main class. I
supposed to remove completely this class, but I have no problem to apply
your patch and to let the class if there are users of it. Just asking:
the supported way is to add a flag to the artifact to be encrypted, as:

SWUPDATE_IMAGES_ENCRYPTED[<filename to be encrypted>] = "1"

Is there some reason to use this class instead ?

Best regards,
Stefano Babic

Gabriel A Smith

unread,
Jan 2, 2026, 11:36:37 AMJan 2
to Stefano Babic, swup...@googlegroups.com

Hello Stefano,

 

When reading the documentation I was under the impression that SWUPDATE_IMAGES_ENCRYPTED only works with the full file name which may be dependent on variables. From some quick testing it looks like variables cannot be used in flags, but also the full file name is not needed. Only the “simple” name based on the image recipe is needed, and maybe only the extension. Therefore, I don’t need this patch and can use the newer way.

 

Thank you,

Picture1.png

Connect to what's possible.

Line.png

Gabriel Smith
Lead Embedded Software Engineer

Gabrie...@Belden.com
M: +14342278003

 

 

 


DISCLAIMER:
Privileged and/or Confidential information may be contained in this message. If you are not the addressee of this message, you may not copy, use or deliver this message to anyone. In such event, you should destroy the message and kindly notify the sender by reply e-mail. It is understood that opinions or conclusions that do not relate to the official business of the company are neither given nor endorsed by the company. Thank You.

 

From: Stefano Babic <stefan...@swupdate.org>
Sent: Tuesday, December 30, 2025 9:44 AM
To: Gabriel A Smith <Gabrie...@belden.com>; swup...@googlegroups.com
Subject: Re: [swupdate] [meta-swupdate][PATCH] classes: Fix swupdate-enc class

 

Hi Gabriel, On 12/30/25 15:20, 'Gabriel A Smith' via swupdate wrote: > From 2c94708cb5f8fad6e5a04fab6b9e3a25250367db Mon Sep 17 00:00:00 2001 > From: Gabriel Smith <gabriel.smith@belden.com> > Date: Mon, 29 Dec 2025 16:15:48 -0500

Reply all
Reply to author
Forward
0 new messages