OpenWRT 22.03.5 on Xiaomi Mi 4A (Chinese version)

Hi there,

I'd like to install the latest OpenWRT version (as of this post) which is 22.03.5 on a Xiaomi Mi 4A 100M (Chinese version). Thanks to acecilia's great work, I was able to install the exploit, but my first attempt to install OpenWRT itself was unsuccessful and resulted in a bricked router.

I followed Hoddy's Guide to un-brick using a Windows 7 virtual machine.

Current firmware: 2.28.62 (Official version)
Root access: yes
FTP access: yes

This is where I lost track of the proper way to flash OpenWRT. acecilia's page doesn't say specifically how to use the shell for the 4A 100M (Chinese version) to load and start the upgrade process, and the wiki isn't too clear either.

From acecilia's, but adapted to my needs from the wiki: first line from acecilia's exploit redirected to the MIR3G's firmware, which is obviously not the same as the R4A:

cd /tmp
curl https://downloads.openwrt.org/releases/22.03.5/targets/ramips/mt76x8/openwrt-22.03.5-ramips-mt76x8-xiaomi_mi-router-4a-100m-squashfs-sysupgrade.bin --output firmware.bin # Put here the URL you want to use to download the firmware
./busybox sha256sum firmware.bin # Verify the firmware checksum before flashing, very important to avoid bricking your device!
mtd -e OS1 -r write firmware.bin OS1 # Install OpenWrt

But the wiki says the last line should be:

mtd -r write firmware.bin OS1

Why would one first erase the partition but not the other?

But more importantly, is it the correct way to flash OpenWRT?
I'd rather avoid bricking it a second time.

Thanks but the 4 and the 4A are not the same oneā€¦

Anyway I tried to load the new firmware following the instructions adapted to my needs, but it fails to reboot in a working state.

Of course I checked the sha256sum, twice: once after downloading the file from the firmware selector, another time after uploading to the /tmp directory in the router.

From the serial console:

Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   2: Load system code then write to Flash via TFTP. 
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial. 
   9: Load Boot Loader code then write to Flash via TFTP. 

   n3: System Boot system code via Flash.
Booting System 1
Erasing SPI Flash...
raspi_erase: offs:30000 len:10000
.
Writing to SPI Flash...
.
done
## Booting image at bc180000 ...
   Image Name:   MIPS OpenWrt Linux-5.10.176
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    2208890 Bytes =  2.1 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover

Then it proceeds on rebooting, infinitely. From what I could read, LZMA errors are non-specific.

Does anybody have an idea what's happening there?