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

7 views
Skip to first unread message

Gabriel A Smith

unread,
Dec 30, 2025, 9:26:45 AM (22 hours ago) Dec 30
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 AM (22 hours ago) Dec 30
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
Reply all
Reply to author
Forward
0 new messages