Partition problems with C20i after flashing Openwrt 18.06.2

Hi,

can someone please tell me how to solve the issue with mtd4 or that I am not able to install or store anything on my device?

I guess there is some problem with partitions.

 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.2, r7676-cddd7b4c77
 -----------------------------------------------------
root@OpenWrt:~# ping web.de
PING web.de (82.165.229.138): 56 data bytes
64 bytes from 82.165.229.138: seq=0 ttl=249 time=12.180 ms
64 bytes from 82.165.229.138: seq=1 ttl=249 time=11.620 ms
64 bytes from 82.165.229.138: seq=2 ttl=249 time=11.240 ms
^C
--- web.de ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 11.240/11.680/12.180 ms
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.3M      6.3M         0 100% /rom
tmpfs                    29.5M    552.0K     29.0M   2% /tmp
/dev/mtdblock4           24.0K     24.0K         0 100% /overlay
tmpfs                    29.5M     76.0K     29.4M   0% /tmp/root
overlayfs:/tmp/root      29.5M     76.0K     29.4M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# cd /tmp
root@OpenWrt:/tmp# opkg update
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt7620/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt7620/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/mipsel_24kc/telephony/Packages.sig
Signature check passed.
root@OpenWrt:/tmp# htop
-ash: htop: not found
root@OpenWrt:/tmp# opkg install htop
Installing htop (2.2.0-1) to root...
Collected errors:
 * verify_pkg_installable: Only have 0kb available on filesystem /overlay, pkg htop needs 49
 * opkg_install_cmd: Cannot install package htop.
root@OpenWrt:/tmp# cat /proc/partitions
major minor  #blocks  name

  31        0        128 mtdblock0
  31        1       7808 mtdblock1
  31        2       1404 mtdblock2
  31        3       6403 mtdblock3
  31        4         24 mtdblock4
  31        5         64 mtdblock5
  31        6         64 mtdblock6
  31        7         64 mtdblock7
  31        8         64 mtdblock8
root@OpenWrt:/tmp# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 6.3M      6.3M         0 100% /rom
tmpfs                    29.5M      1.1M     28.4M   4% /tmp
/dev/mtdblock4           24.0K     24.0K         0 100% /overlay
tmpfs                    29.5M     76.0K     29.4M   0% /tmp/root
overlayfs:/tmp/root      29.5M     76.0K     29.4M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:/tmp# uname -a
Linux OpenWrt 4.14.95 #0 Mon Jan 28 08:54:32 2019 mips GNU/Linux
root@OpenWrt:/tmp# 

What do you have installed on the device or built into the image?

A 24 kB jffs2 partition just isn't going to work. You need at least three free flash blocks (typically over 200 kB) for the device to be functional at boot, and generally at least two available thereafter for "safe" operation.

I installed an old OEM-Firmware, then newest openwrt 18.06.2 openwrt...-factory.bin and then my own build through luci upgrade.

It was described here Wiki for C20i
This is the build-log of my own compiled image: https://pastebin.com/sjgv0arD

Everything works pretty well, also 5GHz Wifi works but unfortunately it's not possible to save anything.

The first steps are clear, you need to not install so much on a device with limited resources.

PACKAGES="wpad luci-proto-wireguard -ppp meshwizard luci firewall fstools odhcp6c kmod-sound-core sshfs kmod-leds-gpio netifd kmod-rt2800-pci rsync swconfig iptables dropbear kmod-gpio-button-hotplug wireguard wireguard-tools uci kmod-mt76 kmod-wireguard libgcc mtd -ppp-mod-pppoe kmod-usb-audio ip6tables dnsmasq busybox kmod-mt76x0e uclient-fetch -wpad-mini sqm-scripts kmod-ipt-offload logd -libc mpd-full base-files kmod-rt2800-soc opkg luci-app-wireguard odhcpd-ipv6only"

You need to remove at least 200 kB of (compressed) packages from your build.

Always good to have a strong proponent of support for under-resourced devices reinforcing that:

  • 4/32 devices are dead and gone
  • Even 8 MB of flash is insufficient for anything but basic operation
  • 16/128 is a reasonable minimum for consideration of any new purchase

Thanks for the hint jeff...

Tbh... I don't wanna continue talking about your suggested gi-device without proper switch ports and no 5GHz wifi.- I have enough devices and need to do something sensfull beside trashing it. :wink:

I just wanted to install the packages I compiled and thougt if it compiles fine without errors it should fit into the flash.

In my opionion something with the partition table went wrong. The size doesn't look like it should. So maybe I have to refer to another partition or something. I shows also that there is around 30 MB of free space. - So I guess somehow it uses a part of RAM instead of flash and don't know how MTD4 shrinked to 24 kb.

The flash should look like this:

dev:    size   erasesize  name
mtd0: 00020000 00010000 "u-boot"
mtd1: 007a0000 00010000 "firmware"
mtd2: 00140000 00010000 "kernel"
mtd3: 00660000 00010000 "rootfs"
mtd4: 00430000 00010000 "rootfs_data"
mtd5: 00010000 00010000 "config"
mtd6: 00010000 00010000 "rom"
mtd7: 00010000 00010000 "romfile"
mtd8: 00010000 00010000 "radio"

But mine looks diffrent:

major minor  #blocks  name

  31        0        128 mtdblock0
  31        1       7808 mtdblock1
  31        2       1404 mtdblock2
  31        3       6403 mtdblock3
  31        4         24 mtdblock4
  31        5         64 mtdblock5
  31        6         64 mtdblock6
  31        7         64 mtdblock7
  31        8         64 mtdblock8

I don't know the real sizes, but unfortunately it looks diffrent and I am actually scared now to flash any new image before it's clear what happend. - I don't wann brick this device.

Edit: There is still the information in the overview that there is 64 MB RAM used

Memory
Total Available	
25292 kB / 60416 kB (41%)
Free	
20036 kB / 60416 kB (33%)
Buffered	

While I'm looking at the code here, what does

cat /proc/mtd

show on your boot?

What do you see in early dmsg when the kernel is creating the mtd partitions and auto-splitting the firmware?

From a very different device, the section that I'm looking for is along the lines of

[    0.385500] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.390428] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.396982] Creating 4 MTD partitions on "spi0.0":
[    0.401958] 0x000000000000-0x000000040000 : "u-boot"
[    0.407887] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.414171] 0x000000050000-0x000000ff0000 : "firmware"
[    0.422122] 2 uimage-fw partitions found on MTD device firmware
[    0.428247] Creating 2 MTD partitions on "firmware":
[    0.433432] 0x000000000000-0x000000190000 : "kernel"
[    0.439338] 0x000000190000-0x000000fa0000 : "rootfs"
[    0.445133] mtd: device 4 (rootfs) set to be root filesystem
[    0.451075] 1 squashfs-split partitions found on MTD device rootfs
[    0.457472] 0x000000550000-0x000000fa0000 : "rootfs_data"
[    0.463764] 0x000000ff0000-0x000001000000 : "art"
[    0.470427] libphy: Fixed MDIO Bus: probed

Hi Jeff,

thanks for your help

cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00020000 00001000 "u-boot"
mtd1: 007a0000 00001000 "firmware"
mtd2: 0015f0f0 00001000 "kernel"
mtd3: 00640f10 00001000 "rootfs"
mtd4: 00006000 00001000 "rootfs_data"
mtd5: 00010000 00001000 "config"
mtd6: 00010000 00001000 "rom"
mtd7: 00010000 00001000 "romfile"
mtd8: 00010000 00001000 "radio"
[    0.000000] Linux version 4.14.95 (buildbot@builds-03.infra.lede-project.org) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7627-753531d)) #0 Mon Jan 28 08:54:32 2019
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:6
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is TP-Link Archer C20i
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 80421050, node_mem_map 81000040
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from 0x8042472c with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000001
[    0.000000] Readback ErrCtl register=00000001
[    0.000000] Memory: 60240K/65536K available (3590K kernel code, 178K rwdata, 464K rodata, 176K init, 214K bss, 5296K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000013] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.007596] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.073543] pid_max: default: 32768 minimum: 301
[    0.078273] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084651] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097630] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107172] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.113162] pinctrl core: initialized pinctrl subsystem
[    0.119528] NET: Registered protocol family 16
[    0.129179] Can't analyze schedule() prologue at 8037d498
[    0.387416] PCI host bridge /pcie@10140000 ranges:
[    0.392029]  MEM 0x0000000020000000..0x000000002fffffff
[    0.397079]   IO 0x0000000010160000..0x000000001016ffff
[    0.420053] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.425504] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.431825] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.437240] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.443518] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.448942] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.455245] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.460575] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.467318] PCI host bridge to bus 0000:00
[    0.471284] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.477908] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.483667] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.490250] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.497993] pci 0000:00:00.0: [1814:0801] type 01 class 0x060400
[    0.498037] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.498054] pci 0000:00:00.0: reg 0x14: [mem 0x20200000-0x2020ffff]
[    0.498133] pci 0000:00:00.0: supports D1
[    0.498144] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.498606] pci 0000:01:00.0: [14c3:7650] type 00 class 0x028000
[    0.498659] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.498802] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.499061] pci 0000:01:00.1: [14c3:8650] type 00 class 0x0d1100
[    0.499111] pci 0000:01:00.1: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.499244] pci 0000:01:00.1: supports D1
[    0.499254] pci 0000:01:00.1: PME# supported from D0 D1 D3hot D3cold
[    0.499462] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.499482] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.499532] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.505900] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.512712] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x201fffff]
[    0.519254] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.525869] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff]
[    0.532444] pci 0000:01:00.1: BAR 0: assigned [mem 0x20100000-0x201fffff]
[    0.539050] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.543854] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x201fffff]
[    0.555998] clocksource: Switched to clocksource systick
[    0.562289] NET: Registered protocol family 2
[    0.567509] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.574237] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.580458] TCP: Hash tables configured (established 1024 bind 1024)
[    0.586722] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.592351] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.598726] NET: Registered protocol family 1
[    0.602964] PCI: CLS 0 bytes, default 32
[    0.605680] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.612427] Crashlog allocated RAM at address 0x3f00000
[    0.619256] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.631469] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.637113] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.657010] io scheduler noop registered
[    0.660758] io scheduler deadline registered (default)
[    0.666783] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.675828] console [ttyS0] disabled
[    0.679344] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.688954] console [ttyS0] enabled
[    0.696009] bootconsole [early0] disabled
[    0.704788] cacheinfo: Failed to find cpu0 device node
[    0.710076] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.723664] spi spi0.0: force spi mode3
[    0.728437] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    0.733481] 6 fixed-partitions partitions found on MTD device spi0.0
[    0.740016] Creating 6 MTD partitions on "spi0.0":
[    0.744912] 0x000000000000-0x000000020000 : "u-boot"
[    0.750933] 0x000000020000-0x0000007c0000 : "firmware"
[    2.013810] 2 tplink-fw partitions found on MTD device firmware
[    2.019894] 0x000000020000-0x00000017f0f0 : "kernel"
[    2.025868] 0x00000017f0f0-0x0000007c0000 : "rootfs"
[    2.031785] mtd: device 3 (rootfs) set to be root filesystem
[    2.039202] 1 squashfs-split partitions found on MTD device rootfs
[    2.045532] 0x0000007ba000-0x0000007c0000 : "rootfs_data"
[    2.052004] 0x0000007c0000-0x0000007d0000 : "config"
[    2.057989] 0x0000007d0000-0x0000007e0000 : "rom"
[    2.063607] 0x0000007e0000-0x0000007f0000 : "romfile"
[    2.069687] 0x0000007f0000-0x000000800000 : "radio"
[    2.076286] libphy: Fixed MDIO Bus: probed
[    2.088078] gsw: setting port4 to ephy mode
[    2.092399] mtk_soc_eth 10100000.ethernet eth0 (uninitialized): port 0 link up (100Mbps/Full duplex)
[    2.101977] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    2.108739] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    2.117726] rt2880_wdt 10000120.watchdog: Initialized
[    2.124273] NET: Registered protocol family 10
[    2.132848] Segment Routing with IPv6
[    2.136776] NET: Registered protocol family 17
[    2.141362] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.154592] 8021q: 802.1Q VLAN Support v1.8
[    2.174477] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    2.182709] Freeing unused kernel memory: 176K
[    2.187278] This architecture does not have kernel memory protection.
[    2.535961] random: fast init done
[    3.812596] init: Console is alive
[    3.816422] init: - watchdog -
[    6.674355] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    7.064680] usbcore: registered new interface driver usbfs
[    7.070471] usbcore: registered new interface driver hub
[    7.076034] usbcore: registered new device driver usb
[    7.088261] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.100359] init: - preinit -
[    9.266022] 8021q: adding VLAN 0 to HW filter on device eth0
[   10.608648] jffs2: notice: (385) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   10.648495] mount_root: unable to set filesystem state
[   10.653968] mount_root: switching to jffs2 overlay
[   10.701708] overlayfs: failed to resolve '/overlay/work': -2
[   10.747188] mount_root: mount failed: lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work, options No such device
[   10.759264] mount_root: switching to jffs2 failed - fallback to ramoverlay
[   10.809781] urandom-seed: Seed file not found (/etc/urandom.seed)
[   10.914666] procd: - early -
[   10.918559] procd: - watchdog -
[   11.252177] procd: - watchdog -
[   11.255760] procd: - ubus -
[   11.415667] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.536924] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.543993] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.551689] procd: - init -
[   12.015699] kmodloader: loading kernel modules from /etc/modules.d/*
[   12.249455] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   12.278592] u32 classifier
[   12.281365]     input device check on
[   12.285161]     Actions configured
[   12.291452] Mirror/redirect action on
[   12.305945] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   12.320997] fuse init (API version 7.26)
[   12.347257] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[   12.355499] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[   12.453276] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.537438] wireguard: WireGuard 0.0.20190123 loaded. See www.wireguard.com for information.
[   12.546129] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   12.679580] xt_time: kernel timezone is -0000
[   12.934772] usbcore: registered new interface driver snd-usb-audio
[   12.947437] mt76x0e 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
[   12.953913] mt76x0e 0000:01:00.0: ASIC revision: 76100002
[   13.214941] mt76x0e 0000:01:00.0: Firmware Version: 0.1.00
[   13.306913] mt76x0e 0000:01:00.0: EEPROM ver:02 fae:00
[   13.314247] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   13.363426] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "radio"
[   13.370706] ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[   13.378629] ieee80211 phy1: rt2x00_set_rf: Info - RF chipset 7620 detected
[   13.386365] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   13.450232] kmodloader: done loading kernel modules from /etc/modules.d/*
[   14.737658] urandom_read: 5 callbacks suppressed
[   14.737668] random: jshn: uninitialized urandom read (4 bytes read)
[   14.823505] random: jshn: uninitialized urandom read (4 bytes read)
[   30.695154] 8021q: adding VLAN 0 to HW filter on device eth0
[   30.717165] br-lan: port 1(eth0.1) entered blocking state
[   30.722939] br-lan: port 1(eth0.1) entered disabled state
[   30.728821] device eth0.1 entered promiscuous mode
[   30.733770] device eth0 entered promiscuous mode
[   30.806044] br-lan: port 1(eth0.1) entered blocking state
[   30.811573] br-lan: port 1(eth0.1) entered forwarding state
[   30.817527] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   31.712109] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   53.452831] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   54.123798] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   54.131892] br-lan: port 2(wlan0) entered blocking state
[   54.137503] br-lan: port 2(wlan0) entered disabled state
[   54.143363] device wlan0 entered promiscuous mode
[   54.165951] br-lan: port 3(wlan1) entered blocking state
[   54.171389] br-lan: port 3(wlan1) entered disabled state
[   54.177298] device wlan1 entered promiscuous mode
[   54.223841] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[   54.230567] br-lan: port 3(wlan1) entered blocking state
[   54.236061] br-lan: port 3(wlan1) entered forwarding state
[   55.179672] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   55.186456] br-lan: port 2(wlan0) entered blocking state
[   55.191934] br-lan: port 2(wlan0) entered forwarding state
[   58.870700] device wlan1 left promiscuous mode
[   58.875488] br-lan: port 3(wlan1) entered disabled state
[   60.008979] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[   60.157716] br-lan: port 2(wlan0) entered disabled state
[   60.166900] device wlan0 left promiscuous mode
[   60.171583] br-lan: port 2(wlan0) entered disabled state
[   60.177833] br-lan: port 2(wlan1) entered blocking state
[   60.183260] br-lan: port 2(wlan1) entered disabled state
[   60.189118] device wlan1 entered promiscuous mode
[   60.286362] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
[   60.293146] br-lan: port 2(wlan1) entered blocking state
[   60.298605] br-lan: port 2(wlan1) entered forwarding state
[   61.287363] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   61.300351] br-lan: port 3(wlan0) entered blocking state
[   61.305787] br-lan: port 3(wlan0) entered disabled state
[   61.311691] device wlan0 entered promiscuous mode
[   61.676454] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   61.683212] br-lan: port 3(wlan0) entered blocking state
[   61.688637] br-lan: port 3(wlan0) entered forwarding state
[   69.363496] random: crng init done

Your ROM looks like it was successfully split by the kernel, but has too much in it

>>> 0x00640f10  # rootfs
6557456
>>> 0x00006000  # rootfs_data
24576

I would guess that if you boot the "release" firmware, you'll find much more in the rootfs_data partition.

I don't see in the image-builder logs the creation of the JFFS file system, so I can't provide much more insight into those logs.

I would guess that if you boot the "release" firmware, you'll find much more in the rootfs_data partition.

Would you please give me some hints how to do this exactly?

I built the image with the Online-builder

http://downloads.openwrt.org/releases/18.06.2/targets/ramips/mt7620/openwrt-18.06.2-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin

So you think it's save to just put this through luci oder sysupgrade over this mess?

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.2, r7676-cddd7b4c77
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    29.5M    548.0K     29.0M   2% /tmp
tmpfs                    29.5M     52.0K     29.4M   0% /tmp/root
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock4            4.0M    224.0K      3.8M   5% /overlay
overlayfs:/overlay        4.0M    224.0K      3.8M   5% /
root@OpenWrt:~# cat /proc/partitions
major minor  #blocks  name

  31        0        128 mtdblock0
  31        1       7808 mtdblock1
  31        2       1404 mtdblock2
  31        3       6403 mtdblock3
  31        4       4084 mtdblock4
  31        5         64 mtdblock5
  31        6         64 mtdblock6
  31        7         64 mtdblock7
  31        8         64 mtdblock8
root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00001000 "u-boot"
mtd1: 007a0000 00001000 "firmware"
mtd2: 0015f0f0 00001000 "kernel"
mtd3: 00640f10 00001000 "rootfs"
mtd4: 003fd000 00001000 "rootfs_data"
mtd5: 00010000 00001000 "config"
mtd6: 00010000 00001000 "rom"
mtd7: 00010000 00001000 "romfile"
mtd8: 00010000 00001000 "radio"
root@OpenWrt:~# 
root@OpenWrt:~# dmesg
[    0.000000] Linux version 4.14.95 (buildbot@builds-03.infra.lede-project.org) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7627-753531d)) #0 Mon Jan 28 08:54:32 2019
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620A ver:2 eco:6
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is TP-Link Archer C20i
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 80421050, node_mem_map 81000040
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from 0x8042472c with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 60240K/65536K available (3590K kernel code, 178K rwdata, 464K rodata, 176K init, 214K bss, 5296K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000013] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.007597] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.073545] pid_max: default: 32768 minimum: 301
[    0.078276] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084653] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.097632] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107174] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.113164] pinctrl core: initialized pinctrl subsystem
[    0.119530] NET: Registered protocol family 16
[    0.129181] Can't analyze schedule() prologue at 8037d498
[    0.387418] PCI host bridge /pcie@10140000 ranges:
[    0.392030]  MEM 0x0000000020000000..0x000000002fffffff
[    0.397081]   IO 0x0000000010160000..0x000000001016ffff
[    0.420054] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.425506] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.431827] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.437241] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.443520] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.448943] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.455246] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.460576] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.467319] PCI host bridge to bus 0000:00
[    0.471285] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.477908] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.483668] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.490251] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.497994] pci 0000:00:00.0: [1814:0801] type 01 class 0x060400
[    0.498038] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.498055] pci 0000:00:00.0: reg 0x14: [mem 0x20200000-0x2020ffff]
[    0.498134] pci 0000:00:00.0: supports D1
[    0.498145] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.498607] pci 0000:01:00.0: [14c3:7650] type 00 class 0x028000
[    0.498661] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.498802] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.499061] pci 0000:01:00.1: [14c3:8650] type 00 class 0x0d1100
[    0.499110] pci 0000:01:00.1: reg 0x10: [mem 0x00000000-0x000fffff]
[    0.499242] pci 0000:01:00.1: supports D1
[    0.499252] pci 0000:01:00.1: PME# supported from D0 D1 D3hot D3cold
[    0.499460] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.499480] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.499531] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.505898] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.512710] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x201fffff]
[    0.519253] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.525867] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff]
[    0.532442] pci 0000:01:00.1: BAR 0: assigned [mem 0x20100000-0x201fffff]
[    0.539048] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.543853] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x201fffff]
[    0.555994] clocksource: Switched to clocksource systick
[    0.562286] NET: Registered protocol family 2
[    0.567505] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.574234] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.580454] TCP: Hash tables configured (established 1024 bind 1024)
[    0.586718] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.592347] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.598722] NET: Registered protocol family 1
[    0.602960] PCI: CLS 0 bytes, default 32
[    0.605677] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.612424] Crashlog allocated RAM at address 0x3f00000
[    0.619253] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.631466] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.637110] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.657011] io scheduler noop registered
[    0.660758] io scheduler deadline registered (default)
[    0.666782] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.675828] console [ttyS0] disabled
[    0.679344] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.688954] console [ttyS0] enabled
[    0.696009] bootconsole [early0] disabled
[    0.704788] cacheinfo: Failed to find cpu0 device node
[    0.710076] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.723662] spi spi0.0: force spi mode3
[    0.728435] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    0.733479] 6 fixed-partitions partitions found on MTD device spi0.0
[    0.740015] Creating 6 MTD partitions on "spi0.0":
[    0.744911] 0x000000000000-0x000000020000 : "u-boot"
[    0.750932] 0x000000020000-0x0000007c0000 : "firmware"
[    2.013866] 2 tplink-fw partitions found on MTD device firmware
[    2.019951] 0x000000020000-0x00000017f0f0 : "kernel"
[    2.025925] 0x00000017f0f0-0x0000007c0000 : "rootfs"
[    2.031841] mtd: device 3 (rootfs) set to be root filesystem
[    2.039258] 1 squashfs-split partitions found on MTD device rootfs
[    2.045588] 0x0000003c3000-0x0000007c0000 : "rootfs_data"
[    2.052058] 0x0000007c0000-0x0000007d0000 : "config"
[    2.058044] 0x0000007d0000-0x0000007e0000 : "rom"
[    2.063660] 0x0000007e0000-0x0000007f0000 : "romfile"
[    2.069740] 0x0000007f0000-0x000000800000 : "radio"
[    2.076333] libphy: Fixed MDIO Bus: probed
[    2.088128] gsw: setting port4 to ephy mode
[    2.092449] mtk_soc_eth 10100000.ethernet eth0 (uninitialized): port 0 link up (100Mbps/Full duplex)
[    2.102026] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    2.108788] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    2.117775] rt2880_wdt 10000120.watchdog: Initialized
[    2.124321] NET: Registered protocol family 10
[    2.132896] Segment Routing with IPv6
[    2.136825] NET: Registered protocol family 17
[    2.141409] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.154639] 8021q: 802.1Q VLAN Support v1.8
[    2.176682] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    2.184839] Freeing unused kernel memory: 176K
[    2.189417] This architecture does not have kernel memory protection.
[    2.535930] random: fast init done
[    3.711073] init: Console is alive
[    3.714798] init: - watchdog -
[    5.306987] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.623223] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.635267] init: - preinit -
[    7.344563] 8021q: adding VLAN 0 to HW filter on device eth0
[    8.579235] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[    8.621596] urandom-seed: Seed file not found (/etc/urandom.seed)
[    8.887816] procd: - early -
[    8.890873] procd: - watchdog -
[    9.224014] procd: - watchdog -
[    9.227595] procd: - ubus -
[    9.450425] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.554470] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.561536] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.569282] procd: - init -
[   10.006069] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.112732] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.130901] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[   10.139145] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[   10.150245] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.164748] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   10.234748] xt_time: kernel timezone is -0000
[   10.319056] PPP generic driver version 2.4.2
[   10.326237] NET: Registered protocol family 24
[   10.361261] rt2800_wmac 10180000.wmac: loaded eeprom from mtd device "radio"
[   10.368538] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[   10.376463] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[   10.384248] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   10.461481] kmodloader: done loading kernel modules from /etc/modules.d/*
[   11.734560] urandom_read: 5 callbacks suppressed
[   11.734570] random: jshn: uninitialized urandom read (4 bytes read)
[   11.892665] random: jshn: uninitialized urandom read (4 bytes read)
[   26.377837] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   26.385215] jffs2_build_filesystem(): unlocking the mtd device... 
[   26.385220] done.
[   26.393516] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[   27.253176] 8021q: adding VLAN 0 to HW filter on device eth0
[   27.314705] br-lan: port 1(eth0.1) entered blocking state
[   27.320297] br-lan: port 1(eth0.1) entered disabled state
[   27.326166] device eth0.1 entered promiscuous mode
[   27.331101] device eth0 entered promiscuous mode
[   27.439021] br-lan: port 1(eth0.1) entered blocking state
[   27.444550] br-lan: port 1(eth0.1) entered forwarding state
[   27.450463] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   28.318050] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   65.620180] done.
[   65.622209] jffs2: notice: (1129) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   65.885640] overlayfs: upper fs does not support tmpfile.
[   72.662713] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   72.675201] br-lan: port 2(wlan0) entered blocking state
[   72.680721] br-lan: port 2(wlan0) entered disabled state
[   72.686529] device wlan0 entered promiscuous mode
[   72.702125] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   72.708880] br-lan: port 2(wlan0) entered blocking state
[   72.714305] br-lan: port 2(wlan0) entered forwarding state
[   76.227256] device wlan0 left promiscuous mode
[   76.232008] br-lan: port 2(wlan0) entered disabled state
[   77.126203] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   77.138787] br-lan: port 2(wlan0) entered blocking state
[   77.144292] br-lan: port 2(wlan0) entered disabled state
[   77.150093] device wlan0 entered promiscuous mode
[   77.165705] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   77.172454] br-lan: port 2(wlan0) entered blocking state
[   77.177880] br-lan: port 2(wlan0) entered forwarding state
[   79.240664] random: crng init done
root@OpenWrt:~# 
1 Like

That you've got OpenWrt running, it is most likely safe.

If you haven't already done so, I would preserve the partition contents that are critical for operation somewhere off the router. At a minimum, that would be u-boot, config, rom, romfile, radio. For NOR flash, something like

dd if=/dev/mtdNro of=/tmp/mtdNro.dd 

(where N is the partition number)
and then copying to your "desktop" would be a good way to make those backups. Backing them all up wouldn't be a bad idea, especially with only 8 MB of flash to copy.

Ok, now it looks like “release” firmware has a viable overlay. That pretty much confirms that the problem is “too much stuff”.


If you're going to work with challenging devices, you might want to consider installing your own build system rather than the online one you're using. I've run it on Debian installed in a VirtualBox VM (shoot for a 32 GB, variable-size "disk" when you set up) with a single core.


Looking at the partition table of that device, "upgrading" the flash isn't going to gain you much because the OEM put critical data at the "top" of the address space. As a result, going to a 16 MB flash, if even possible, would only get you 8 MB of contiguous space, not a lot more than you've already got. You'd need some "major surgery" to be able to shift those partitions around. You'd need expertise in use low-level bootloader operation to get it to boot. You'd then basically be stuck with your own, self-built firmware from then on, without going back into the bootloader to re-shift the data back to "stock" layout.

Ok,

I saved the 9 files mtd0 until mtd8 to my desktop. - If it is to much stuff, why does it not give an information and compile? Usually it doesn't compile a xxx.sysupgrade or factory-file in the image-builder. I still know that from my ancient device-images :wink:

So, any idea why it shifted or how it shited the partitions? If I look to my owm build-structure, I still see around the 30 MB of space... Is it already the RAM or where does the device get the space?

Don't you think there is still some space on other mtdX?

The kernel, early in its operation, splits the firmware into the ROM portion and the overlay portion. This is normal and expected.

I can't comment on the online builder you're using. Apparently you're "on the hairy edge" of not enough space. It isn't indicating that it is bombing out because it can't fit everything, and perhaps isn't checking that there is sufficient space left for the overlay partition.

/tmp/ (which is also used for /var/) is a memory-backed file system that is lost with every reboot.

No. Even if you could "swallow" rom and romfile (which would make returning to OEM firmware likely fail, and might make the device perform poorly), that's only 8 kB total.

What do you think about the information, that these flash chips have a "self-management" to use the 16 MB flash. At least it's that what I understood in this Upgrade Flash to 16MB project and also got in a german video successfull upgrade flash to 16 MB-video.

[    0.744911] 0x000000000000-0x000000020000 : "u-boot"
[    0.750932] 0x000000020000-0x0000007c0000 : "firmware"
[    2.013866] 2 tplink-fw partitions found on MTD device firmware
[    2.019951] 0x000000020000-0x00000017f0f0 : "kernel"
[    2.025925] 0x00000017f0f0-0x0000007c0000 : "rootfs"
[    2.031841] mtd: device 3 (rootfs) set to be root filesystem
[    2.039258] 1 squashfs-split partitions found on MTD device rootfs
[    2.045588] 0x0000003c3000-0x0000007c0000 : "rootfs_data"
[    2.052058] 0x0000007c0000-0x0000007d0000 : "config"
[    2.058044] 0x0000007d0000-0x0000007e0000 : "rom"
[    2.063660] 0x0000007e0000-0x0000007f0000 : "romfile"
[    2.069740] 0x0000007f0000-0x000000800000 : "radio"

Your bootloader occupies the first 128 kB. That's "non-negotiable"

The firmware occupies the next 7808 kB

Then you have what are likely device-critical data in the top 256 kB.

If you were to change to a 16 MB flash, and it worked, you'd have 7808 kB in one free block, and then 8192 kB in the next free block. The "auto-expand" only works if the free space is contiguous. This is the case on many devices that layout the flash something like

  • Boot loader
  • Device-specific data
  • Firmware
  • (new free space)

on your device, it would be

  • Boot loader
  • Firmware
  • Device-specific data
  • (new free space)

(The layout of your device is an OEM decision, not an OpenWrt one.)


Edit:

In the case of the first link, a WR841v9 appears to have a 4 MB flash chip. Moving to a 16 MB flash chip would give at least 12 MB of contiguous space. I assume that the second link, also referring to a WR841 (of which there are at least 10 variants), was also a 4 MB flash chip.