forked from upbit/Padavan-build-RM2100
-
Notifications
You must be signed in to change notification settings - Fork 10
131 lines (124 loc) · 6.97 KB
/
build-padavan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build Padavan
on:
release:
types: published
watch:
types: started
jobs:
build:
runs-on: ubuntu-18.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: 检查
uses: actions/checkout@master
- name: 初始化编译环境
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: 克隆C大库
run: |
git clone --depth=1 https://github.com/chongshengB/rt-n56u.git /opt/rt-n56u
cd /opt/rt-n56u/toolchain-mipsel
sh dl_toolchain.sh
mkdir -p /opt/images/
- name: 编译固件
env:
TNAME: RM2100
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 '/CONFIG_FIRMWARE_INCLUDE_MENTOHUST/d' .config #删除配置项MENTOHUST
sed -i '/CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT/d' .config #删除配置项SCUTCLIENT
sed -i '/CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS/d' .config #删除配置项SS plus+
sed -i '/CONFIG_FIRMWARE_INCLUDE_SSSERVER/d' .config #删除配置项SS server
sed -i '/CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER/d' .config #删除配置项DNSFORWARDER
sed -i '/CONFIG_FIRMWARE_INCLUDE_ADBYBY/d' .config #删除配置项adbyby plus+
sed -i '/CONFIG_FIRMWARE_INCLUDE_FRPC/d' .config #删除配置项FRPC
sed -i '/CONFIG_FIRMWARE_INCLUDE_FRPS/d' .config #删除配置项FRPS
sed -i '/CONFIG_FIRMWARE_INCLUDE_TUNSAFE/d' .config #删除配置项TUNSAFE
sed -i '/CONFIG_FIRMWARE_INCLUDE_ALIDDNS/d' .config #删除配置项阿里DDNS
sed -i '/CONFIG_FIRMWARE_INCLUDE_SMARTDNS/d' .config #删除配置项SMARTDNS
sed -i '/CONFIG_FIRMWARE_INCLUDE_SRELAY/d' .config #删除配置项 srelay 代理
sed -i 's/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=n/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=y/g' .config
######################################################################
#以下选项是定义你需要的功能(y=集成,n=忽略),重新写入到.config文件
######################################################################
##校园网##
echo "CONFIG_FIRMWARE_INCLUDE_MENTOHUST=n" >> .config #MENTOHUST
echo "CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT=n" >> .config #SCUTCLIENT
##校园网##
##科学上网##
echo "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=y" >> .config #SS plus+
echo "CONFIG_FIRMWARE_INCLUDE_SSOBFS=n" >> .config # simple-obfs混淆插件
echo "CONFIG_FIRMWARE_INCLUDE_SSSERVER=n" >> .config #SS server
echo "CONFIG_FIRMWARE_INCLUDE_V2RAY=y" >> .config #集成v2ray执行文件(3.8M左右),如果不集成,会从网上下载下来执行,不影响正常使用
echo "CONFIG_FIRMWARE_INCLUDE_TROJAN=y" >> .config #集成trojan执行文件(1.1M左右),如果不集成,会从网上下载下来执行,不影响正常使用
##科学上网##
##代理服务##
echo "CONFIG_FIRMWARE_INCLUDE_KUMASOCKS=y" >> .config #socks5服务端
echo "CONFIG_FIRMWARE_INCLUDE_TUNSAFE=n" >> .config #TUNSAFE
echo "CONFIG_FIRMWARE_INCLUDE_SRELAY=n" >> .config #可以不集成
##代理服务##
##广告管理##
echo "CONFIG_FIRMWARE_INCLUDE_ADBYBY=y" >> .config #adbyby plus+
echo "CONFIG_FIRMWARE_INCLUDE_KOOLPROXY=y" >> .config #KP广告过滤
echo "CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME=y" >> .config #adg DNS去AD
##广告管理##
##DNS服务##
echo "CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER=n" >> .config #DNSFORWARDER
echo "CONFIG_FIRMWARE_INCLUDE_SMARTDNS=y" >> .config #smartdns
echo "CONFIG_FIRMWARE_INCLUDE_SMARTDNSBIN=y" >> .config #smartdns二进制文件
##DNS服务##
##文件管理##
echo "CONFIG_FIRMWARE_INCLUDE_CADDY=n" >> .config #在线文件管理服务
echo "CONFIG_FIRMWARE_INCLUDE_CADDYBIN=n" >> .config #集成caddu执行文件,此文件有13M,请注意固件大小。如果不集成,会从网上下载下来执行,不影响正常使用
##文件管理##
##音乐解锁##
echo "CONFIG_FIRMWARE_INCLUDE_WYY=y" >> .config #网易云解锁
echo "CONFIG_FIRMWARE_INCLUDE_WYYBIN=y" >> .config #网易云解锁GO版本执行文件(4M多)注意固件超大小,不集成会自动下载
##音乐解锁##
##内网穿透服务##
echo "CONFIG_FIRMWARE_INCLUDE_ZEROTIER=y" >> .config #zerotier ~1.3M
echo "CONFIG_FIRMWARE_INCLUDE_ALIDDNS=n" >> .config #aliddns
echo "CONFIG_FIRMWARE_INCLUDE_FRPC=n" >> .config #FRPC
echo "CONFIG_FIRMWARE_INCLUDE_FRPS=n" >> .config #FRPC
##内网穿透服务##
#########################################################################################
#自定义添加其它功能请参考源码configs/templates/目录下的config文件。按照上面的格式添加即可
#格式如下:
#sed -i '/自定义项/d' .config
#echo "自定义项=y" >> .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_XFRM/d' .config
echo "CONFIG_FIRMWARE_INCLUDE_XFRM=y" >> .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_QOS/d' .config
echo "CONFIG_FIRMWARE_INCLUDE_QOS=y" >> .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_NFSD/d' .config
echo "CONFIG_FIRMWARE_INCLUDE_NFSD=y" >> .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_NFSC/d' .config
echo "CONFIG_FIRMWARE_INCLUDE_NFSC=y" >> .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_ARIA/d' .config
echo "CONFIG_FIRMWARE_INCLUDE_ARIA=y" >> .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_ARIA_WEB_CONTROL/d' .config
echo "CONFIG_FIRMWARE_INCLUDE_ARIA_WEB_CONTROL=y" >> .config
#########################################################################################
sudo ./clear_tree
sudo ./build_firmware_modify $TNAME 0
sudo mv -f images/*.trx /opt/images/
- name : 上传固件
uses: actions/upload-artifact@master
if: always()
with:
name: Padavan-build-RM2100
path: /opt/images