@esix4rmyy Definitely the flashed data is getting corrupted, either while flashing or after that.
My guess is that as the Xiaomi firmware also uses a jffs partition for storing it's data, that coincides with the area you are flashing into and has it mounted, it still manages to write to it before the router is restarted, effectively corrupting the data where you should have the rootfs.
If this is the case, there are a few possibilities to work around this:
- modify the bootloader
- get a flasher and do as described in the first posts so you are able to interact with the bootloader using a TTL UART adapter
- then flash the sysupgrade image with option
2: Load system code then write to Flash via TFTP
- if you don't have a flasher (although they're cheap and easy to get from China) you can try to dump the boot loader image from
/dev/mtd1
(or whatever equivalent is present on Xiaomi firmware), modify it and flash it back with something likemtd -e Bootloader -r write mod_bootloader.bin Bootloader
- but I haven't tried this, and if anything goes wrong, you will end up needing a flasher anyway to unbrick the device, without having made a stable backup copy of it... not recommended
- try to flash a initramfs first instead - not sure if this will work... (but if it does, it should solve the issues of anyone still not being able to flash OpenWRT, without the need of a flasher)
- I know that the initramfs can be used with an unlocked bootloader to boot a "ram only" version of OpenWRT using the option
1: Load system code to SDRAM via TFTP.
- if it also works by flashing it with mtd, and from there flash the final sysimage, then it may be a solution for the problem you're having
- you won't lose much to try this method, as you won't be modifying the bootloader, so it should be as safe as what you've been doing so far... but as always, if something goes wrong, you'll need a flasher to unbrick
- I've published a new release (without the intermediate loader hack/patch) in https://github.com/araujorm/openwrt/releases/tag/mir4ag-19.07-20200722 where I've included the initramfs along the sysupgrade image; if you want to try this method, I've put there what I believe are the instructions that should work (as I said, untested... but that sysupgrade image is good, I'm using it right now)
- I know that the initramfs can be used with an unlocked bootloader to boot a "ram only" version of OpenWRT using the option
Please tell me the outcome, should you proceed with any of these suggestions.
Best of luck.