OpenWrt Forum Archive

Topic: rt305x Tenda W306R V2.0 how to modify image for 8M ?

The content of this topic has been archived on 5 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm building an image for a 'Tenda W306R V2.0' and so far it booted fine..

Now I need to modify the build to use the 8m flash my router has (custom mod)

I'm building the image with verbose and as far as i can see.. it has a limit of 0x3B0000 for the image size, also the partition created seems to only use 4M

df shows:

/dev/mtdblock5            1472       204      1268  14% /overlay
overlayfs:/overlay        1472       204      1268  14% /


Any pointers will be appreciated, Thanks in advance!


CG

Flash size&partitions are defined by mtdparts parameter of kernel command line. You can see it by

cat /proc/cmdline

Value of parameter is set in /trunk/target/ramips/image/Makefile. So you can add new profile for your custom mod based on GENERIC_8M

Thanks

I figured out where to make the changes in the Makefile.

This allows a bigger image, and also the partition in the router is 8M

For the record, in case someone else need this:

Index: target/linux/ramips/image/Makefile
===================================================================
--- target/linux/ramips/image/Makefile  (revision 32020)
+++ target/linux/ramips/image/Makefile  (working copy)
@@ -220,8 +220,8 @@
        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_rtn10plus)),$(mtd_rtn10plus_kernel_part_size),$(mtd_rtn10plus_rootfs_part_size))
 endef
 
-define BuildFirmware/W306R_4M
-       $(call BuildFirmware/w306r,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M)),917504,2949120)
+define BuildFirmware/W306R_8M
+       $(call BuildFirmware/w306r,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),917504,7143424)
 endef
 
 define BuildFirmware/w306r
@@ -388,8 +388,8 @@
 endef
 
 define Image/Build/Profile/W306R_V20
-       $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,w306r-v20,W306R_V20,ttyS1,57600,phys)
-       $(call Image/Build/Template/$(fs_squash)/$(1),W306R_4M,w306r-v20,W306R_V20,ttyS1,57600,phys)
+       $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,w306r-v20,W306R_V20,ttyS1,57600,phys)
+       $(call Image/Build/Template/$(fs_squash)/$(1),W306R_8M,w306r-v20,W306R_V20,ttyS1,57600,phys)
 endef
 
 define Image/Build/Profile/W502U

The discussion might have continued from here.