遇到的问题:

  • 编译出现 dnsmasq 相关错误 直接在编译选项 base system里 去掉dnsmasq. 参考
  • upx 文件找不到 which upx; cp upx upx-cul; 参考

部署环境及依赖,可以参考lede的方式

sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
git clone https://github.com/openwrt/openwrt;
cd openwrt;
./scripts/feeds update -a
./scripts/feeds install -a 

feeds.conf.default 可以增加其他组件

src-git packages https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
src-git telephony https://git.openwrt.org/feed/telephony.git
src-git freifunk https://github.com/freifunk/openwrt-packages.git
#src-git video https://github.com/openwrt/video.git
#src-git targets https://github.com/openwrt/targets.git
#src-git management https://github.com/openwrt-management/packages.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed

src-git xiaorouji https://github.com/xiaorouji/openwrt-passwall
src-git openclash https://github.com/vernesong/openclash
src-git accessControl https://github.com/Aslin-Ameng/luci-app-access-control
src-git kenzo https://github.com/kenzok8/openwrt-packages

设置编译固件的平台,以及组件

make menuconfig
make -j$(($(nproc) + 1)) V=s

小米/红米 AC2100 编译参数 MediaTek Ralink MIPS, MT7621 based boards, Xiaomi ***Mi Router Ac2100 极路由4增强版 编译参数 MediaTek Ralink MIPS, MT7621 based boards, Hiwifi HC5962

极路由4增强版 直接通过 breed web 界面直接刷入编译出来的 *factory.bin 固件。