本文最后更新于:15 分钟前
刷机有风险,请谨慎刷机
Redmi ac2100刷openwrt指南
编译固件
参考网址
基础设置
我是在云服务器上编译的,用的hetzner 的cpx21,编译花了大概1个小时,花了不到0.5欧,折合人民币约3元。
我觉得大可直接看lede仓库说明,可能时间一久命令就不对了。只要知道这一步在做什么,下一步该做什么就好。
首先安装依赖
1 2 3 4 5 6 7 8 sudo apt update -ysudo apt full-upgrade -ysudo apt install -y ack antlr3 aria2 asciidoc autoconf automake autopoint binutils bison build-essential \bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \git gperf haveged help2 man intltool libc6 -dev-i386 libelf-dev libglib2 .0 -dev libgmp3 -dev libltdl-dev \libmpc -dev libmpfr-dev libncurses5 -dev libncursesw5 -dev libreadline-dev libssl-dev libtool lrzsz \mkisofs msmtp nano ninja-build p7 zip p7 zip-full patch pkgconf python2 .7 python3 python3 -pip libpython3 -dev qemu-utils \rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1 g-dev
安装lede
1 git clone https://gi thub.com/coolsnowwolf/ lede
添加依赖
编辑lede/feeds.conf.default
添加
1 2 src-git kenzo https://gi thub.com/kenzok8/ openwrt-packages src-git small https://gi thub.com/kenzok8/ small
运行
1 2 3 ./scripts/ feeds update -a ./scripts/ feeds install -a make menuconfig
配置config文件
黑色是推荐勾选,但重要的是明白自己需要什么,再勾选什么。自己需要的 *,可能需要的,比较热门的 M
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Target System: MediaTek Ralink MIPS Subtarget: MT7621 based boards Target Profile: Xiaomi Redmi Router AC2100 Target Images: squashfs, Kernel partition size 4 , Root filesystem partition size 117 Global build setting: IPV6 Base system: build with DHCPv6 support, build with ipset support. Administration: htop Extra packages: ipv6helper luci: Collections: luci Modules: translation (english and chinese), luci-compat, luci-mod-dashboard Applications: adwancedsetting, ahcp, attendedsysupgrade, commands, ddns, filetransfer, firewall, frpc, frps, nps, openclash, opkg, passwall, upnp, wol, ssr-plus, zerotier Themes: argon Protocols: ipv6, ppp, wireguard network: VPN: xl2tpd Firewall: ip6tables SSH: openssh Project v: v2ey Utilities: Editors: vim-full Shells: bash
编译
保存好.config
文件后就可以编译了,lede说第一次编译用单线程,我自己用的多线程
1 2 make download -j8make V=s -j$(nproc)
编译完成后输出路径:bin/targets
~~我这边是把整个lede文件夹都拷贝到了本地,上传到github, 百度网盘,onedrive什么地方,方便下次编译。~~太麻烦了,现在我选择从零编译。
然后记得删除仓库,hz是按时收费,你干完后就可以删服务器跑路了。要是忘了…
刷入固件
准备工作
路由器wan口连网,lan连电脑。
找到符合你需求的openwrt,不知道自己需要什么的可以考虑https://vvmi.net/archives/openwrt-ac2100/提供的固件。
下载https://www.right.com.cn/forum/thread-8256657-1-1.html中提供的breed。
下载https://www.right.com.cn/forum/thread-4054150-1-1.html提供的部件。我在校园网环境下刷入时,无法连接外网,因此要提前下载。
刷入breed
按https://www.right.com.cn/forum/thread-4054150-1-1.html的步骤,严格按照要求操作,刷入breed。刷入的breed不是提供的版本,而是上面下载的版本。我在使用该贴版本时输入openwrt时遇到问题,breed的中的环境变量有数十条而非某些贴子中的空白。
刷入openwrt
按照教程https://www.right.com.cn/forum/thread-4025861-1-1.html刷入你的openwrt。注意刷完临时固件后电脑连接lan口(wan口也许需要连接网络),才能打开openwrt。然后刷你想要的固件。通常系统蓝灯常亮,网络蓝灯闪烁表示openwrt正常运行,这时可以打开web端。
补充
PC用网线连路由器LAN,设置为自动获取IP。路由器断电,按住reset,插入路由器电源(不松开reset)。保持按住reset 5秒左右,路由器灯闪松开reset。PC网卡获取到192.168.1.x的地址 (如未获取到手工设置)
浏览器访问 192.168.1.1,接着你就会看到一个uboot控制台的界面