Meanwhile tried switching to ubi, but it would fail when trying to attach and expand the volume for the first time, erasing all blocks untl the end of partition:
[ 2.867788] ubi0: attaching mtd4
[ 2.876059] mt7530 mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx
[ 2.969558] UBI: EOF marker found, PEBs from 35 will be erased
[ 3.214077] ubi0 error: ubi_io_is_bad: error -77 while checking if PEB 225 is bad
[ 3.221616] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd4, error -77
[ 3.228688] UBI error: cannot attach mtd4
[ 3.233467] /dev/root: Can't open blockdev
[ 3.237605] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
resulting in kernel panic and reboot. First fix involved shrinking the ubi partition in dts and adding lots of padding, which worked but would waste most of the free flash space.
nand erase 0x580000 0x3000000 in uboot shell, it detected one bad block and it was fixed: OpenWrt worked, reverting to OEM worked, as well as back to OpenWrt. So it's not the fault of the ELX unpacking here, but what seem to be physicals errors in the lower NAND layers.
-77 arises from https://elixir.bootlin.com/linux/latest/source/drivers/mtd/ubi/io.c#L583, but I could not track it down to the actual code where the value of 77 is composed, eventually function pointers are used to abstract this for different lower level nand drivers. So this error -77 must be an issue within the mtk-nand implementation, probably when dealing with bad blocks.
The first device I used for testing back in 2021 was suddenly bricked even when running OEM firmware: It would still boot, but only come up with a default SSID like
MTK_HARRIER_AP_2.4G or similar, and flashing the OEM image via recovery would not fix this. Maybe that's due to the same NAND error?
So I tried another device (which had OEM working), but it was the same: Error -77 occured on a different PEB here, erasing manually via uboot fixed it again.
Now I wonder what happens with factory-new devices, which had not been used for so much experimentation... Feel free to try
If you get a bootloop (red LED flashing, pause, flashing, ...) it's probably error -77 as well. Try to flash initramfs then, ssh into it and call
mtd erase /dev/mtd4, reboot back into the recovery and flash factory again. But I really hope it only affected my two test devices.
RSSI leds not working, no idea what we should use as the interface name.
reserve partition is not yet used, this wil require
mtd-concat eventually, I'm curious as to whether this plays nicely with ubi volumes being split into two chunks