【OpenWrt】小米路由器mini刷OpenWRT

Posted by 西维蜀黍 on 2019-01-30, Last Modified on 2021-09-21

刷小米官方开发版ROM

从http://www.miwifi.com/miwifi_download.html ,下载并刷入小米官方开发版ROM。

刷SSH以获得root权限

刷入小米官方开发版ROM(miwifi_r1cm_firmware_2e9b9_2.21.109.bin)后,获取SSH权限(期间需要下载一个miwifi_ssh.bin工具包,并通过U盘写入路由器)。

刷OpenWrt

下载OpenWrt

从downloads.openwrt.org,下载最新的OpenWrt ROM,当前(2019.1.29)最新的OpenWrt版本为18.06.1。

下载地址:https://downloads.openwrt.org/releases/18.06.1/targets/ramips/mt7620/openwrt-18.06.1-ramips-mt7620-miwifi-mini-squashfs-sysupgrade.bin。

scp 以将.bin到路由器

刷入镜像

使用 mtd 刷入镜像

mtd -r write /tmp/openwrt|pandorabox|lede.bin firmware

如遇以下报错,改 firmwareOS1 即可。

Could not open mtd device: firmware
Can't open device for writing!

到这里,等待刷入镜像,路由器自动重启,过一会才能登录。

注意!!!当系统安装完成后, LEDE 的指示灯是红色的,我在刷完之后,以为路由器显示红色指示灯,是因为成砖了,折腾了半天(事实上已经OpenWrt安装完成了)

而且刷完系统默认不开启无线网络,需要用网线连接到 LAN 口。

总结一句,千万注意刷完后,别管路由器的灯。而直接用网线将PC与路由器相连。

原始的opkg源配置

root@OpenWrt:~# cat /etc/opkg/distfeeds.conf
src/gz openwrt_core http://downloads.openwrt.org/releases/18.06.1/targets/ramips/mt7620/packages
src/gz openwrt_base http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/base
src/gz openwrt_luci http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/luci
src/gz openwrt_packages http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/packages
src/gz openwrt_routing http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/routing
src/gz openwrt_telephony http://downloads.openwrt.org/releases/18.06.1/packages/mipsel_24kc/telephony

我们更新为中科大的库:

root@OpenWrt:~# cat /etc/opkg/distfeeds.conf
src/gz openwrt_core http://mirrors.ustc.edu.cn/lede/releases/18.06.1/targets/ramips/mt7620/packages
src/gz openwrt_base http://mirrors.ustc.edu.cn/lede/releases/18.06.1/packages/mipsel_24kc/base
src/gz openwrt_luci http://mirrors.ustc.edu.cn/lede/releases/18.06.1/packages/mipsel_24kc/luci
src/gz openwrt_packages http://mirrors.ustc.edu.cn/lede/releases/18.06.1/packages/mipsel_24kc/packages
src/gz openwrt_routing http://mirrors.ustc.edu.cn/lede/releases/18.06.1/packages/mipsel_24kc/routing
src/gz openwrt_telephony http://mirrors.ustc.edu.cn/lede/releases/18.06.1/packages/mipsel_24kc/telephony

Reference