Skip to contentSkip to conversation

package/uboot-tools: fix FIT signature support

PATCH In review Ferdinand Bachmann 1 participant 3 messages Mar 30 – Apr 1

lore
Share & tools
lore
#0 lore raw

cover package/uboot-tools: fix FIT signature support

FIT signature support in uboot-tools is currently broken in buildroot master due to changes in uboot-tools' Makefile from the big update in 2025.11. This patch fixes the changes by adding missing defines and make options.

Note that I sent out a content-identical version of this patch a few minutes ago that had the wrong git author (@yrlf.at instead of the company email @go-e.com). Please disregard the previous version of this patch series.

Ferdinand Bachmann (1):
package/uboot-tools: fix FIT signature support

 package/uboot-tools/uboot-tools.mk | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 1/1 package/uboot-tools: fix FIT signature support

uboot-tools changed how the config system works for tool builds, which leads to buildroot's configure cmds being wrong / incomplete.

Specifically, the CONFIG_FIT_* macros are now called CONFIG_TOOLS_FIT_*, while the make options needed to compile FIT signature support are still CONFIG_FIT_*. Additionally, CONFIG_TOOLS_LIBCRYPTO is needed to link uboot-tools with FIT signature support correctly.

This patch fixes the issue by adding the new CONFIG_TOOLS_FIT_* defines to the generated autoconf.h and adding CONFIG_TOOLS_LIBCRYPTO to the make options.

---
 package/uboot-tools/uboot-tools.mk | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
package/uboot-tools/uboot-tools.mk +10 -4
index fa0b6aba78..99752a9b47 100644
@@ -31,9 +31,12 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
 	echo "#include <linux/kconfig.h>" > $(@D)/include/config.h
 	touch $(@D)/include/config/auto.conf
 	mkdir -p $(@D)/include/generated
+	touch $(@D)/include/generated/autoconf.h
 	$(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS))
 	$(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),echo '#define CONFIG_TOOLS_FIT_PRINT 1' >> $(@D)/include/generated/autoconf.h)
-	echo $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),'#define CONFIG_FIT_SIGNATURE 1') >> $(@D)/include/generated/autoconf.h
+	$(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_FIT_SIGNATURE 1' >> $(@D)/include/generated/autoconf.h)
+	$(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_FIT_SIGNATURE_MAX_SIZE 0x10000000' >> $(@D)/include/generated/autoconf.h)
+	$(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_FIT_RSASSA_PSS 1' >> $(@D)/include/generated/autoconf.h)
 	mkdir -p $(@D)/include/asm
 	touch $(@D)/include/asm/linkage.h
 endef
@@ -50,7 +53,7 @@ UBOOT_TOOLS_DEPENDENCIES += dtc
 endif
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000
+UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 CONFIG_TOOLS_LIBCRYPTO=y
 UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
 endif
 
@@ -124,9 +127,12 @@ define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
 	echo "#include <linux/kconfig.h>" > $(@D)/include/config.h
 	touch $(@D)/include/config/auto.conf
 	mkdir -p $(@D)/include/generated
+	touch $(@D)/include/generated/autoconf.h
 	$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS))
 	$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),echo '#define CONFIG_TOOLS_FIT_PRINT 1' >> $(@D)/include/generated/autoconf.h)
-	echo $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),'#define CONFIG_FIT_SIGNATURE 1') >> $(@D)/include/generated/autoconf.h
+	$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_FIT_SIGNATURE 1' >> $(@D)/include/generated/autoconf.h)
+	$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_FIT_SIGNATURE_MAX_SIZE 0x10000000' >> $(@D)/include/generated/autoconf.h)
+	$(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo '#define CONFIG_TOOLS_FIT_RSASSA_PSS 1' >> $(@D)/include/generated/autoconf.h)
 	mkdir -p $(@D)/include/asm
 	touch $(@D)/include/asm/linkage.h
 endef
@@ -142,7 +148,7 @@ HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
 endif
 
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000
+HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 CONFIG_TOOLS_LIBCRYPTO=y
 HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
 define HOST_UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN
 	$(INSTALL) -m 0755 -D $(@D)/tools/fit_check_sign $(HOST_DIR)/bin/fit_check_sign
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

I double-checked this and it seems like this also needs BR2_PACKAGE_OPENSSL_ENGINES=y to build correctly, since part of uboot-tools seems to depend on the openssl ENGINE_* family of functions now when FIT_SIGNATURE support is enabled.

See also the related GitLab work item:
https://gitlab.com/buildroot.org/buildroot/-/work_items/173

Quoted 91 lines · Ferdinand Bachmann

uboot-tools changed how the config system works for tool builds, which leads to buildroot's configure cmds being wrong / incomplete.

Specifically, the CONFIG_FIT_* macros are now called CONFIG_TOOLS_FIT_*, while the make options needed to compile FIT signature support are still CONFIG_FIT_*. Additionally, CONFIG_TOOLS_LIBCRYPTO is needed to link uboot-tools with FIT signature support correctly.

This patch fixes the issue by adding the new CONFIG_TOOLS_FIT_* defines to the generated autoconf.h and adding CONFIG_TOOLS_LIBCRYPTO to the make options.

---
 package/uboot-tools/uboot-tools.mk | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
package/uboot-tools/ renamed from package/uboot-tools/uboot-tools.mk +0 -0

uboot-tools.mk
index fa0b6aba78..99752a9b47 100644

package/uboot-tools/uboot-tools.mk +1 -1
@@ -31,9 +31,12 @@ define UBOOT_TOOLS_CONFIGURE_CMDS
        echo "#include <linux/kconfig.h>" > $(@D)/include/config.h
        touch $(@D)/include/config/auto.conf
        mkdir -p $(@D)/include/generated
+       touch $(@D)/include/generated/autoconf.h
        $(if
 $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS))
        $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),echo '#define
 CONFIG_TOOLS_FIT_PRINT 1' >> $(@D)/include/generated/autoconf.h)
-       echo $(if

$(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),'#define CONFIG_FIT_SIGNATURE 1') >> $(@D)/include/generated/autoconf.h
+ $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo
'#define CONFIG_TOOLS_FIT_SIGNATURE 1' >> $(@D)/include/generated/autoconf.h)
+ $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo
'#define CONFIG_TOOLS_FIT_SIGNATURE_MAX_SIZE 0x10000000' >> $(@D)/include/generated/autoconf.h)
+ $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo
'#define CONFIG_TOOLS_FIT_RSASSA_PSS 1' >> $(@D)/include/generated/autoconf.h)

        mkdir -p $(@D)/include/asm
        touch $(@D)/include/asm/linkage.h

endef

package/uboot-tools/uboot-tools.mk +0 -1
@@ -50,7 +53,7 @@ UBOOT_TOOLS_DEPENDENCIES += dtc
 endif
 
 ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y

CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 +UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 CONFIG_TOOLS_LIBCRYPTO=y
UBOOT_TOOLS_DEPENDENCIES += openssl host-pkgconf
endif

package/uboot-tools/uboot-tools.mk +1 -1
@@ -124,9 +127,12 @@ define HOST_UBOOT_TOOLS_CONFIGURE_CMDS
        echo "#include <linux/kconfig.h>" > $(@D)/include/config.h
        touch $(@D)/include/config/auto.conf
        mkdir -p $(@D)/include/generated
+       touch $(@D)/include/generated/autoconf.h
        $(if
 $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS))
        $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),echo '#define
 CONFIG_TOOLS_FIT_PRINT 1' >> $(@D)/include/generated/autoconf.h)
-       echo $(if

$(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),'#define CONFIG_FIT_SIGNATURE 1') >> $(@D)/include/generated/autoconf.h
+ $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo
'#define CONFIG_TOOLS_FIT_SIGNATURE 1' >> $(@D)/include/generated/autoconf.h)
+ $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo
'#define CONFIG_TOOLS_FIT_SIGNATURE_MAX_SIZE 0x10000000' >> $(@D)/include/generated/autoconf.h)
+ $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),echo
'#define CONFIG_TOOLS_FIT_RSASSA_PSS 1' >> $(@D)/include/generated/autoconf.h)

        mkdir -p $(@D)/include/asm
        touch $(@D)/include/asm/linkage.h

endef

package/uboot-tools/uboot-tools.mk +0 -1
@@ -142,7 +148,7 @@ HOST_UBOOT_TOOLS_DEPENDENCIES += host-dtc
 endif
 
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),y)
-HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y

CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 +HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_FIT_SIGNATURE=y CONFIG_FIT_SIGNATURE_MAX_SIZE=0x10000000 CONFIG_TOOLS_LIBCRYPTO=y
HOST_UBOOT_TOOLS_DEPENDENCIES += host-openssl
define HOST_UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN

Quoted 6 lines
        $(INSTALL) -m 0755 -D $(@D)/tools/fit_check_sign

$(HOST_DIR)/bin/fit_check_sign
--
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot