Build Padavan #168
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#修改TNAME: K2P 中的K2P为你需要编译的型号,注意名称要与configs/templates/目录下的名字相同 | |
name: Build Padavan | |
on: | |
release: | |
types: [published] | |
push: | |
tags: | |
- 'v*' | |
# branches: | |
# - master | |
# schedule: | |
# - cron: 0 8 * * 5 | |
watch: | |
types: [started] | |
jobs: | |
build: | |
runs-on: ubuntu-18.04 | |
if: github.event.repository.owner.id == github.event.sender.id | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install unzip libtool-bin curl cmake gperf gawk flex bison nano xxd fakeroot \ | |
cpio git python-docutils gettext automake autopoint texinfo build-essential help2man \ | |
pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev wget | |
- name: Clone source code | |
run: | | |
git clone --depth=1 https://github.com/MeIsReallyBa/padavan-4.4.git /opt/rt-n56u | |
cd /opt/rt-n56u/toolchain-mipsel | |
sh dl_toolchain.sh | |
mkdir -p /opt/images/ | |
- name: Build Firmware | |
env: | |
TNAME: K2P | |
run: | | |
cd /opt/rt-n56u/trunk | |
if [ ! -f configs/templates/$TNAME.config ] ; then | |
echo "configs/templates/$TNAME.config not found " | |
exit 1 | |
fi | |
cp -f configs/templates/$TNAME.config .config | |
sed -i 's/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=n/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=y/g' .config | |
################################################################################################ | |
#因不同型号配置功能不一样,所以先把配置项删除,如果你自己要添加其他的,也要写上删除这一条,切记!!! | |
################################################################################################ | |
sed -i 's/CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER=y/CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER=n/g' .config | |
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MENTOHUST=y/CONFIG_FIRMWARE_INCLUDE_MENTOHUST=n/g' .config | |
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT=y/CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT=n/g' .config | |
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SRELAY=y/CONFIG_FIRMWARE_INCLUDE_SRELAY=n/g' .config | |
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=y/CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=n/g' .config | |
###################################################################### | |
#以下选项是定义你需要的功能(y=集成,n=忽略),重新写入到.config文件 | |
###################################################################### | |
##科学上网## | |
echo "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=y" >> .config #科学上网插件,选择n后全部有关插件都不集成 | |
echo "CONFIG_FIRMWARE_INCLUDE_XRAY=n" >> .config #集成xray执行文件 ~4.5M | |
echo "CONFIG_FIRMWARE_INCLUDE_V2RAY=n" >> .config #集成v2ray执行文件 | |
echo "CONFIG_FIRMWARE_INCLUDE_TROJAN=y" >> .config #集成trojan执行文件 ~1.2M | |
echo "CONFIG_FIRMWARE_INCLUDE_SSOBFS=y" >> .config #simple-obfs混淆插件 | |
##科学上网## | |
##广告管理## | |
echo "CONFIG_FIRMWARE_INCLUDE_ADBYBY=y" >> .config #adbyby plus+ | |
##DNS服务## | |
echo "CONFIG_FIRMWARE_INCLUDE_SMARTDNS=n" >> .config #smartdns | |
echo "CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME=n" >> .config #adg DNS去AD | |
##内网穿透服务## | |
echo "CONFIG_FIRMWARE_INCLUDE_ZEROTIER=y" >> .config #zerotier ~1.3M | |
echo "CONFIG_FIRMWARE_INCLUDE_ALIDDNS=y" >> .config #aliddns | |
echo "CONFIG_FIRMWARE_INCLUDE_DDNSTO=y" >> .config #ddnsto ~0.5M | |
echo "CONFIG_FIRMWARE_INCLUDE_WIREGUARD=y" >> .config #wireguard ~10k | |
##内网穿透服务## | |
echo "CONFIG_FIRMWARE_INCLUDE_ALDRIVER=y" >> .config #ALDRIVER ~3m | |
echo "CONFIG_FIRMWARE_INCLUDE_MENTOHUST=n" >> .config #mentohust | |
##流控QOS## | |
echo "CONFIG_FIRMWARE_INCLUDE_SQM=y" >> .config #SQM QOS#CPU超频 | |
echo "CONFIG_FIRMWARE_INCLUDE_OC=n" >> .config #CPU超频开关 | |
echo 'CONFIG_FIRMWARE_MT7621_OC="0x312"' >> .config #此处填写对应频率的十六进制:1000Mhz=0x312 1100Mhz=0x362 1120Mhz=0x372 1200Mhz=0x3B2 | |
######################################################################################### | |
#自定义添加其它功能请参考源码configs/templates/目录下的config文件。按照上面的格式添加即可 | |
#格式如下: | |
#sed -i '/自定义项/d' .config | |
#echo "自定义项=y" >> .config | |
######################################################################################### | |
sudo ./clear_tree | |
sudo ./build_firmware_modify $TNAME 0 | |
sudo mv -f images/*.trx /opt/images/ | |
- name : Upload packages | |
uses: actions/upload-artifact@master | |
if: always() | |
with: | |
name: Padavan-packages | |
path: /opt/images |