Belkin RT3200/Linksys E8450 WiFi AX discussion

@daniel
I am pondering if it is possible to rewrite FIP from a normally running router.

(I have a router suffering from occasional OKD. I got it booted this time with the refrigerator trick. No serial attached yet, so am thinking about shortcuts...)

As FIP is now in ubi in the new scheme in main/master, we should be able to rewrite it via ubi commands, as FIP is not in active use or mounted during normal operations. Right?

This command verifies that "fip" is one of the ubi volumes, so my router is using the new partition scheme: (Name" is fip)

root@router4:~# ubinfo -d 0 -n 0
Volume ID:   0 (on ubi0)
Type:        static
Alignment:   1
Size:        9 LEBs (1142784 bytes, 1.0 MiB)
Data bytes:  1019644 bytes (995.7 KiB)
State:       OK
Name:        fip
Character device major/minor: 251:1

root@router4:/tmp# ls -l openwrt-mediatek-mt7622-linksys_e8450-ubi-bl31-uboot.fip
-rw-r--r--    1 root     root       1012564 Apr  6 20:13 openwrt-mediatek-mt7622-linksys_e8450-ubi-bl31-uboot.fip

Your old advice regarding the recovery partition rewrite sounds pretty applicable to FIP with slight modifications: Belkin RT3200/Linksys E8450 WiFi AX discussion - #1318 by daniel

FIP image is standard-sized, so using ubiupdatevol should work without fearing of needing to reserve more space, right?

Would it work by just downloading the current FIP image and doing ubi volume update?

ubiupdatevol /dev/ubi0_0 openwrt-mediatek-mt7622-linksys_e8450-ubi-bl31-uboot.fip

There are no bad blocks yet, so ubi has its reserve intact:

root@router4:/tmp# ubinfo -d 0 | grep physical
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20

Despite that, if oversize risks are still feared, then booting into initramfs recovery and ubirmvol rootfs_data should take care of freeing enough space, right?

EDIT:
I actually did that: I updated my RT3200 with the current .fip file via ubiupdatevol while running normal OpenWrt. Router booted ok after that, and the size info of the volume has changed, so flash did happen:

root@router4:~# ubinfo -d 0 -n 0
Volume ID:   0 (on ubi0)
Type:        static
Alignment:   1
Size:        9 LEBs (1142784 bytes, 1.0 MiB)
Data bytes:  1012564 bytes (988.8 KiB)
State:       OK
Name:        fip
Character device major/minor: 251:1

Curious to see if that helps against subsequent OKDs.

EDIT2:
The router also survived the next sysupgrade without OKD :wink:

4 Likes