mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 18:19:02 +00:00
f11e6e221e
**SoC**: MediaTek MT7981B 2x A53
**Flash**: ESMT F50L1G41LB 128MB
**RAM**: NT52B128M16JR-FL 256MB
**Ethernet**: 4x 10/100/1000 Mbps
**Switch**: MediaTek MT7531AE
**WiFi**: MediaTek MT7976C
**Buttons**: Reset, Mesh
**Power**: DC 12V 1A
1. Get ssh access. Supported stock firmware **1.0.47**
```
curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Anvram%20set%20ssh_en%3D1%0A"
curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Anvram%20commit%0A"
curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0Ased%20-i%20's%2Fchannel%3D.*%2Fchannel%3D%22debug%22%2Fg'%20%2Fetc%2Finit.d%2Fdropbear%0A"
curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=*******/api/misystem/arn_switch" -d "open=1&model=1&level=%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A"
curl -X POST "http://192.168.31.1/cgi-bin/luci/;stok=********/api/misystem/arn_switch" -d "open=1&model=1&level=%0Apasswd%20-d%20root%0A
```
2. Backup stock partitions
```
nanddump -f /tmp/BL2.bin /dev/mtd1
nanddump -f /tmp/Nvram.bin /dev/mtd2
nanddump -f /tmp/Bdata.bin /dev/mtd3
nanddump -f /tmp/Factory.bin /dev/mtd4
nanddump -f /tmp/FIP.bin /dev/mtd5
nanddump -f /tmp/ubi.bin /dev/mtd8
nanddump -f /tmp/KF.bin /dev/mtd12
```
Then transfer them to your computer in a safe place.
3. Get firmware information `cat /proc/cmdline`
4. Copy openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi to **/tmp** and flash
If **firmware=0**
```
ubiformat /dev/mtd9 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=1
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
reboot
```
If **firmware=1**
```
ubiformat /dev/mtd8 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi
nvram set boot_wait=on
nvram set uart_en=1
nvram set flag_boot_rootfs=0
nvram set flag_last_success=0
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit
reboot
```
Then reboot your router, it should boot to the OpenWrt initramfs system now.
5. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin
`sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin`
1. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
`ubiformat /dev/mtd8 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb`
`reboot`
2. Install kmod-mtd-rw
`opkg update && opkg install kmod-mtd-rw`
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
3. Format ubi and create new ubootenv volume
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
```
4. *(Optional **-10Mb** free space) Add recovery boot feature.*
```
ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
ubiupdatevol /dev/ubi0_2 /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
```
5. Flash Openwrt U-Boot
```
mtd write /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-preloader.bin BL2
mtd write /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-bl31-uboot.fip FIP
```
6. Flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb
`sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-squashfs-sysupgrade.itb`
1. Force flash openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb
`sysupgrade -F -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb`
2. Format ubi and Nvram
```
ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
mtd erase Nvram
```
3. Install kmod-mtd-rw
`opkg update && opkg install kmod-mtd-rw`
`insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`
4. Flash stock images from backup
```
mtd write /tmp/BL2.bin BL2
mtd write /tmp/FIP.bin FIP
mtd write /tmp/ubi.bin ubi
```
Then reboot your router, waiting it finished rollback in minutes.
`ubiformat /dev/mtd7 -y -f /tmp/ubi.bin`
Then reboot your router, waiting it finished rollback in minutes.
Signed-off-by: Dim Fish <dimfish@gmail.com>
(cherry picked from commit
|
||
---|---|---|
.. | ||
mt7622-buffalo-wsr-2533dhp2.dts | ||
mt7622-buffalo-wsr-3200ax4s.dts | ||
mt7622-buffalo-wsr.dtsi | ||
mt7622-dlink-eagle-pro-ai-m32-a1.dts | ||
mt7622-elecom-wrc-2533gent.dts | ||
mt7622-elecom-wrc-x3200gst3.dts | ||
mt7622-linksys-e8450-ubi.dts | ||
mt7622-linksys-e8450.dts | ||
mt7622-linksys-e8450.dtsi | ||
mt7622-netgear-wax206.dts | ||
mt7622-reyee-ax3200-e5.dts | ||
mt7622-rfb1-ubi.dts | ||
mt7622-ruijie-rg-ew3200.dtsi | ||
mt7622-ruijie-rg-ew3200gx-pro.dts | ||
mt7622-totolink-a8000ru.dts | ||
mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts | ||
mt7622-ubnt-unifi-6-lr-v1.dts | ||
mt7622-ubnt-unifi-6-lr-v1.dtsi | ||
mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts | ||
mt7622-ubnt-unifi-6-lr-v2.dts | ||
mt7622-ubnt-unifi-6-lr-v2.dtsi | ||
mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts | ||
mt7622-ubnt-unifi-6-lr-v3.dts | ||
mt7622-ubnt-unifi-6-lr-v3.dtsi | ||
mt7622-ubnt-unifi-6-lr.dtsi | ||
mt7622-xiaomi-redmi-router-ax6s.dts | ||
mt7623a-unielec-u7623-02-emmc-512m.dts | ||
mt7623a-unielec-u7623-02.dts | ||
mt7623a-unielec-u7623-02.dtsi | ||
mt7629-iptime-a6004mx.dts | ||
mt7629-netgear-ex6250-v2.dts | ||
mt7629-tplink_eap225-v5.dts | ||
mt7981a-ubnt-unifi-6-plus.dts | ||
mt7981b-cetron-ct3003.dts | ||
mt7981b-cmcc-rax3000m-emmc.dtso | ||
mt7981b-cmcc-rax3000m-nand.dtso | ||
mt7981b-cmcc-rax3000m.dts | ||
mt7981b-confiabits-mt7981.dts | ||
mt7981b-cudy-re3000-v1.dts | ||
mt7981b-cudy-wr3000-v1.dts | ||
mt7981b-glinet-gl-mt3000.dts | ||
mt7981b-h3c-magic-nx30-pro.dts | ||
mt7981b-jcg-q30-pro.dts | ||
mt7981b-qihoo-360t7.dts | ||
mt7981b-routerich-ax3000.dts | ||
mt7981b-unielec-u7981-01-emmc.dts | ||
mt7981b-unielec-u7981-01-nand.dts | ||
mt7981b-unielec-u7981-01.dtsi | ||
mt7981b-xiaomi-mi-router-ax3000t-ubootmod.dts | ||
mt7981b-xiaomi-mi-router-ax3000t.dts | ||
mt7981b-xiaomi-mi-router-ax3000t.dtsi | ||
mt7981b-xiaomi-mi-router-common.dtsi | ||
mt7981b-xiaomi-mi-router-wr30u-112m-nmbm.dts | ||
mt7981b-xiaomi-mi-router-wr30u-stock.dts | ||
mt7981b-xiaomi-mi-router-wr30u-ubootmod.dts | ||
mt7981b-xiaomi-mi-router-wr30u.dtsi | ||
mt7981b-zbtlink-zbt-z8102ax.dts | ||
mt7981b-zyxel-nwa50ax-pro.dts | ||
mt7986a-acelink-ew-7886cax.dts | ||
mt7986a-acer-predator-w6.dts | ||
mt7986a-asus-rt-ax59u.dts | ||
mt7986a-asus-tuf-ax4200.dts | ||
mt7986a-asus-tuf-ax6000.dts | ||
mt7986a-glinet-gl-mt6000.dts | ||
mt7986a-tplink-tl-xdr4288.dts | ||
mt7986a-tplink-tl-xdr6086.dts | ||
mt7986a-tplink-tl-xdr6088.dts | ||
mt7986a-tplink-tl-xdr-common.dtsi | ||
mt7986a-xiaomi-redmi-router-ax6000-stock.dts | ||
mt7986a-xiaomi-redmi-router-ax6000-ubootmod.dts | ||
mt7986a-xiaomi-redmi-router-ax6000.dtsi | ||
mt7986a-zyxel-ex5601-t0-common.dtsi | ||
mt7986a-zyxel-ex5601-t0-stock.dts | ||
mt7986a-zyxel-ex5601-t0-ubootmod.dts | ||
mt7986a-zyxel-ex5700-telenor.dts | ||
mt7986b-mercusys-mr90x-v1.dts | ||
mt7986b-netgear-wax220.dts |