Xiaomi R4AC (initramfs) mode

Hello. Sorry for my English. I installed the firmware using OpenWRTInvasion and after loading the system I saw the message "system running in recovery (initramfs) mode". The firmware of the squashfs-sysupgrade image turns the router into a brick and you have to restore it using MIWIFIRepairTool. Can anyone help get rid of this problem?

[    0.000000] Linux version 5.15.162 (builder@buildhost) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24012-d8dd03c46f) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Mon Jul 15 22:14:18 2024
[    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 MT7628AN ver:1 eco:2
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[    0.000000] MIPS: machine is Xiaomi Mi Router 4A (100M International Edition)
[    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] 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: 16240
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00035dc0
[    0.000000] Readback ErrCtl register=00035dc0
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 52756K/65536K available (5980K kernel code, 605K rwdata, 748K rodata, 4496K init, 217K bss, 12780K 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] intc: using register map from devicetree
[    0.000000] CPU Clock: 575MHz
[    0.000000] timer_probe: no matching timers found
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6647862422 ns
[    0.000002] sched_clock: 32 bits at 287MHz, resolution 3ns, wraps every 7469508094ns
[    0.007636] Calibrating delay loop... 380.92 BogoMIPS (lpj=1904640)
[    0.073512] pid_max: default: 32768 minimum: 301
[    0.079071] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.086116] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.102192] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.111731] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.118479] pinctrl core: initialized pinctrl subsystem
[    0.125653] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.132027] thermal_sys: Registered thermal governor 'step_wise'
[    0.398917] PCI host bridge to bus 0000:00
[    0.408635] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
[    0.415278] pci_bus 0000:00: root bus resource [io  0x10160000-0x1016ffff]
[    0.421899] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.429606] pci 0000:00:00.0: [14c3:0801] type 01 class 0x060400
[    0.435369] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    0.441418] pci 0000:00:00.0: reg 0x14: [mem 0x20200000-0x2020ffff]
[    0.447527] pci 0000:00:00.0: supports D1
[    0.451334] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.458665] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
[    0.464463] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    0.471074] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.477599] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    0.485001] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.491358] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
[    0.497803] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    0.504137] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    0.510869] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x200fffff]
[    0.517411] pci 0000:00:00.0: BAR 9: assigned [mem 0x20100000-0x201fffff pref]
[    0.524390] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
[    0.530943] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff 64bit]
[    0.538014] pci 0000:01:00.0: BAR 6: assigned [mem 0x20100000-0x2010ffff pref]
[    0.544963] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.549760] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x200fffff]
[    0.556302] pci 0000:00:00.0:   bridge window [mem 0x20100000-0x201fffff pref]
[    0.563820] clocksource: Switched to clocksource MIPS
[    0.570369] NET: Registered PF_INET protocol family
[    0.575432] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.583509] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.591736] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.599178] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.606582] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.613376] TCP: Hash tables configured (established 1024 bind 1024)
[    0.619704] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.626053] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.633224] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.638798] PCI: CLS 80 bytes, default 32
[    1.369657] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    1.382828] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.388493] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.399689] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.409793] mt7621_gpio 10000600.gpio: registering 32 gpios
[    1.415576] mt7621_gpio 10000600.gpio: registering 32 gpios
[    1.421264] mt7621_gpio 10000600.gpio: registering 32 gpios
[    1.427345] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.436831] printk: console [ttyS0] disabled
[    1.441006] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[    1.449803] printk: console [ttyS0] enabled
[    1.458220] printk: bootconsole [early0] disabled
[    1.469647] spi-mt7621 10000b00.spi: sys_freq: 191666666
[    1.485127] spi-nor spi0.0: gd25q128 (16384 Kbytes)
[    1.490182] 7 fixed-partitions partitions found on MTD device spi0.0
[    1.496729] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    1.504209] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    1.512186] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    1.519705] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    1.527369] Creating 7 MTD partitions on "spi0.0":
[    1.532242] 0x000000000000-0x000000020000 : "bootloader"
[    1.539712] 0x000000020000-0x000000030000 : "config"
[    1.546298] 0x000000030000-0x000000040000 : "factory"
[    1.553048] 0x000000040000-0x000000050000 : "crash"
[    1.559559] 0x000000050000-0x000000060000 : "cfg_bak"
[    1.566418] 0x000000060000-0x000000260000 : "overlay"
[    1.572874] 0x000000260000-0x000001000000 : "firmware"
[    1.618245] rt3050-esw 10110000.esw: mediatek esw at 0xb0110000, irq 25 initialized
[    1.644982] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.656019] NET: Registered PF_INET6 protocol family
[    2.244271] Segment Routing with IPv6
[    2.248097] In-situ OAM (IOAM) with IPv6
[    2.252244] NET: Registered PF_PACKET protocol family
[    2.257515] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.270982] 8021q: 802.1Q VLAN Support v1.8
[    2.277500] clk: Disabling unused clocks
[    6.088334] rt3050-esw 10110000.esw: port 2 link up
[    7.561769] Freeing unused kernel image (initmem) memory: 4496K
[    7.567835] This architecture does not have kernel memory protection.
[    7.574384] Run /init as init process
[    7.578094]   with arguments:
[    7.578099]     /init
[    7.578105]   with environment:
[    7.578110]     HOME=/
[    7.578116]     TERM=linux
[    8.324593] init: Console is alive
[    8.328748] init: - watchdog -
[    8.359985] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    8.379336] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    8.397939] init: - preinit -
[    8.739998] random: jshn: uninitialized urandom read (4 bytes read)
[    8.861966] random: jshn: uninitialized urandom read (4 bytes read)
[    9.074275] random: jshn: uninitialized urandom read (4 bytes read)
[    9.364161] rt3050-esw 10110000.esw: port 2 link down
[   11.695319] procd: - early -
[   11.698675] procd: - watchdog -
[   12.363968] procd: - watchdog -
[   12.367630] procd: - ubus -
[   12.381547] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.421092] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.428301] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.439224] procd: - init -
[   13.239349] kmodloader: loading kernel modules from /etc/modules.d/*
[   13.832482] Loading modules backported from Linux version v6.1.97-0-g7753af06eebfb
[   13.840264] Backport generated by backports.git v6.1.97-1-0-g2431d56e
[   13.979279] rt3050-esw 10110000.esw: port 2 link up
[   14.024235] mt76_wmac 10300000.wmac: ASIC revision: 76280001
[   14.055302] mt76_wmac 10300000.wmac: Firmware Version: 20151201
[   14.061345] mt76_wmac 10300000.wmac: Build Time: 20151201183641
[   14.103876] mt76_wmac 10300000.wmac: firmware init done
[   14.270630] mt76_wmac 10300000.wmac: registering led 'mt76-phy0'
[   14.278925] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   14.480971] PPP generic driver version 2.4.2
[   14.504819] NET: Registered PF_PPPOX protocol family
[   14.542914] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.881075] random: jshn: uninitialized urandom read (4 bytes read)
[   16.241099] random: jshn: uninitialized urandom read (4 bytes read)
[   16.841667] random: jshn: uninitialized urandom read (4 bytes read)
[   16.998913] urngd: v1.0.2 started.
[   17.058201] random: jshn: uninitialized urandom read (4 bytes read)
[   20.304193] random: crng init done
[   20.307678] random: 30 urandom warning(s) missed due to ratelimiting
[   39.213676] rt3050-esw 10110000.esw: port 2 link down
[   43.912540] rt3050-esw 10110000.esw: port 2 link up
[   47.931919] br-lan: port 1(eth0.1) entered blocking state
[   47.937529] br-lan: port 1(eth0.1) entered disabled state
[   47.943384] device eth0.1 entered promiscuous mode
[   47.948323] device eth0 entered promiscuous mode
[   47.977865] br-lan: port 1(eth0.1) entered blocking state
[   47.983385] br-lan: port 1(eth0.1) entered forwarding state
[   48.934517] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

I'm in the same position as you. A4RC 100M Int version.

Followed Hoddys Guide (for Gigabit version but obviously substituting 100M files)
Reference DL page for OpenWRT here:
https://openwrt.org/inbox/toh/xiaomi/r4ac?s[]=r4ac

Factory image gets applied every time no problem and router boots to OWRT login but with: initramfs mode active each time.

Applying sysupdate (from the same reference page) through OWT's UI applies the update and reboots to a brick and have to recover with pxesrv.

After applying factory OWT, I have also tried placing the sysupdate in /tmp folder manually with winscp and using ssh to access and apply it with command sysupgrade -v /tmp/firmware_image.bin results in a "open wrt cannot save config while running from ramdisk" error. Then I need to restore back to OEM and start again.

Basically the furthest I can get is initial factory install but in initramfs mode activated.
(Tried device reset & reboot throughout this exercise but does not make a difference to the outcome.)

Note:
Original FW sources here: (all work for recovery)
https://mirom.ezbox.idv.tw/en/miwifi/R4AC/roms-stable/#google_vignette

Any help would be appreciated!

1 Like

The system running in recovery (initramfs) mode problem has been resolved. It is necessary to flash xiaomi_mi-router-4a-100m-squashfs-sysupgrade.bin, and not xiaomi_mi-router-4a-100m-intl-squashfs-sysupgrade.bin, and in this case OpenWRT will be installed correctly.