在历尽艰辛攒了一个基于联想 M73 Tiny 小主机的软路由后,需要选择一个软路由系统。
在 RouterOS 和 OpenWRT 中最终选择了 OpenWRT 作为软路由的发行版,一来是开源自由度高一些,二来是免费使用的,无需使用授权破解等繁杂操作。
OpenWRT 除了官方版本外,还有两个常用分支,KoolShare 版和 Lean 版两个分支,在考虑稳定性等多方面因素后选择 Lean 版,文章后续为了简化描述,都简称为 L 版。
- 官方仓库:GitHub
更新
- 20220530 更新官方系统版本说明
构建
仓库中实际上已经有编译及使用的方法,对于熟悉 Linux 系统的用户来说,实际动手编译几遍即可对其有个较为深入的了解。
1.环境准备
推荐 Debian 11 或 Ubuntu LTS
小贴士:一定要在支持科学上网的环境内安装,虚拟机物理机皆可,如果实在没有可供科学上网的环境,可以考虑购买一个海外的服务器来进行编译,一定要选购硬盘大的,或者可以添加额外磁盘的。2.安装依赖
sudo apt update -y sudo apt full-upgrade -y sudo apt install -y ack antlr3 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 help2man 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 p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip qemu-utils \ rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
3.克隆源码(务必用普通用户)
git clone https://github.com/coolsnowwolf/lede
4.更新安装插件(记得取消
feeds.conf.default
文件内的helloworld
行前注释 )./scripts/feeds update -a ./scripts/feeds install -a make menuconfig
5.下载dl库(用于交叉编译,必须全局科学上网)
make -j8 download V=s
6.编译(
-j
后面是线程数。第一次编译务必用单线程进行编译)make -j1 V=s
补充

▲ 在 Target Images
中修改 Kernel partition size (in MB)
数值为 32 ,默认内核(引导)分区大小,适当增大可以优化更新内核流程。

▲ 在 Global build settings
中勾选 Select all kernel module packages by default
默认编译全部内核模块,这样防止安装额外的包时出现内核不支持的现象。
最后在 Luca 中勾选需要编译的程序即可。
常见问题
a) 部署常用包
opkg install luci-i18n-firewall-zh-cn
opkg install luci-i18n-base-zh-cn
opkg install luci-i18n-opkg-zh-cn
opkg install luci-i18n-upnp-zh-cn
opkg install kmod-tcp-bbr kmod-tcp-hybla
# 挂载点
opkg install block-mount
# 分区
opkg install cfdisk
opkg install vim open-vm-tools ss rng-tools luci-compat
opkg install kmod-tcp-scalable
sysctl net.ipv4.tcp_available_congestion_control
opkg install kmod-fs-btrfs
opkg install kmod-fs-exfat
opkg install kmod-fs-xfs
opkg install luci-lib-ipkg
# https://github.com/jerrykuku/luci-theme-argon/issues/151
opkg install adguardhome
# https://openwrt.org/docs/guide-user/services/dns/adguard-home
附录
参考链接
本文由 柒 创作,采用 知识共享署名4.0
国际许可协议进行许可。
转载本站文章前请注明出处,文章作者保留所有权限。
最后编辑时间: 2020-09-22 01:11 AM
来自尊贵的 MacBook Pro 16 的留言
简单测试下邮件系统