Patchwork [OpenWrt-Devel] Fwd: [FIX] Regression on DIR-615-C1: creation of a factory.bin

login
register
Submitter Yury Polyanskiy
Date 2012-06-23 23:44:22
Message ID <CADh+XMxJGV9rJoSK4UHc+1RBdaqRZE66mC+tDMSK+2JQTNuRKw@mail.gmail.com>
Download mbox | patch
Permalink /patch/2329/
State New
Delegated to: Gabor Juhos
Headers show

Comments

Yury Polyanskiy - 2012-06-23 23:44:22
Dear all,

It appears there is a small bug in the current version for DLink's
DIR-615-C1 mach: DIR615-C1 embedded http reflasher checks the size as
if the "art" partition were 128k (actually art is 64k). Thus upon
creation of *-factory.bin we need to subtract the 64k from the rootfs
size (thus, the last 64k will never get copied).

Here is a fix (not a patch since I am not sure if it should be done
the Cameo913x scope, as I did, or in DIR-615-C1 scope). I also added a
check for the total size of the *-factory.bin (again, probably should
be placed in DIR-615-C1 specific place).

PS. Appologies in advance for textwrap issues below -- stupid gmail's editor.

Patch

Index: target/linux/ar71xx/image/Makefile
===================================================================
--- target/linux/ar71xx/image/Makefile  (revision 32490)
+++ target/linux/ar71xx/image/Makefile  (working copy)
@@ -208,21 +209,60 @@ 
       $(call MkuImageLzma/initramfs,$(2),$(3) $(4))
 endef

 define Image/Build/Cameo
       $(call MkuImageLzma,$(2),$(3) $(4))
       $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
               ( \
                       dd if=$(KDIR_TMP)/vmlinux-$(2).uImage bs=$(5)
conv=sync; \
-                       dd if=$(KDIR)/root.$(1) bs=$(6) conv=sync; \
+                       dd if=$(KDIR)/root.$(1) bs=$$(($(6) - 65536))
conv=sync; \
                       echo -n $(7); \
               ) > $(call factoryname,$(1),$(2)); \
+               if [ `stat -c%s $(call factoryname,$(1),$(2))` -ne
3866648 ]; then \
+                       echo "Warning: $(call factoryname,$(1),$(2))
has wrong size"; \
+                       rm -f $(call factoryname,$(1),$(2)); \
+               fi; \
       fi
 endef


--
Best,
Yury


--
Best,
Yury
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel