[PATCH] u-boot-tools: add new package for mkimage & dumpimage

Rafał Miłecki zajec5 at gmail.com
Tue Nov 30 05:00:49 PST 2021


From: Rafał Miłecki <rafal at milecki.pl>

Those tools can be useful for targets that use ITB firmware format. They
may need them to extract firmware images to flash them.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 package/boot/u-boot-tools/Makefile            | 50 +++++++++++++++++++
 .../patches/0001-tools-disable-kwbimage.patch | 25 ++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 package/boot/u-boot-tools/Makefile
 create mode 100644 package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch

diff --git a/package/boot/u-boot-tools/Makefile b/package/boot/u-boot-tools/Makefile
new file mode 100644
index 0000000000..e77e27e679
--- /dev/null
+++ b/package/boot/u-boot-tools/Makefile
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=u-boot-tools
+PKG_DISTNAME:=u-boot
+PKG_VERSION:=2021.10
+PKG_RELEASE:=$(AUTORELEASE)
+
+PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:= \
+    https://ftp.denx.de/pub/u-boot \
+    ftp://ftp.denx.de/pub/u-boot \
+    https://mirror.cyberbits.eu/u-boot
+PKG_HASH:=cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4
+PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=Licenses/README
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/u-boot-tools
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=Boot Loaders
+  TITLE:=U-Boot tools
+  URL:=https://www.denx.de/wiki/U-Boot
+endef
+
+define Build/Configure
+	$(MAKE) -C $(PKG_BUILD_DIR) defconfig
+	$(MAKE) -C $(PKG_BUILD_DIR) syncconfig
+	$(SED) 's/CONFIG_TOOLS_LIBCRYPTO=y/# CONFIG_TOOLS_LIBCRYPTO is not set/' $(PKG_BUILD_DIR)/.config
+endef
+
+ifeq ($(ARCH),aarch64)
+MAKE_FLAGS += ARCH=arm cross_tools
+else
+MAKE_FLAGS += cross_tools
+endif
+
+define Package/u-boot-tools/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/dumpimage $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mkimage $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,u-boot-tools))
diff --git a/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch b/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch
new file mode 100644
index 0000000000..69a42ec383
--- /dev/null
+++ b/package/boot/u-boot-tools/patches/0001-tools-disable-kwbimage.patch
@@ -0,0 +1,25 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Tue, 30 Nov 2021 11:29:19 +0100
+Subject: [PATCH] tools: disable kwbimage
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Without CONFIG_TOOLS_LIBCRYPTO kwbimage doesn't compile because of
+multiple "undefined reference"s to SSL functions.
+
+Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
+---
+ tools/Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/tools/Makefile
++++ b/tools/Makefile
+@@ -117,7 +117,6 @@ dumpimage-mkimage-objs := aisimage.o \
+ 			imximage.o \
+ 			imx8image.o \
+ 			imx8mimage.o \
+-			kwbimage.o \
+ 			lib/md5.o \
+ 			lpc32xximage.o \
+ 			mxsimage.o \
-- 
2.31.1




More information about the openwrt-devel mailing list