UPDATE: 20200707
准备
*基于Lean`s源: https://github.com/coolsnowwolf/lede
*添加被删除的回退源: https://github.com/kenzok8/openwrt-packages
*编译前准备好梯子
*不要用root来git和编译
*默认IP: 192.168.1.1, 密码: password
*Ubuntu 18.04 LTS 64bit
开工
- 安装更新:
sudo apt-get update
- 安装环境工具:
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3.5 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 swig
- Git源码目录:
git clone https://github.com/coolsnowwolf/lede
cd lede
编译passwall & ss-plus:
cd package
git clone https://github.com/kenzok8/openwrt-packages.git
git clone https://github.com/kenzok8/small.git
git clone https://github.com/OpenWrt-Actions/OpenWrt-Packages
cd ..
如需编译内核:
make target/linux/compile V=s
如需切换内核:
/home/nonni/lede/target/linux/x86/Makefile
KERNEL_PATCHVER:=4.19
具体支持内核版本可查:include/kernel-version.mk
更新feeds:
./scripts/feeds clean ./scripts/feeds update -a ./scripts/feeds install -a
如果出现 feeds update 警告:
rm -rf ./feeds
删掉 feeds 文件夹后再UPDATE:
git pull
./scripts/feeds clean && ./scripts/feeds update -a && ./scripts/feeds install -a
- 预下载编译:
make defconfig
make -j8 download
选择Soc,<*>编译进固件,<m>编译不进固件,确定路由配置
预下载dl库可以避免下载造成的编译失败
编译冲突,配置还原到初始状态命令:
rm -f .config && rm -f .config.old
rm -rf ./tmp && rm -rf .config
- 编译菜单:
make menuconfig
- 开始编译
make -j1 V=s
-j1 后面是线程数,推荐单线程编译。
或:
make -j$(($(nproc) + 1)) V=s
GoodLuck!