[v2,1/5] package/uboot-tools: add host mkfwumdata support

Message ID 20261125164127.863713-2-dario.binacchi@amarulasolutions.com
State New
Headers
Series Add support for the STM32MP257F-EV1 board |

Commit Message

Dario Binacchi Nov. 25, 2026, 4:41 p.m. UTC
Add an option to build and install the mkfwumdata tool on the host.

mkfwumdata generates the raw image of the FWU (Firmware Update)
metadata, which is needed for the initial installation of the FWU
multi bank update on the board.

The tool is linked against libuuid, hence the dependency on
host-util-linux. To avoid adding this dependency to all the users of
host-uboot-tools, the tool is built only when explicitly selected.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
---
 package/uboot-tools/Config.in.host | 10 ++++++++++
 package/uboot-tools/uboot-tools.mk |  9 +++++++++
 2 files changed, 19 insertions(+)

-- 
2.43.0
  

Patch

diff --git a/package/uboot-tools/Config.in.host b/package/uboot-tools/Config.in.host
index 622070405db7..e7251ca8bd54 100644
--- a/package/uboot-tools/Config.in.host
+++ b/package/uboot-tools/Config.in.host
@@ -39,6 +39,16 @@  config BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT
 
 endif # BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
 
+config BR2_PACKAGE_HOST_UBOOT_TOOLS_MKFWUMDATA
+	bool "mkfwumdata"
+	help
+	  Install the mkfwumdata tool on the host system
+
+	  The mkfwumdata tool from Das U-Boot bootloader, which allows
+	  generation of the raw image of the FWU (Firmware Update)
+	  metadata, for initial installation of the FWU multi bank
+	  update on the board.
+
 config BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE
 	bool "Environment image"
 	help
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
index 72b387c41c1a..a508e61c53c8 100644
--- a/package/uboot-tools/uboot-tools.mk
+++ b/package/uboot-tools/uboot-tools.mk
@@ -157,6 +157,14 @@  define HOST_UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN
 endef
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_MKFWUMDATA),y)
+HOST_UBOOT_TOOLS_MAKE_OPTS += CONFIG_TOOLS_MKFWUMDATA=y
+HOST_UBOOT_TOOLS_DEPENDENCIES += host-util-linux
+define HOST_UBOOT_TOOLS_INSTALL_MKFWUMDATA
+	$(INSTALL) -m 0755 -D $(@D)/tools/mkfwumdata $(HOST_DIR)/bin/mkfwumdata
+endef
+endif
+
 ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE),y)
 
 UBOOT_TOOLS_GENERATE_ENV_FILE = $(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE))
@@ -241,6 +249,7 @@  define HOST_UBOOT_TOOLS_INSTALL_CMDS
 	$(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/bin/mkenvimage
 	$(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(HOST_DIR)/bin/dumpimage
 	$(HOST_UBOOT_TOOLS_INSTALL_FIT_CHECK_SIGN)
+	$(HOST_UBOOT_TOOLS_INSTALL_MKFWUMDATA)
 	$(INSTALL) -m 0755 -D $(@D)/tools/env/fw_printenv $(HOST_DIR)/bin/fw_printenv
 	ln -sf fw_printenv $(HOST_DIR)/bin/fw_setenv
 	$(HOST_UBOOT_TOOLS_INSTALL_ENVIMAGE)