Specification: The device is similar to the M30 but has only one LAN port and no WAN port. - MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX) - 512MB RAM - 128MB NAND flash with two UBI partitions with identical size - 1 multi color LED (red, green, blue, white) connected via GCA230718 - 2 buttons (WPS, reset, LED) - 1 1Gbit LAN port Disassembly: - There are two screws at the power connector which must be removed. Afterwards the top case can be removed (it is clipped on, so some tools are required). Serial Interface: - The serial interface can be connected to the 4 pin holes on the board. Do NOT connect VCC. - The pins are labelled on the PCB (RX, TX, GND) - Settings: 115200, 8N1 MAC addresses: - LAN MAC is stored in partition "Odm" at offset 0x8f - WLAN MAC (2.4 GHz and 5GHz) is LAN MAC + 1 Reverting back to OEM firmware: - There is currently no easy way to revert back to the OEM image - The methods from M30 and M60 doesn't seem to work anymore - If you plan to revert back to OEM firmware later, do the following steps before flashing OpenWrt: - Boot from initramfs as described in "Flashing via U-Boot" but don't flash anything - Instead, make a backup of UBI and UBI1 partition - The created dumps must be written to the initial partitions to revert back to OEM Flashing via Recovery Web Interface: - Set your IP address to 192.168.200.10, subnetmask 255.255.255.0 - Press the reset button while powering on the device - Keep the reset button pressed until the LED blinks red - Open a Chromium based and goto http://192.168.200.50/ (recovery web interface) - Download openwrt-mediatek-filogic-dlink_aquila-pro-ai-e30-a1-squashfs-recovery.bin - Note: The recovery web interface always reports successful flashing, even if it fails - After flashing, the recovery web interface will try to forward the browser to 192.168.0.1 (can be ignored) - If flashing was successful, OpenWrt is accessible via 192.168.1.1 - The recovery image boots an initramfs image, flash the sys upgrade image to get to „normal“ OpenWrt mode Flashing via U-Boot: - Open the case, connect to the UART console - Set your IP address to 192.168.200.2, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router - Run a tftp server which provides openwrt-mediatek-filogic-dlink_aquila-pro-ai-e30-a1-initramfs-kernel.bin - Supply the board with 12V - Select "7. Load image" in the U-Boot menu - Enter image file, tftp server IP and device IP (if they differ from the default). - TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start - The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface) - Perform a sysupgrade using openwrt-mediatek-filogic-dlink_aquila-pro-ai-e30-a1-squashfs-sysupgrade.bin - Reboot the device. OpenWrt should start from flash now Flashing via OEM web interface is not possible, as it will change the active partition and OpenWrt is only running on the first UBI partition. Signed-off-by: Roland Reinl <reinlroland+github@gmail.com> Link: https://github.com/openwrt/openwrt/pull/22776 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
413 lines
8.4 KiB
Bash
413 lines
8.4 KiB
Bash
REQUIRE_IMAGE_METADATA=1
|
|
RAMFS_COPY_BIN='fitblk fit_check_sign'
|
|
|
|
asus_initial_setup()
|
|
{
|
|
# initialize UBI if it's running on initramfs
|
|
[ "$(rootfs_type)" = "tmpfs" ] || return 0
|
|
|
|
ubirmvol /dev/ubi0 -N rootfs
|
|
ubirmvol /dev/ubi0 -N rootfs_data
|
|
ubirmvol /dev/ubi0 -N jffs2
|
|
ubimkvol /dev/ubi0 -N jffs2 -s 0x3e000
|
|
}
|
|
|
|
buffalo_initial_setup()
|
|
{
|
|
local mtdnum="$( find_mtd_index ubi )"
|
|
if [ ! "$mtdnum" ]; then
|
|
echo "unable to find mtd partition ubi"
|
|
return 1
|
|
fi
|
|
|
|
ubidetach -m "$mtdnum"
|
|
ubiformat /dev/mtd$mtdnum -y
|
|
}
|
|
|
|
xiaomi_initial_setup()
|
|
{
|
|
# initialize UBI and setup uboot-env if it's running on initramfs
|
|
[ "$(rootfs_type)" = "tmpfs" ] || return 0
|
|
|
|
local mtdnum="$( find_mtd_index ubi )"
|
|
if [ ! "$mtdnum" ]; then
|
|
echo "unable to find mtd partition ubi"
|
|
return 1
|
|
fi
|
|
|
|
local kern_mtdnum="$( find_mtd_index ubi_kernel )"
|
|
if [ ! "$kern_mtdnum" ]; then
|
|
echo "unable to find mtd partition ubi_kernel"
|
|
return 1
|
|
fi
|
|
|
|
ubidetach -m "$mtdnum"
|
|
ubiformat /dev/mtd$mtdnum -y
|
|
|
|
ubidetach -m "$kern_mtdnum"
|
|
ubiformat /dev/mtd$kern_mtdnum -y
|
|
|
|
if ! fw_printenv -n flag_try_sys2_failed &>/dev/null; then
|
|
echo "failed to access u-boot-env. skip env setup."
|
|
return 0
|
|
fi
|
|
|
|
fw_setenv -s - <<-EOF
|
|
boot_wait on
|
|
uart_en 1
|
|
flag_boot_rootfs 0
|
|
flag_last_success 1
|
|
flag_boot_success 1
|
|
flag_try_sys1_failed 8
|
|
flag_try_sys2_failed 8
|
|
EOF
|
|
|
|
local board=$(board_name)
|
|
case "$board" in
|
|
xiaomi,mi-router-ax3000t|\
|
|
xiaomi,mi-router-wr30u-stock)
|
|
fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
|
|
;;
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),30720k(ubi),30720k(ubi1),51200k(overlay)"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
abt,asr3000|\
|
|
acer,predator-w6x-ubootmod|\
|
|
asus,zenwifi-bt8-ubootmod|\
|
|
bananapi,bpi-r3|\
|
|
bananapi,bpi-r3-mini|\
|
|
bananapi,bpi-r4|\
|
|
bananapi,bpi-r4-2g5|\
|
|
bananapi,bpi-r4-poe|\
|
|
bananapi,bpi-r4-lite|\
|
|
bazis,ax3000wm|\
|
|
cmcc,a10-ubootmod|\
|
|
cmcc,rax3000m|\
|
|
comfast,cf-wr632ax-ubootmod|\
|
|
cudy,tr3000-v1-ubootmod|\
|
|
cudy,wbr3000uax-v1-ubootmod|\
|
|
cudy,wr3000e-v1-ubootmod|\
|
|
cudy,wr3000s-v1-ubootmod|\
|
|
cudy,wr3000h-v1-ubootmod|\
|
|
cudy,wr3000p-v1-ubootmod|\
|
|
gatonetworks,gdsp|\
|
|
h3c,magic-nx30-pro|\
|
|
imou,hx21|\
|
|
jcg,q30-pro|\
|
|
jdcloud,re-cp-03|\
|
|
konka,komi-a31|\
|
|
mediatek,mt7981-rfb|\
|
|
mediatek,mt7988a-rfb|\
|
|
mercusys,mr90x-v1-ubi|\
|
|
netis,nx30v2|\
|
|
netis,nx31|\
|
|
netis,nx32u|\
|
|
nokia,ea0326gmp|\
|
|
openwrt,one|\
|
|
netcore,n60|\
|
|
netcore,n60-pro|\
|
|
qihoo,360t7|\
|
|
routerich,ax3000-ubootmod|\
|
|
routerich,be7200|\
|
|
snr,snr-cpe-ax2|\
|
|
tplink,tl-xdr4288|\
|
|
tplink,tl-xdr6086|\
|
|
tplink,tl-xdr6088|\
|
|
tplink,tl-xtr8488|\
|
|
xiaomi,mi-router-ax3000t-ubootmod|\
|
|
xiaomi,redmi-router-ax6000-ubootmod|\
|
|
xiaomi,mi-router-wr30u-ubootmod|\
|
|
zyxel,ex5601-t0-ubootmod|\
|
|
zyxel,wx5600-t0-ubootmod)
|
|
fit_do_upgrade "$1"
|
|
;;
|
|
acer,predator-w6|\
|
|
acer,predator-w6d|\
|
|
acer,vero-w6m|\
|
|
airpi,ap3000m|\
|
|
arcadyan,mozart|\
|
|
glinet,gl-mt2500|\
|
|
glinet,gl-mt2500-airoha|\
|
|
glinet,gl-mt6000|\
|
|
glinet,gl-x3000|\
|
|
glinet,gl-xe3000|\
|
|
huasifei,wh3000|\
|
|
huasifei,wh3000-pro-emmc|\
|
|
smartrg,sdg-8612|\
|
|
smartrg,sdg-8614|\
|
|
smartrg,sdg-8622|\
|
|
smartrg,sdg-8632|\
|
|
smartrg,sdg-8733|\
|
|
smartrg,sdg-8733a|\
|
|
smartrg,sdg-8734)
|
|
CI_KERNPART="kernel"
|
|
CI_ROOTPART="rootfs"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
asus,rt-ax52|\
|
|
asus,rt-ax57m|\
|
|
asus,rt-ax59u|\
|
|
asus,tuf-ax4200|\
|
|
asus,tuf-ax4200q|\
|
|
asus,tuf-ax6000|\
|
|
asus,zenwifi-bt8)
|
|
CI_UBIPART="UBI_DEV"
|
|
CI_KERNPART="linux"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
buffalo,wsr-6000ax8|\
|
|
cudy,wr3000h-v1|\
|
|
cudy,wr3000p-v1|\
|
|
huasifei,wh3000-pro-nand)
|
|
CI_UBIPART="ubi"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
cudy,re3000-v1|\
|
|
cudy,wr3000-v1|\
|
|
kebidumei,ax3000-u22|\
|
|
totolink,x6000r|\
|
|
wavlink,wl-wn573hx3|\
|
|
widelantech,wap430x|\
|
|
yuncore,ax835)
|
|
default_do_upgrade "$1"
|
|
;;
|
|
dlink,aquila-pro-ai-e30-a1|\
|
|
dlink,aquila-pro-ai-m30-a1|\
|
|
dlink,aquila-pro-ai-m60-a1)
|
|
fw_setenv sw_tryactive 0
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
elecom,wrc-x3000gs3)
|
|
local bootnum="$(mstc_rw_bootnum)"
|
|
case "$bootnum" in
|
|
1|2)
|
|
CI_UBIPART="ubi$bootnum"
|
|
[ -z "$(find_mtd_index $CI_UBIPART)" ] &&
|
|
CI_UBIPART="ubi"
|
|
;;
|
|
*)
|
|
v "invalid bootnum found ($bootnum), rebooting..."
|
|
nand_do_upgrade_failed
|
|
;;
|
|
esac
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
mercusys,mr80x-v3|\
|
|
mercusys,mr85x|\
|
|
mercusys,mr90x-v1|\
|
|
tplink,archer-ax80-v1|\
|
|
tplink,archer-ax80-v1-eu|\
|
|
tplink,be450|\
|
|
tplink,re6000xd)
|
|
CI_UBIPART="ubi0"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
netgear,eax17)
|
|
echo "UPGRADING SECOND SLOT"
|
|
CI_KERNPART="kernel2"
|
|
CI_ROOTPART="rootfs2"
|
|
nand_do_flash_file "$1" || nand_do_upgrade_failed
|
|
echo "UPGRADING PRIMARY SLOT"
|
|
CI_KERNPART="kernel"
|
|
CI_ROOTPART="rootfs"
|
|
nand_do_flash_file "$1" || nand_do_upgrade_failed
|
|
nand_do_upgrade_success
|
|
;;
|
|
tplink,fr365-v1)
|
|
CI_UBIPART="ubi"
|
|
CI_KERNPART="kernel"
|
|
CI_ROOTPART="rootfs"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
teltonika,rutc50)
|
|
CI_UBIPART="$(cmdline_get_var ubi.mtd)"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
nradio,c8-668gl)
|
|
CI_DATAPART="rootfs_data"
|
|
CI_KERNPART="kernel_2nd"
|
|
CI_ROOTPART="rootfs_2nd"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
ubnt,unifi-6-plus)
|
|
CI_KERNPART="kernel0"
|
|
EMMC_ROOT_DEV="$(cmdline_get_var root)"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
unielec,u7981-01*)
|
|
local rootdev="$(cmdline_get_var root)"
|
|
rootdev="${rootdev##*/}"
|
|
rootdev="${rootdev%p[0-9]*}"
|
|
case "$rootdev" in
|
|
mmc*)
|
|
CI_ROOTDEV="$rootdev"
|
|
CI_KERNPART="kernel"
|
|
CI_ROOTPART="rootfs"
|
|
emmc_do_upgrade "$1"
|
|
;;
|
|
*)
|
|
CI_KERNPART="fit"
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
esac
|
|
;;
|
|
xiaomi,mi-router-ax3000t|\
|
|
xiaomi,mi-router-wr30u-stock|\
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
CI_KERN_UBIPART=ubi_kernel
|
|
CI_ROOT_UBIPART=ubi
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
*)
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
PART_NAME=firmware
|
|
|
|
platform_check_image() {
|
|
local board=$(board_name)
|
|
|
|
[ "$#" -gt 1 ] && return 1
|
|
|
|
case "$board" in
|
|
abt,asr3000|\
|
|
acer,predator-w6x-ubootmod|\
|
|
asus,zenwifi-bt8-ubootmod|\
|
|
bananapi,bpi-r3|\
|
|
bananapi,bpi-r3-mini|\
|
|
bananapi,bpi-r4|\
|
|
bananapi,bpi-r4-2g5|\
|
|
bananapi,bpi-r4-poe|\
|
|
bananapi,bpi-r4-lite|\
|
|
bazis,ax3000wm|\
|
|
cmcc,a10-ubootmod|\
|
|
cmcc,rax3000m|\
|
|
comfast,cf-wr632ax-ubootmod|\
|
|
cudy,tr3000-v1-ubootmod|\
|
|
cudy,wbr3000uax-v1-ubootmod|\
|
|
cudy,wr3000e-v1-ubootmod|\
|
|
cudy,wr3000s-v1-ubootmod|\
|
|
cudy,wr3000h-v1-ubootmod|\
|
|
cudy,wr3000p-v1-ubootmod|\
|
|
gatonetworks,gdsp|\
|
|
h3c,magic-nx30-pro|\
|
|
jcg,q30-pro|\
|
|
jdcloud,re-cp-03|\
|
|
konka,komi-a31|\
|
|
mediatek,mt7981-rfb|\
|
|
mediatek,mt7988a-rfb|\
|
|
mercusys,mr90x-v1-ubi|\
|
|
nokia,ea0326gmp|\
|
|
netis,nx32u|\
|
|
openwrt,one|\
|
|
netcore,n60|\
|
|
qihoo,360t7|\
|
|
routerich,ax3000-ubootmod|\
|
|
tplink,tl-xdr4288|\
|
|
tplink,tl-xdr6086|\
|
|
tplink,tl-xdr6088|\
|
|
tplink,tl-xtr8488|\
|
|
xiaomi,mi-router-ax3000t-ubootmod|\
|
|
xiaomi,redmi-router-ax6000-ubootmod|\
|
|
xiaomi,mi-router-wr30u-ubootmod|\
|
|
zyxel,ex5601-t0-ubootmod)
|
|
fit_check_image "$1"
|
|
return $?
|
|
;;
|
|
creatlentem,clt-r30b1|\
|
|
creatlentem,clt-r30b1-112m|\
|
|
nradio,c8-668gl)
|
|
# tar magic `ustar`
|
|
magic="$(dd if="$1" bs=1 skip=257 count=5 2>/dev/null)"
|
|
|
|
[ "$magic" != "ustar" ] && {
|
|
echo "Invalid image type."
|
|
return 1
|
|
}
|
|
|
|
return 0
|
|
;;
|
|
*)
|
|
nand_do_platform_check "$board" "$1"
|
|
return $?
|
|
;;
|
|
esac
|
|
|
|
return 0
|
|
}
|
|
|
|
platform_copy_config() {
|
|
case "$(board_name)" in
|
|
bananapi,bpi-r3|\
|
|
bananapi,bpi-r3-mini|\
|
|
bananapi,bpi-r4|\
|
|
bananapi,bpi-r4-2g5|\
|
|
bananapi,bpi-r4-poe|\
|
|
bananapi,bpi-r4-lite|\
|
|
cmcc,rax3000m|\
|
|
gatonetworks,gdsp|\
|
|
mediatek,mt7988a-rfb)
|
|
if [ "$CI_METHOD" = "emmc" ]; then
|
|
emmc_copy_config
|
|
fi
|
|
;;
|
|
acer,predator-w6|\
|
|
acer,predator-w6d|\
|
|
acer,vero-w6m|\
|
|
airpi,ap3000m|\
|
|
arcadyan,mozart|\
|
|
glinet,gl-mt2500|\
|
|
glinet,gl-mt2500-airoha|\
|
|
glinet,gl-mt6000|\
|
|
glinet,gl-x3000|\
|
|
glinet,gl-xe3000|\
|
|
huasifei,wh3000|\
|
|
huasifei,wh3000-pro-emmc|\
|
|
jdcloud,re-cp-03|\
|
|
nradio,c8-668gl|\
|
|
smartrg,sdg-8612|\
|
|
smartrg,sdg-8614|\
|
|
smartrg,sdg-8622|\
|
|
smartrg,sdg-8632|\
|
|
smartrg,sdg-8733|\
|
|
smartrg,sdg-8733a|\
|
|
smartrg,sdg-8734|\
|
|
ubnt,unifi-6-plus)
|
|
emmc_copy_config
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_pre_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
asus,rt-ax52|\
|
|
asus,rt-ax57m|\
|
|
asus,rt-ax59u|\
|
|
asus,tuf-ax4200|\
|
|
asus,tuf-ax4200q|\
|
|
asus,tuf-ax6000|\
|
|
asus,zenwifi-bt8)
|
|
asus_initial_setup
|
|
;;
|
|
buffalo,wsr-6000ax8)
|
|
buffalo_initial_setup
|
|
;;
|
|
xiaomi,mi-router-ax3000t|\
|
|
xiaomi,mi-router-wr30u-stock|\
|
|
xiaomi,redmi-router-ax6000-stock)
|
|
xiaomi_initial_setup
|
|
;;
|
|
esac
|
|
}
|