[OpenWrt-Devel] image: add magic number option for append-uImage-fakehdr
diff mbox series

Message ID 20191011105239.36a3849e@kosmio.komorska
State Accepted
Delegated to: John Crispin
Headers show
Series
  • [OpenWrt-Devel] image: add magic number option for append-uImage-fakehdr
Related show

Commit Message

Michal Cieslakiewicz Oct. 11, 2019, 8:52 a.m. UTC
'append-uImage-fakehdr' can now accept magic number as a second, optional
parameter (passed directly to 'mkimage' command with '-M' option). This
enables construction of proper Netgear-specific fake rootfs images
(required for flashing WNDR4300 for example).

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
---
 include/image-commands.mk | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 1d0aed1918..5dfd6a2c2f 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -109,10 +109,13 @@  endef
 # append a fake/empty uImage header, to fool bootloaders rootfs integrity check
 # for example
 define Build/append-uImage-fakehdr
+	$(eval type=$(word 1,$(1)))
+	$(eval magic=$(word 2,$(1)))
 	touch $@.fakehdr
 	$(STAGING_DIR_HOST)/bin/mkimage \
-		-A $(LINUX_KARCH) -O linux -T $(1) -C none \
-		-n '$(VERSION_DIST) fake $(1)' \
+		-A $(LINUX_KARCH) -O linux -T $(type) -C none \
+		-n '$(VERSION_DIST) fake $(type)' \
+		$(if $(magic),-M $(magic)) \
 		-d $@.fakehdr \
 		-s \
 		$@.fakehdr