ar71xx: image: add EOF marker to the WNDR4300 UBI image

Append EOF markers to the END of the UBI image
file. This forces the kernel to erase all blocks
after the marker even if those blocks are not
empty.

Additionally, the resulting image can be flashed
from the original web UI now, so use '-factory'
suffix for that.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 38683
lede-17.01
Gabor Juhos 2013-11-07 19:53:02 +00:00
parent ca4c33abb9
commit 18d08da07d
1 changed files with 6 additions and 9 deletions

View File

@ -756,18 +756,15 @@ define Image/Build/NetgearNAND
$(eval imageraw=$(KDIR_TMP)/$(2)-raw.img) $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
$(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs $(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs
echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof
$(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048) $(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
# Create firmware image full of 0xff to use the UBIFS auto-resize function ( \
firmwareblocks=$$$$(($(firmwaresize) / 131072)); \ dd if=$(KDIR_TMP)/vmlinux-$(2).uImage; \
dd if=/dev/zero bs=128k count=$$$${firmwareblocks} conv=sync | tr '\000' '\377' > $(imageraw) dd if=$(KDIR_TMP)/$(2)-root.ubi \
# Insert Kernel and UBI image to rootfs and generate DNI image ) > $(imageraw)
dd if=$(KDIR_TMP)/vmlinux-$(2).uImage of=$(imageraw) conv=notrunc
kernelblocks=$$$$(($(kernelsize) / 131072)); \
dd if=$(KDIR_TMP)/$(2)-root.ubi of=$(imageraw) bs=128k seek=$$$${kernelblocks} conv=notrunc
$(STAGING_DIR_HOST)/bin/mkdniimg \ $(STAGING_DIR_HOST)/bin/mkdniimg \
-B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \ -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
-i $(imageraw) \ -i $(imageraw) \
-o $(call imgname,ubi,$(2))-recovery.img -o $(call imgname,ubi,$(2))-factory.img
endef endef