Skip to contentSkip to conversation

Makefile: pass KEYDIR when set to sunxi-spl.bin mkimage

PATCH In review James Hilliard 2 participants 3 messages Apr 11, 2025 – Oct 20, 2025 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: pass KEYDIR when set to sunxi-spl.bin mkimage

Currently we pass this for u-boot-spl.kwb targets, however when building sunxi-spl.bin in the TOC0 format we may also need to specify a KEYDIR, as such we should also pass this when set to mkimage for the sunxi-spl.bin target.

---
 scripts/Makefile.xpl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/Makefile.xpl +2 -1
index abc49fbe6c9..d1c1cea876a 100644
@@ -445,7 +445,8 @@ MKIMAGEFLAGS_sunxi-spl.bin = \
 	-A $(ARCH) \
 	-T $(CONFIG_SPL_IMAGE_TYPE) \
 	-a $(CONFIG_SPL_TEXT_BASE) \
-	-n $(CONFIG_DEFAULT_DEVICE_TREE)
+	-n $(CONFIG_DEFAULT_DEVICE_TREE) \
+	$(if $(KEYDIR),-k $(KEYDIR))
 
 OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 16 lines · James Hilliard

Currently we pass this for u-boot-spl.kwb targets, however when building sunxi-spl.bin in the TOC0 format we may also need to specify a KEYDIR, as such we should also pass this when set to mkimage for the sunxi-spl.bin target.

---
 scripts/Makefile.xpl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/Makefile.xpl +0 -0
index abc49fbe6c9..d1c1cea876a 100644

scripts/Makefile.xpl MKIMAGEFLAGS_sunxi-spl.bin = \ · line 449

Quoted 6 lines
scripts/Makefile.xpl +2 -1
@@ -445,7 +445,8 @@ MKIMAGEFLAGS_sunxi-spl.bin = \
        -A $(ARCH) \
        -T $(CONFIG_SPL_IMAGE_TYPE) \
        -a $(CONFIG_SPL_TEXT_BASE) \
-       -n $(CONFIG_DEFAULT_DEVICE_TREE)
+       -n $(CONFIG_DEFAULT_DEVICE_TREE) \
+       $(if $(KEYDIR),-k $(KEYDIR))

Does this look good to merge?

Quoted 6 lines
scripts/Makefile.xpl +0 -1
 OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)
 
--

2.34.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to James Hilliard

On Thu, 10 Apr 2025 19:10:25 -0600
James Hilliard <[email protected]> wrote:

Hi,

Quoted 4 lines

Currently we pass this for u-boot-spl.kwb targets, however when building sunxi-spl.bin in the TOC0 format we may also need to specify a KEYDIR, as such we should also pass this when set to mkimage for the sunxi-spl.bin target.

thanks, looks good to me, tried on a Remix Mini build. Maybe that even helps with the secure boot CI build problem we have, as the CI cannot find any keys.

Quoted 1 line

Queued for the PR.

Cheers,
Andre

Quoted 18 lines
---
 scripts/Makefile.xpl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/Makefile.xpl +2 -1
index abc49fbe6c9..d1c1cea876a 100644
@@ -445,7 +445,8 @@ MKIMAGEFLAGS_sunxi-spl.bin = \
 	-A $(ARCH) \
 	-T $(CONFIG_SPL_IMAGE_TYPE) \
 	-a $(CONFIG_SPL_TEXT_BASE) \
-	-n $(CONFIG_DEFAULT_DEVICE_TREE)
+	-n $(CONFIG_DEFAULT_DEVICE_TREE) \
+	$(if $(KEYDIR),-k $(KEYDIR))
 
 OBJCOPYFLAGS_u-boot-spl-dtb.hex := -I binary -O ihex --change-address=$(CONFIG_SPL_TEXT_BASE)