@byxiaoxie2 年前

05/18
17:57
Home

OpenWrt Passwall2 编译教程

声明:转载请带上文章作者[ByXiaoXie] 本教程不提供编译好的软件包下载,如果本教程有违反法律等行为,请联系站长进行删除 谢谢!
PassWall 编译教程:https://www.byxiaoxie.com/?p=629
虚拟机系统 Ubuntu 20.04.1 硬盘80G 内存4G (ubuntu编译不可用root!)

使用[Lienol]的[OpenWrt]编译固件

OpenWrt:https://github.com/Lienol/openwrt
安装编译环境和下载源代码
Ubuntu:
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3.5 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex quilt uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf
下载源码并添加Feeds源
git clone -b 21.02 --single-branch https://github.com/Lienol/openwrt openwrt
cd openwrt/
vim feeds.conf.default
在最后一行加上: 
src-git lienol https://github.com/Lienol/openwrt-package.git;main
src-git other https://github.com/Lienol/openwrt-package.git;other
src-git PWpackages https://github.com/xiaorouji/openwrt-passwall.git;packages
#src-git PWluci https://github.com/xiaorouji/openwrt-passwall.git;luci  //如果是编译passwall2着不需要否则会加载重复软件包
src-git passwall2 https://github.com/xiaorouji/openwrt-passwall2.git
更新并安装Feeds
./scripts/feeds clean
./scripts/feeds update -a
./scripts/feeds install -a
默认组件和配置菜单
make defconfig
make menuconfig
x86编译
Target System -> x86
Subtarget -> x86_64
Target Profile -> Generic x86/64
Target Images -> [*] Build VMware image files (VMDK) //我用虚拟机测试所以选择VMware,其他的看自己需求需要编译什么包基本上默认的包就够
选择软件包 <M>编译软件包 [*]内置
LuCI -> Applications -> <*> luci-app-passwall2  //我需要编译passwall2所以passwall就不要选择了
LuCI -> Applications -> Configuration  //查看passwall的必要应用有没有选上,由于软件名问题这里我不列出来那些了
配置完成后预下载dl软件包
make download -j5 V=s  //使用5线程下载编译所需的软件包
下载完成后开始编译,第一次编译建议先使用单线程编译
make V=99  //单线程编译
make -j 12 V=99  //12线程编译
编译出来后的固件路径:/home/xiaoxie/openwrt/bin/targets/x86/64

 

OpenWrt Passwall2 编译教程

加载中……