Installing OpenWrt over other firmware with custom mtd layout


OpenWRT officially supports Xiaomi Mi Wifi router 3G (R3G), however the flashing procedure assumes stock firmware is present.

My situation is that I already installed Padavan firmware, going through all the steps required to get SSH access (either opening up the device and soldering pins, or creating a Mi account, linking the device, and obtaining the ssh file along with the password).

To install OpenWRT, it seems silly to me to revert back to stock, go through all the pain of registering with Xiaomi (I need an Android/iOS phone for that too), to have the crappy stock firmware that I can install OpenWRT on top of.

I already have full ssh access to the device, it just seems to have a different mtd layout than what is described in the official OpenWRT installation page:

/home/root # cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00020000 "Bootloader"
mtd1: 00080000 00020000 "BootEnv"
mtd2: 00040000 00020000 "Factory"
mtd3: 00040000 00020000 "crash"
mtd4: 00040000 00020000 "crash_syslog"
mtd5: 00040000 00020000 "reserved0"
mtd6: 00400000 00020000 "kernel0"
mtd7: 00140000 00020000 "Kernel"
mtd8: 012c0000 00020000 "RootFS"
mtd9: 00100000 00020000 "Config"
mtd10: 00400000 00020000 "Storage"
mtd11: 06080000 00020000 "RWFS"
mtd12: 01400000 00020000 "Firmware_Stub"

I feel like I am very close to just flashing a couple of files to have openwrt on this device. But do I need to modify the entire mtd layout (from what I understand, this is similar to disk partitions)??

Thank you for reading

The general advice for flashing OpenWrt from other than stock firmwares:

  1. Go back to stock firmware
  2. Flash OpenWrt from stock firmware
1 Like