public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Kory Maincent <kory.maincent@bootlin.com>
To: openembedded-core@lists.openembedded.org
Cc: "Jérémie Dautheribes" <jeremie.dautheribes@bootlin.com>,
	thomas.petazzoni@bootlin.com,
	"Kory Maincent" <kory.maincent@bootlin.com>
Subject: [OE-core][PATCH] uboot-sign: Rebuild binman image with configuration signing keys
Date: Wed,  4 Feb 2026 16:33:44 +0100	[thread overview]
Message-ID: <20260204153344.445281-1-kory.maincent@bootlin.com> (raw)

When using binman to generate U-Boot images, the configuration signing
keys are not included in the final image. This occurs because the binman
image is not regenerated after the configuration signing keys are added
to the device tree.

In case binman is used, regenerate the image with the updated device tree
containing the configuration signing keys. This ensures the signed
configuration is properly included in the final U-Boot image.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 meta/classes-recipe/uboot-sign.bbclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass
index 9cb5c6ccf3..9268bfc451 100644
--- a/meta/classes-recipe/uboot-sign.bbclass
+++ b/meta/classes-recipe/uboot-sign.bbclass
@@ -192,6 +192,15 @@ concat_dtb() {
 				-k "${UBOOT_DTB_BINARY}" \
 				-f ${B}/unused.itb
 		fi
+
+		# Regenerate binman image with the newly signed key
+		if [ "${UBOOT_BINMAN_IMAGE}" = "1" ] && [ -f "..binman_stamp.cmd" ]; then
+			binman_cmd=$(sed -n 's/^cmd_[^:]*:= *//p' ..binman_stamp.cmd)
+			dtb_binary=$(basename ${UBOOT_DTB_BINARY} .dtb)
+			binman_cmd="${binman_cmd} -a of-list=\"${dtb_binary}\" -a default-dt=\"${dtb_binary}\""
+			eval ${binman_cmd}
+		fi
+
 		cp ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SIGNED}
 	fi
 
-- 
2.43.0



                 reply	other threads:[~2026-02-04 15:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260204153344.445281-1-kory.maincent@bootlin.com \
    --to=kory.maincent@bootlin.com \
    --cc=jeremie.dautheribes@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox