From 566bb2bb76acadd9225b281f39bf030d28b2020b Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Fri, 7 Nov 2025 13:08:44 +0100 Subject: [PATCH] package/uboot-tools: enable all hash algorithms if FIT support is enabled This allows using any of the hash algorithms supported by U-Boot for checksum (hash-N) nodes when building a FIT image, instead of only SHA-1 or SHA-256. Fixes: 14a0169714cd5c35be40faadc066412f144bc1a6 "package/uboot-tools: Bump to version 2025.10" Signed-off-by: Fiona Klute Signed-off-by: Julien Olivain --- package/uboot-tools/uboot-tools.mk | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk index dcc9c08fd2..37ccd7b953 100644 --- a/package/uboot-tools/uboot-tools.mk +++ b/package/uboot-tools/uboot-tools.mk @@ -17,13 +17,21 @@ UBOOT_TOOLS_INSTALL_STAGING = YES UBOOT_TOOLS_DEPENDENCIES = $(BR2_MAKE_HOST_DEPENDENCY) HOST_UBOOT_TOOLS_DEPENDENCIES = $(BR2_MAKE_HOST_DEPENDENCY) host-gnutls +# the available hash algorithms and the way to enable them are the +# same for host and target +UBOOT_TOOLS_HASH_ALGOS = CRC16 CRC32 MD5 SHA1 SHA256 SHA384 SHA512 +define UBOOT_TOOLS_ENABLE_HASH_ALGOS + $(foreach hash,$(UBOOT_TOOLS_HASH_ALGOS),\ + echo '#define CONFIG_TOOLS_$(hash) 1' >> $(@D)/include/generated/autoconf.h + ) +endef + define UBOOT_TOOLS_CONFIGURE_CMDS mkdir -p $(@D)/include/config echo "#include " > $(@D)/include/config.h touch $(@D)/include/config/auto.conf mkdir -p $(@D)/include/generated - echo "#define CONFIG_TOOLS_SHA256 1" >> $(@D)/include/generated/autoconf.h - echo "#define CONFIG_TOOLS_SHA1 1" >> $(@D)/include/generated/autoconf.h + $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS)) echo $(if $(BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),'#define CONFIG_FIT_SIGNATURE 1') >> $(@D)/include/generated/autoconf.h mkdir -p $(@D)/include/asm touch $(@D)/include/asm/linkage.h @@ -115,8 +123,7 @@ define HOST_UBOOT_TOOLS_CONFIGURE_CMDS echo "#include " > $(@D)/include/config.h touch $(@D)/include/config/auto.conf mkdir -p $(@D)/include/generated - echo "#define CONFIG_TOOLS_SHA256 1" >> $(@D)/include/generated/autoconf.h - echo "#define CONFIG_TOOLS_SHA1 1" >> $(@D)/include/generated/autoconf.h + $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT),$(UBOOT_TOOLS_ENABLE_HASH_ALGOS)) echo $(if $(BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT),'#define CONFIG_FIT_SIGNATURE 1') >> $(@D)/include/generated/autoconf.h mkdir -p $(@D)/include/asm touch $(@D)/include/asm/linkage.h