[SOLVED]Mt7620 - zbt we826 - partition size

Hello,
I would like resize factory part of flash (make it bigger). I have HW customized by manufacturer (32MB FLASH) and my custom image is bigger than 8MB (12). It is possible to do it using dts file or kernel configuration? It is partition table managed by kernel or by uboot?

Thanks for the answer

Just change the DTS file to match your hardware. Change the size of the Firmware partition, leaving the rest as it is. With the modified DTS you have to compile from source.
The uboot should have been modified already by the guys who installed the bigger flash.

Thank you very much. It seems, its solved.
But I dont understand
[ 0.835545] 0x000000000000-0x000000030000 : "u-boot"
[ 0.842419] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.849753] 0x000000040000-0x000000060000 : "factory"
[ 0.856807] 0x000000050000-0x000002010000 : "firmware"

Factory end at 60000 and firmware start at 50000? Before I've changed the value, the factory ended at 50000

Must have misunderstood. You have more flash then standard. The only partition that you should change is the firmware part. Why would you like increase the factory part? And the size looks wrong.

32 MB is 0x2000000. So the factory size can't be more then 0x2000000 - 0x050000 = 0x1FB0000

Mathematic is not my cup of tee :smile:

I "thought", in factory is saved compiled Image. So it is not, right?

I will try it again with your hint.

i hope you didn't flash anything over the factory partition. Hardware specific details are normally stored there. Mac addresses for your board, wifi data (channels, calibration etc).

Don't touch the Uboot part. Keep it readonly in your modified DTS to be sure you don't erase it by accident.

The firmware part is where the firmware is :slight_smile:

:blush: thank you for all hint and new knownledges for me. Router is still working, so nothing wrong is happend.

Found another issue about that. I had to change change_image_size to 32MB. Now it is everything working with images over 16MB

Thanks again for help

@demontefacto

I'm curious ... what flash chip are you using?
And does the device reboot when you issue the reboot command?
Or do you need to power cycle the device to reboot?

P/N of flash I can share next week. And about reboot, yes it is working. Somebody here has shared the patch for hard reset the flash before reboot. Without it its freezing as you said. It is needed to powercycle the router.
I have very customized lede image and 16MB is not enough for me. Our supplier made new version of this router for us

Hi demontefacto,

Can you share how to increase the size of /dev/root?
How do I modify the DTS file? Where can I find the DTS file in openwrt?

Thank you,
Tony.

Hello Tony.

/dev/root is as big as big is the image you made. Size you may internally change with DTS is the overlay part.
dts files are placed here target/linux/ramips/dts
BTW - 32MB image version exist so if you need your custom image, just select this version in make menuconfig

https://downloads.openwrt.org/releases/18.06.1/targets/ramips/mt7620/openwrt-18.06.1-ramips-mt7620-zbt-we826-32M-squashfs-sysupgrade.bin

Thank you for your answer Demontefacto, I did it and everything with more than 16MB can be generated and uploaded then flashed to the router.
But we still have to flash the firmware with CLI interface with "mtd write ...", we can't preload the image from the beginning using webinterface with default address 192.168.1.1
Because the default firmware size for hardware is only 16MB, we can't still flash the firmware more than 16MB for the very first flashing.

Thank you.
Tony,

Try:
Login to router with telnet/ssh
Conect router to internet
Go into tmp folder
Wget 32MB image version into tmp
Then sysupgrade -v -n /tmp/....sysupgrade.bin and share output, please.
And share dmesg with partition part
And df -h

Hi Demontefactor,

My dmesg is:

My firmware size 18.2MB, I dont understand why it is only 14.3MB in /dev/root/

Results of df -h:
/dev/root 14.3M 14.3M 0 100% /rom
tmpfs 124.9M 1.4M 123.4M 1% /tmp
/dev/mtdblock6 16.3M 852.0K 15.4M 5% /overlay
overlayfs:/overlay 16.3M 852.0K 15.4M 5% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 28.9G 324.9M 28.5G 1% /mnt/USB

Results of dmesg:
[ 0.844986] 0x000000000000-0x000000030000 : "u-boot"
[ 0.852076] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.859645] 0x000000040000-0x000000050000 : "factory"
[ 0.866904] 0x000000050000-0x000002000000 : "firmware"

I know that 0x000000050000-0x000002000000 : "firmware" is something 32MB by Hex calculator, but it is the default size for firmware.

Is there anyway to know the actual occupation of firmware in the flash memory?

In my case, I want to see my 18M firmware occupies 18M in memory (at partition firmware)

Thank you,
Tony.

Hello. Because is only one whole flash chip with size 32MB and 14MB(/rom) + 18MB (/dev/root) = 32MB (flash size)

EDIT: 18MB as overlay. There is typo in my answer

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.