编译过程
第一次编译
Lean 大的仓库下,已经把过程写的很清楚,小白如果没有添加太多的 luci app,导致依赖有冲突,基本上都可一次成功。原文可以在仓库看到。
以下是根据 Lean 大,Vernesong 和 Lienol 仓库的介绍,将 Openclash 和 Passwal 的源加入原版 lede,并进行编译。
2020 年 8 月 19 日更新加入了其他一些比较有用的组件
首先要注意:
- 不要用 root 用户 git 和编译!!!
- 国内用户编译前最好准备好梯子
- 默认登陆IP 192.168.1.254, 密码 password
- 2020年9月10日起固件默认登录IP更改为 192.168.1.254 默认密码不变
编译过程如下:
首先装好 Ubuntu 64bit,推荐 Ubuntu 14 LTS x64
1 2 3 4 |
sudo apt-get update 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 swig rsync git clone https://github.com/coolsnowwolf/lede #下载源代码 cd lede #进入目录 |
将Lienol的Passwall加入编译源
1 2 3 4 |
vi feeds.conf.default #将以下加入至最后一行 src-git lienol https://github.com/xiaorouji/openwrt-passwall ESC :wq Enter #编辑完成后vim的保存并退出命令 |
手动Clone vernesong的OpenClash项目
1 2 3 4 5 6 7 8 |
mkdir package/luci-app-openclash cd package/luci-app-openclash git init git remote add -f origin https://github.com/vernesong/OpenClash.git git config core.sparsecheckout true echo "luci-app-openclash" >> .git/info/sparse-checkout git pull origin master git branch --set-upstream-to=origin/master master |
手动Clone vssr[Hello World]项目
1 2 |
cd /home/user/lede/package/lean/ && git clone https://github.com/jerrykuku/lua-maxminddb.git #git lua-maxminddb依赖 git clone https://github.com/jerrykuku/luci-app-vssr.git |
手动Clone luci-theme-argon魔改主题
1 2 3 |
cd /home/user/lede/package/lean rm -rf luci-theme-argon git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git |
手动Clone 京东多合一签到脚本luci-app-jd-dailybonus
2021 年 1 月,Lean 大仓库已 fork 了该脚本,不需要再自行添加。如需自行添加,可以参考如下旧的笔记。
1 2 3 4 5 6 |
cd /home/user/lede/package/lean/ git clone https://github.com/jerrykuku/node-request.git #git node-request 依赖 git clone https://github.com/jerrykuku/luci-app-jd-dailybonus.git make menuconfig #Check LUCI->Applications->luci-app-jd-dailybonus make package/lean/node-request/compile V=s #单独编译node-request 依赖 make package/lean/luci-app-jd-dailybonus/compile V=s #单独编译luci-app-jd-dailybonus |
手动Clone 行为管控
1 2 3 4 5 6 7 |
cd /home/user/lede/package git clone https://github.com/destan19/OpenAppFilter.git cd .. #在lede中编译,需要去除加速模块,可以直接删除或者make menuconfig不编译加速模块 rm package/lean/luci-app-flowoffload -fr rm package/lean/shortcut-fe/ -fr rm package/lean/luci-app-sfe/ -fr |
手动clone Dockerman
1 |
cd /home/user/lede/package/lean/ && git clone https://github.com/lisaac/luci-app-dockerman.git |
更新及安装软件源
1 2 |
cd /home/user/lede ./scripts/feeds update -a && ./scripts/feeds install -a |
固件配置
1 |
make menuconfig |
进去以后很多选项可能会一脸懵逼,我上传一份我自己的配置,机型是 X64,我给我的固件取了个名字 -“什么都有”。
修改固件IP(可选项)
1 2 |
cd /home/user/lede nano package/base-files/files/bin/config_generate |
在如下位置,将默认的 192.168.1.1 更改为所需要的 IP

正式编译
1 2 |
make -j8 download V=s #下载dl库,国内请尽量全局科学上网 make -j1 V=s # -j1后面数字1是线程数。第一次编译推荐用单线程,即可开始编译你要的固件了。 |
第一次编译大约需要 4 至 6 小时,请耐心等待。
更新编译
在经过第一次编译后,以后再编译就比较简单且时间也会缩短至一小时内
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
cd lede #进入LEDE目录 git pull #同步更新大雕源码 cd package/luci-app-openclash && git pull #进入OpenClash目录并更新源码 cd /home/user/lede/package/lean/luci-app-vssr && git pull #进入luci-app-vssr目录并更新源码 cd /home/user/lede/package/lean/luci-theme-argon && git pull #进入luci-theme-argon目录并更新源码 cd /home/user/lede/package/lean/luci-app-jd-dailybonus && git pull #进入luci-app-jd-dailybonus目录并更新源码 cd /home/user/lede/package/OpenAppFilter && git pull #进入OpenAppFilter目录并更新源码 cd /home/user/lede/package/lean/luci-app-dockerman && git pull #进入Dockerman目录并更新源码 cd /home/user/lede #退回到lede目录 ./scripts/feeds update -a && ./scripts/feeds install -a #更新FEEDS #如有固件有大版本升级,建议清除编译配置和缓存;如无可跳过此步 rm -rf ./tmp && rm -rf .config #进入编译配置菜单 make menuconfig #n=线程数+1,例如4线程的I5填-j5,开始编译 make -j1 V=s |
Lienol Passwall (2020 年 5 月 1 日更新)
由于不可描述原因,Lienol 的 Passwall 已经不再公开源码,以后的编译,也不会自带 Passwall 插件,需要的可以在下面的成品分享中找到单独的 ipk,进行自行安装。分享中,上传的 passwall 版本为 “luci-app-passwall_3.6-41_all.ipk”.
编译完之后,openclash还需要安装内核。可以直接运行更新。也可以手工上传。
注意 下载下来的文件解压 然后根据提示改名
dev 路径为 内核路径:/etc/openclash/core/clash clash为文件名
tun 路径为 内核路径:/etc/openclash/core/clash_tun clash_tun为文件名
软路由为intel的CPU时候,选择AMDX86-64这个内核
上传文件 Xshell
lrzsz是一个下使用zmodem协议的档案传输工具,Xshell支持此功能,服务器端安装lrzsz通过ssh连接可快速上传下载文件。
OpenWRT下lrzsz安装:
1
2
3
4
|
opkg update opkg install lrzsz ln -s /usr/bin/lrz /usr/bin/rz ln -s /usr/bin/lsz /usr/bin/sz |