OpenWrt on Xiaomi Mini Router

前几天把小米路由器(青春版)改造了, 今天来改造小米路由器(迷你版).

远程登录

# ssh root@192.168.31.1
$ cat /proc/mtd
dev:    size   erasesize  name  
mtd0: 01000000 00010000 "ALL"  
mtd1: 00030000 00010000 "Bootloader"  
mtd2: 00010000 00010000 "Config"  
mtd3: 00010000 00010000 "Factory"  
mtd4: 00c80000 00010000 "OS1"  
mtd5: 00b11e37 00010000 "rootfs"  
mtd6: 00200000 00010000 "OS2"  
mtd7: 00100000 00010000 "overlay"  
mtd8: 00010000 00010000 "crash"  
mtd9: 00010000 00010000 "reserved"  
mtd10: 00010000 00010000 "Bdata"  

下载固件

$ cd /tmp/
$ wget http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7620/openwrt-15.05.1-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin
$ wget -qO- http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7620/md5sums | grep xiaomi | md5sum -c
openwrt-15.05.1-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin: OK  

写入固件

$ mtd -r write openwrt-15.05.1-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin OS1
Unlocking OS1 ...  
Writing from openwrt-15.05.1-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin to OS1 ...  
Rebooting ...  

关键时刻

  • 等待几分钟, 指示灯变红
  • 但是没有发现Wi-Fi信号
  • 网线连接LAN口, 自动获取IP
  • 浏览器打开 http://192.168.1.1
  • 启用Wi-Fi(两个), 发现OpenWrt了
  • 设置root密码后, 用SSH登录
root@OpenWrt:~# free  
             total         used         free       shared      buffers
Mem:        126372        25104       101268          568         2216  
-/+ buffers:              22888       103484
Swap:            0            0            0  
root@OpenWrt:~# df -h  
Filesystem                Size      Used Available Use% Mounted on  
rootfs                   12.1M    472.0K     11.7M   4% /  
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    61.7M    512.0K     61.2M   1% /tmp  
tmpfs                    61.7M     56.0K     61.6M   0% /tmp/root  
tmpfs                   512.0K         0    512.0K   0% /dev  
/dev/mtdblock6           12.1M    472.0K     11.7M   4% /overlay
overlayfs:/overlay       12.1M    472.0K     11.7M   4% /