alfa
June 24, 2022, 1:04pm
1
Hi,
I am trying to increase roofs (mtdblock7)partition from 4096Kb to 8120Kb
How can i make this?
Should i rebuild sysupgrade image?
thank you for any help
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 9728 9728 0 100% /rom
tmpfs 59808 37512 22296 63% /tmp
/dev/mtdblock7 4096 1100 2996 27% /overlay
overlayfs:/overlay 4096 1100 2996 27% /
tmpfs 512 0 512 0% /dev
dev: size erasesize name
mtd0: 00020000 00010000 "spl-loader"
mtd1: 00050000 00010000 "u-boot"
mtd2: 00010000 00010000 "u-boot-env"
mtd3: 00010000 00010000 "factory"
mtd4: 00f70000 00010000 "firmware"
mtd5: 0021ed41 00010000 "kernel"
mtd6: 00d512bf 00010000 "rootfs"
mtd7: 00400000 00010000 "rootfs_data"
Do you have any unused flash at this point? Typically OpenWrt is configured to use all the flash space used by the OEM firmware, so return to OEM is still possible.
alfa
June 24, 2022, 1:32pm
3
yes i have, what should i do ?
I mean Can i resize free rootfs space (overlayfs)
thanks
alfa
June 24, 2022, 2:06pm
4
here is boot logs may be useful
[ 0.461049] m25p80 spi2.0: found ZB25VQ128A, expected w25q128
[ 0.461102] m25p80 spi2.0: ZB25VQ128A (16384 Kbytes)
[ 0.462591] 5 fixed-partitions partitions found on MTD device spi2.0
[ 0.462629] Creating 5 MTD partitions on "spi2.0":
[ 0.462699] 0x000000000000-0x000000020000 : "spl-loader"
[ 0.465372] 0x000000020000-0x000000070000 : "u-boot"
[ 0.467627] 0x000000070000-0x000000080000 : "u-boot-env"
[ 0.469828] 0x000000080000-0x000000090000 : "factory"
[ 0.472080] 0x000000090000-0x000001000000 : "firmware"
[ 0.478906] random: fast init done
[ 0.519901] 2 uimage-fw partitions found on MTD device firmware
[ 0.519987] 0x000000090000-0x0000002aed41 : "kernel"
[ 0.522347] 0x0000002aed41-0x000001000000 : "rootfs"
[ 0.524818] mtd: device 6 (rootfs) set to be root filesystem
[ 0.525063] 1 squashfs-split partitions found on MTD device rootfs
[ 0.525132] 0x000000c00000-0x000001000000 : "rootfs_data"
Check the DTS for your hardware (which you should mention) in the git tree for the exact layout. Convert the hexadecimal upper range of the last defined partition in the DTS and compare it to the size of your flash chip. They should match. If not, you do have free space somewhere.
As per your boot log 1000000 in hex translates to 16 MiB. Is your flash chip bigger than 16 MiB? If so, then yes indeed you have unused space somewhere. If not, then OpenWrt is probably using all the space it can claim without wiping stuff you would need for normal operation.
2 Likes
alfa
June 24, 2022, 2:25pm
6
i am currently working on GL-SF1200 router and it has 16MiB flash chip and it used all of rootfs available space so i see that cannot resize .
But i found image builder also dts. I will try to rebuild
/dts-v1/;
#include "sf19a28_fullmask.dtsi"
#include "sf19a28-thermal_common.dtsi"
/ {
#address-cells = <1>;
#size-cells = <1>;
compatible = "glinet,gl-sf1200", "siflower,sf19a28-soc";
model = "GL-SF1200";
aliases {
led-boot = &power_led;
led-failsafe = &power_led;
led-running = &power_led;
//led-upgrade = &power_led;
};
};
&gmac {
status = "okay";
delay = <0x24 0x21>;
esw-rst-gpio = <11>;
};
&spi2 {
status = "okay";
//use-dma;
dmas = <&gdma 10
&gdma 11>;
dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
w25q128@0 {
compatible = "w25q128";
reg = <0>; /* chip select */
spi-max-frequency = <33000000>;
bank-width = <2>;
device-width = <2>;
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "spl-loader";
reg = <0x0 0x20000>; /* 128k */
read-only;
};
partition@20000 {
label = "u-boot";
reg = <0x20000 0x50000>; /* 320k */
read-only;
};
partition@70000 {
label = "u-boot-env";
reg = <0x70000 0x10000>; /* 64k */
};
factory:partition@80000 {
label = "factory";
reg = <0x80000 0x10000>; /* 64k */
read-only;
};
partition@90000 {
label = "firmware";
reg = <0x90000 0xf70000>; /* 576k-16M */
};
};
};
&uart0 {
status = "okay";
};
&watchdog {
status = "okay";
};
&timer0 {
status = "okay";
};
&usb_phy {
status = "okay";
};
&usb {
status = "okay";
};
&wifi_rf {
status = "okay";
/*only support ext pa for 5G*/
force_expa = <1>;
};
&gpio_keys {
status = "okay";
restart@27 {
label = "Key Restart";
linux,code = <0x198>;
gpios = <&gpio 27 1>;
poll-interval = <10>;
debounce-interval = <20>;
};
};
&leds {
status = "okay";
wlan5g {
label = "gl-sf1200:blue:wlan5g";
gpios = <&gpio 0 1>;
};
wlan2g {
label = "gl-sf1200:blue:wlan2g";
gpios = <&gpio 12 1>;
};
power_led: power{
label = "gl-sf1200:blue:power";
gpios = <&gpio 1 1>;
};
};
&wifi_lb {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
//gpio-leds = <&gpio 12 0>;
smp-affinity = <2>;
};
&wifi_hb {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
//gpio-leds = <&gpio 12 0>;
smp-affinity = <3>;
};```
alfa
June 24, 2022, 2:30pm
7
We have 5 partitions on it
and i see that root and root_fs data have created by openwrt. Now the question is How to force openwrt to make rootfs_data (overlayfs) space exxactly 6MiB. I need at least 6. Could you help at this point?
Please don't recompile, you'll brick your device. See this and more specifically the comment in the DTS after the address range? It already takes the whole range of available flash space.
1 Like
alfa
June 24, 2022, 2:47pm
9
I think it is correct partitioning for firmware
it will contain kernel,rootfs and rootfs_data
it is normal i think isn't it?
It already does. The first number is the start address, the second number is the range, you need to add them up.
1 Like
alfa
June 24, 2022, 2:51pm
11
And sorry.. i am confused how can i do this
You do not. There's no space left to claim.
1 Like
alfa
June 24, 2022, 2:56pm
13
İf i can remove applications belongs to gl inet it will left space i think. I only want pure openwrt.
Thanks for your help.
If i can do i will write back..
1 Like
alfa
June 25, 2022, 8:17am
14
removed unneccesary applications and recompiled it and than it worked!
we have 8MiB
system
Closed
July 5, 2022, 8:17am
15
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.