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: 14a0169714 "package/uboot-tools:
Bump to version 2025.10"

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Fiona Klute
2025-11-07 13:08:44 +01:00
committed by Julien Olivain
parent ec754cddf8
commit 566bb2bb76
+11 -4
View File
@@ -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 <linux/kconfig.h>" > $(@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 <linux/kconfig.h>" > $(@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