From 9dc4128e033c3fa902ecfe5926a393620bfa817c Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Tue, 8 Jul 2025 05:59:43 +0800 Subject: [PATCH] uboot-tools: update to v2025.07 Update to the latest version. Remove upstreamed patches: 010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch[1] 011-tools-fit_check_sign-make-key-optional.patch[2] 012-tools-fit_check_sign-no-libcrypto.patch[2] [1] https://github.com/u-boot/u-boot/commit/40dcd5088b7f64ee2841c233c8ab82ce9c188d73 [2] https://github.com/u-boot/u-boot/commit/9c79c8fe70da7cd05fa4c242197f14122f245d81 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/19342 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-tools/Makefile | 6 +- ...03-tools-dumpimage-fix-tools-compile.patch | 4 +- ...kip-in-tools-build-if-key-is-missing.patch | 69 -------------- ...ols-fit_check_sign-make-key-optional.patch | 92 ------------------- ...12-tools-fit_check_sign-no-libcrypto.patch | 13 --- ...tools-fit_check_sign-all-image-types.patch | 15 +-- ...4-tools-fit_check_sign-no-decompress.patch | 4 +- 7 files changed, 15 insertions(+), 188 deletions(-) delete mode 100644 package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch delete mode 100644 package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch delete mode 100644 package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch diff --git a/package/boot/uboot-tools/Makefile b/package/boot/uboot-tools/Makefile index de9c575b036..e41ed78f4ea 100644 --- a/package/boot/uboot-tools/Makefile +++ b/package/boot/uboot-tools/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_DISTNAME:=u-boot -PKG_VERSION:=2025.01 -PKG_RELEASE:=3 +PKG_VERSION:=2025.07 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -10,7 +10,7 @@ PKG_SOURCE_URL:= \ https://mirror.cyberbits.eu/u-boot \ ftp://ftp.denx.de/pub/u-boot PKG_URL:=http://www.denx.de/wiki/U-Boot -PKG_HASH:=cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f +PKG_HASH:=0f933f6c5a426895bf306e93e6ac53c60870e4b54cda56d95211bec99e63bec7 PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION) diff --git a/package/boot/uboot-tools/patches/003-tools-dumpimage-fix-tools-compile.patch b/package/boot/uboot-tools/patches/003-tools-dumpimage-fix-tools-compile.patch index a296fd234e8..9e7e749fab2 100644 --- a/package/boot/uboot-tools/patches/003-tools-dumpimage-fix-tools-compile.patch +++ b/package/boot/uboot-tools/patches/003-tools-dumpimage-fix-tools-compile.patch @@ -46,7 +46,7 @@ Signed-off-by: Scott Mercer # Enable all the config-independent tools ifneq ($(HOST_TOOLS_ALL),) CONFIG_ARCH_KIRKWOOD = y -@@ -244,15 +264,10 @@ hostprogs-$(CONFIG_MIPS) += mips-relocs +@@ -261,15 +281,10 @@ hostprogs-$(CONFIG_MIPS) += mips-relocs hostprogs-$(CONFIG_ASN1_COMPILER) += asn1_compiler HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include @@ -66,7 +66,7 @@ Signed-off-by: Scott Mercer mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o HOSTLDLIBS_mkfwumdata += -luuid -@@ -313,10 +328,9 @@ HOST_EXTRACFLAGS += -include $(srctree)/ +@@ -330,10 +345,9 @@ HOST_EXTRACFLAGS += -include $(srctree)/ -I$(srctree)/scripts/dtc/libfdt \ -I$(srctree)/tools \ -DUSE_HOSTCC \ diff --git a/package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch b/package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch deleted file mode 100644 index 9defb598eed..00000000000 --- a/package/boot/uboot-tools/patches/010-image-fit-sig-skip-in-tools-build-if-key-is-missing.patch +++ /dev/null @@ -1,69 +0,0 @@ -From patchwork Sat Mar 29 03:12:50 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 2066664 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Date: Sat, 29 Mar 2025 03:12:50 +0000 -From: Daniel Golle -To: Tom Rini , Simon Glass , - Chia-Wei Wang , u-boot@lists.denx.de -Cc: Thomas =?iso-8859-1?q?H=FChn?= -Subject: [PATCH 1/2] image-fit-sig: skip in tools build if key is missing -Message-ID: - -MIME-Version: 1.0 -Content-Disposition: inline -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" - -Skip signature verification in case no public key was given in order to -allow using fit_check_sign also to validate uImage.FIT images without -signatures. Guarded by USE_HOSTCC macro the behavior on target is -unchanged. - -Signed-off-by: Daniel Golle ---- - boot/image-fit-sig.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - ---- a/boot/image-fit-sig.c -+++ b/boot/image-fit-sig.c -@@ -191,6 +191,11 @@ int fit_image_verify_required_sigs(const - int noffset; - int key_node; - -+#ifdef USE_HOSTCC -+ if (!key_blob) -+ return 0; -+#endif -+ - /* Work out what we need to verify */ - *no_sigsp = 1; - key_node = fdt_subnode_offset(key_blob, 0, FIT_SIG_NODENAME); -@@ -477,6 +482,11 @@ static int fit_config_verify_required_ke - bool reqd_policy_all = true; - const char *reqd_mode; - -+#ifdef USE_HOSTCC -+ if (!key_blob) -+ return 0; -+#endif -+ - /* - * We don't support this since libfdt considers names with the - * name root but different @ suffix to be equal diff --git a/package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch b/package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch deleted file mode 100644 index 96ea7c434ad..00000000000 --- a/package/boot/uboot-tools/patches/011-tools-fit_check_sign-make-key-optional.patch +++ /dev/null @@ -1,92 +0,0 @@ -From patchwork Sat Mar 29 03:13:01 2025 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 2066665 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@legolas.ozlabs.org -Date: Sat, 29 Mar 2025 03:13:01 +0000 -From: Daniel Golle -To: Tom Rini , Simon Glass , - Chia-Wei Wang , - Daniel Golle , u-boot@lists.denx.de -Cc: Thomas =?iso-8859-1?q?H=FChn?= -Subject: [PATCH 2/2] tools/fit_check_sign: make key optional -Message-ID: - <1f0c5a1f7e84f638f921278284ff6245d78e730d.1743217745.git.daniel@makrotopia.org> -References: - -MIME-Version: 1.0 -Content-Disposition: inline -In-Reply-To: - -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" - -Allow invoking fit_check_sig without the key parameter, allowing to -validate only checksums and hashes for unsigned images. - -Signed-off-by: Daniel Golle ---- - tools/fit_check_sign.c | 15 ++++++--------- - 1 file changed, 6 insertions(+), 9 deletions(-) - ---- a/tools/fit_check_sign.c -+++ b/tools/fit_check_sign.c -@@ -45,7 +45,7 @@ int main(int argc, char **argv) - char *config_name = NULL; - char cmdname[256]; - int ret; -- void *key_blob; -+ void *key_blob = NULL; - int c; - - strncpy(cmdname, *argv, sizeof(cmdname) - 1); -@@ -70,18 +70,15 @@ int main(int argc, char **argv) - fprintf(stderr, "%s: Missing fdt file\n", *argv); - usage(*argv); - } -- if (!keyfile) { -- fprintf(stderr, "%s: Missing key file\n", *argv); -- usage(*argv); -- } - - ffd = mmap_fdt(cmdname, fdtfile, 0, &fit_blob, &fsbuf, false, true); - if (ffd < 0) - return EXIT_FAILURE; -- kfd = mmap_fdt(cmdname, keyfile, 0, &key_blob, &ksbuf, false, true); -- if (kfd < 0) -- return EXIT_FAILURE; -- -+ if (keyfile) { -+ kfd = mmap_fdt(cmdname, keyfile, 0, &key_blob, &ksbuf, false, true); -+ if (kfd < 0) -+ return EXIT_FAILURE; -+ } - image_set_host_blob(key_blob); - ret = fit_check_sign(fit_blob, key_blob, config_name); - if (!ret) { -@@ -93,7 +90,9 @@ int main(int argc, char **argv) - } - - (void) munmap((void *)fit_blob, fsbuf.st_size); -- (void) munmap((void *)key_blob, ksbuf.st_size); -+ -+ if (keyfile) -+ (void) munmap((void *)key_blob, ksbuf.st_size); - - close(ffd); - close(kfd); diff --git a/package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch b/package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch deleted file mode 100644 index 8f4dfefde24..00000000000 --- a/package/boot/uboot-tools/patches/012-tools-fit_check_sign-no-libcrypto.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/tools/Makefile -+++ b/tools/Makefile -@@ -83,8 +83,8 @@ HOSTCFLAGS_img2srec.o := -pedantic - hostprogs-y += mkenvimage - mkenvimage-objs := mkenvimage.o os_support.o generated/lib/crc32.o - --hostprogs-y += dumpimage mkimage --hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fit_info fit_check_sign -+hostprogs-y += dumpimage mkimage fit_check_sign -+hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fit_info - hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fdt_add_pubkey - - ifneq ($(CONFIG_CMD_BOOTEFI_SELFTEST)$(CONFIG_FWU_MDATA_GPT_BLK),) diff --git a/package/boot/uboot-tools/patches/013-tools-fit_check_sign-all-image-types.patch b/package/boot/uboot-tools/patches/013-tools-fit_check_sign-all-image-types.patch index 06af51e212b..2621335490a 100644 --- a/package/boot/uboot-tools/patches/013-tools-fit_check_sign-all-image-types.patch +++ b/package/boot/uboot-tools/patches/013-tools-fit_check_sign-all-image-types.patch @@ -1,6 +1,6 @@ --- a/boot/bootm.c +++ b/boot/bootm.c -@@ -1229,20 +1229,18 @@ static int bootm_host_load_image(const v +@@ -1232,20 +1232,18 @@ static int bootm_host_load_image(const v int bootm_host_load_images(const void *fit, int cfg_noffset) { @@ -28,18 +28,19 @@ /* Return the first error we found */ --- a/boot/image-fit.c +++ b/boot/image-fit.c -@@ -2072,7 +2072,9 @@ int fit_image_load(struct bootm_headers +@@ -2079,8 +2079,10 @@ int fit_image_load(struct bootm_headers fit_uname_config = fit_uname_configp ? *fit_uname_configp : NULL; fit_base_uname_config = NULL; - prop_name = fit_get_image_type_property(image_type); + prop_name = fit_get_image_type_property(ph_type); +#ifndef USE_HOSTCC - printf("## Loading %s from FIT Image at %08lx ...\n", prop_name, addr); + printf("## Loading %s (%s) from FIT Image at %08lx ...\n", + prop_name, genimg_get_phase_name(image_ph_phase(ph_type)), addr); +#endif bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT); ret = fit_check_format(fit, IMAGE_SIZE_INVAL); -@@ -2108,7 +2110,9 @@ int fit_image_load(struct bootm_headers - } +@@ -2117,7 +2119,9 @@ int fit_image_load(struct bootm_headers + cfg_noffset = ret; fit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL); +#ifndef USE_HOSTCC @@ -48,7 +49,7 @@ /* Remember this config */ if (image_type == IH_TYPE_KERNEL) images->fit_uname_cfg = fit_base_uname_config; -@@ -2131,7 +2135,9 @@ int fit_image_load(struct bootm_headers +@@ -2140,7 +2144,9 @@ int fit_image_load(struct bootm_headers fit_uname = fit_get_name(fit, noffset, NULL); } if (noffset < 0) { diff --git a/package/boot/uboot-tools/patches/014-tools-fit_check_sign-no-decompress.patch b/package/boot/uboot-tools/patches/014-tools-fit_check_sign-no-decompress.patch index 6cd18aa5495..0823f64714d 100644 --- a/package/boot/uboot-tools/patches/014-tools-fit_check_sign-no-decompress.patch +++ b/package/boot/uboot-tools/patches/014-tools-fit_check_sign-no-decompress.patch @@ -1,6 +1,6 @@ --- a/boot/bootm.c +++ b/boot/bootm.c -@@ -1188,10 +1188,6 @@ static int bootm_host_load_image(const v +@@ -1191,10 +1191,6 @@ static int bootm_host_load_image(const v ulong data, len; struct bootm_headers images; int noffset; @@ -11,7 +11,7 @@ int ret; fit_uname_config = fdt_get_name(fit, cfg_noffset, NULL); -@@ -1203,26 +1199,6 @@ static int bootm_host_load_image(const v +@@ -1206,26 +1202,6 @@ static int bootm_host_load_image(const v FIT_LOAD_IGNORED, &data, &len); if (noffset < 0) return noffset; -- 2.47.2