1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 10:49:13 +02:00
openwrt/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
Emir Efe Kucuk 53a1fede1f ramips: Add support for Xiaomi Mi Router(Black,R2100)
The Xiaomi Mi Router AC2100 is a *black* cylindrical router that shares many
characteristics (apart from its looks and the GPIO ports) with the 6-antenna
*white* "Xiaomi Redmi Router AC2100"

See the visual comparison of the two routers here:
https://github.com/emirefek/openwrt-R2100/raw/imgcdn/rm2100-r2100.jpg

Specification of R2100:
- CPU: MediaTek MT7621A
- RAM: 128 MB DDR3
- FLASH: 128 MB ESMT NAND
- WIFI: 2x2 802.11bgn (MT7603)
- WIFI: 4x4 802.11ac (MT7615)
- ETH: 3xLAN+1xWAN 1000base-T
- LED: Power, WAN in Yellow and Blue
- UART: On board (Don't know where is should be confirmed by anybody else)
- Modified u-boot

Hacking of official firmware process is same at both RM2100 and R2100.
Thanks to @namidairo

Here is the detailed guide Hack: https://github.com/impulse/ac2100-openwrt-guide
Guide is written for MacOS but it will work at linux.
needed packages: python3(with scapy), netcat, http server, telnet client

1. Run PPPoE&exploit to get nc and wget busybox, get telnet and wget firmware
2. mtd write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-kernel1.bin kernel1
3. nvram set uart_en=1
4. nvram set bootdelay=5
5. nvram set flag_try_sys1_failed=1
6. nvram commit
7. mtd -r write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-rootfs0.bin rootfs0

other than these I specified in here. Everything is same with:
f3792690c4
Thanks for all community and especially for this device:
@Ilyas @scp07 @namidairo @Percy @thorsten97 @impulse (names@forum.openwrt.com)

MAC Locations:
WAN *:b5 = factory 0xe006
LAN *:b6 = factory 0xe000
WIFI 5ghz *:b8 = factory 0x8004
WIFI 2.4ghz *:b7 = factory 0x0004

Signed-off-by: Emir Efe Kucuk <emirefek@gmail.com>
[refactored common image bits into Device/xiaomi-ac2100, fixed From:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-07-08 16:07:05 +02:00

79 lines
1.6 KiB
Bash
Executable File

#
# Copyright (C) 2010 OpenWrt.org
#
PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='fw_printenv fw_setenv'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
platform_check_image() {
return 0
}
platform_do_upgrade() {
local board=$(board_name)
case "$board" in
alfa-network,quad-e4g)
[ "$(fw_printenv -n dual_image 2>/dev/null)" = "1" ] &&\
[ -n "$(find_mtd_part backup)" ] && {
PART_NAME=backup
if [ "$(fw_printenv -n bootactive 2>/dev/null)" = "1" ]; then
fw_setenv bootactive 2 || exit 1
else
fw_setenv bootactive 1 || exit 1
fi
}
;;
mikrotik,routerboard-750gr3|\
mikrotik,routerboard-m11g|\
mikrotik,routerboard-m33g)
[ -z "$(rootfs_type)" ] && mtd erase firmware
;;
asus,rt-ac65p|\
asus,rt-ac85p)
echo "Backing up firmware"
dd if=/dev/mtd4 bs=1024 count=4096 > /tmp/backup_firmware.bin
dd if=/dev/mtd5 bs=1024 count=52224 >> /tmp/backup_firmware.bin
mtd -e firmware2 write /tmp/backup_firmware.bin firmware2
;;
esac
case "$board" in
asus,rt-ac65p|\
asus,rt-ac85p|\
hiwifi,hc5962|\
linksys,ea7500-v2|\
netgear,r6220|\
netgear,r6260|\
netgear,r6350|\
netgear,r6700-v2|\
netgear,r6800|\
netgear,r6850|\
netgear,wac104|\
netgear,wac124|\
netis,wf2881|\
xiaomi,mi-router-ac2100|\
xiaomi,mir3g|\
xiaomi,mir3p|\
xiaomi,redmi-router-ac2100)
nand_do_upgrade "$1"
;;
iodata,wn-ax1167gr2|\
iodata,wn-ax2033gr|\
iodata,wn-dx1167r)
iodata_mstc_upgrade_prepare
nand_do_upgrade "$1"
;;
ubnt,edgerouter-x|\
ubnt,edgerouter-x-sfp)
platform_upgrade_ubnt_erx "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}