-
Notifications
You must be signed in to change notification settings - Fork 79
489 lines (455 loc) · 30.6 KB
/
update.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
name: Update luci-app-turboacc dependencies
on:
schedule:
- cron: '0 23 * * *'
workflow_dispatch:
inputs:
test:
description: 'test'
required: false
type: boolean
permissions:
contents: write
discussions: write
jobs:
check:
outputs:
test: ${{ steps.diff.outputs.test }}
runs-on: ubuntu-20.04
steps:
- name: 设置时区建立工作文件夹
run: |
sudo timedatectl set-timezone "Asia/Shanghai"
mkdir -p compare compare/original compare/new clone clone/fullcone-nat-nftables/nft-fullcone clone/coolsnowwolf/lede output/test output/push
export COMPARE_PATH="$(pwd)/compare"
export CLONE_PATH="$(pwd)/clone"
export OUTPUT_PATH="$(pwd)/output"
echo "COMPARE_PATH=$COMPARE_PATH" >> $GITHUB_ENV
echo "CLONE_PATH=$CLONE_PATH" >> $GITHUB_ENV
echo "OUTPUT_PATH=$OUTPUT_PATH" >> $GITHUB_ENV
mkdir -p $COMPARE_PATH/new/nft-fullcone $COMPARE_PATH/new/firewall4/patches/ $COMPARE_PATH/new/nftables/patches/ $COMPARE_PATH/new/libnftnl/patches/
mkdir -p $COMPARE_PATH/new/hack-5.10 $COMPARE_PATH/new/hack-5.15 $COMPARE_PATH/new/hack-6.1 $COMPARE_PATH/new/hack-6.6 $COMPARE_PATH/new/pending-5.10 $COMPARE_PATH/new/pending-5.15 $COMPARE_PATH/new/pending-6.1 $COMPARE_PATH/new/pending-6.6
mkdir -p $COMPARE_PATH/original/nft-fullcone
mkdir -p $COMPARE_PATH/original/hack-5.10 $COMPARE_PATH/original/hack-5.15 $COMPARE_PATH/original/hack-6.1 $COMPARE_PATH/original/hack-6.6 $COMPARE_PATH/original/pending-5.10 $COMPARE_PATH/original/pending-5.15 $COMPARE_PATH/original/pending-6.1 $COMPARE_PATH/original/pending-6.6
- name: 克隆
run: |
git clone --depth=1 --single-branch https://github.com/fullcone-nat-nftables/nft-fullcone $CLONE_PATH/fullcone-nat-nftables/nft-fullcone
git clone --depth=1 --single-branch https://github.com/coolsnowwolf/lede $CLONE_PATH/coolsnowwolf/lede
git clone --depth=1 --single-branch --branch "package" https://github.com/chenmozhijin/turboacc $CLONE_PATH/chenmozhijin/turboacc
git clone --depth=1 --single-branch --branch "master" https://github.com/openwrt/openwrt/ $CLONE_PATH/openwrt/openwrt/
- name: 整理
run: |
#nft-fullcone
rm -rf $CLONE_PATH/fullcone-nat-nftables/nft-fullcone/.git
cp -RT $CLONE_PATH/fullcone-nat-nftables/nft-fullcone $COMPARE_PATH/new/nft-fullcone
cp -RT $CLONE_PATH/chenmozhijin/turboacc/nft-fullcone $COMPARE_PATH/original/nft-fullcone
#hack
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
#cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch
# coolsnowwolf/lede#11211
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
#cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch
# coolsnowwolf/lede#11211
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
#cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch
# coolsnowwolf/lede#11211
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-5.10/613-netfilter_optional_tcp_window_check.patch
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-5.15/613-netfilter_optional_tcp_window_check.patch
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-6.1/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-6.1/613-netfilter_optional_tcp_window_check.patch
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-6.6/613-netfilter_optional_tcp_window_check.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch || true
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch || true
#pending
cp $CLONE_PATH/chenmozhijin/turboacc/pending-5.10/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-5.10/613-netfilter_optional_tcp_window_check.patch
cp $CLONE_PATH/chenmozhijin/turboacc/pending-5.15/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-5.15/613-netfilter_optional_tcp_window_check.patch
cp $CLONE_PATH/chenmozhijin/turboacc/pending-6.1/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-6.1/613-netfilter_optional_tcp_window_check.patch
cp $CLONE_PATH/chenmozhijin/turboacc/pending-6.6/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-6.6/613-netfilter_optional_tcp_window_check.patch || true
#shortcut-fe
#cp -RT $CLONE_PATH/coolsnowwolf/lede/package/qca/shortcut-fe $COMPARE_PATH/new/shortcut-fe
cp -RT $CLONE_PATH/chenmozhijin/turboacc/shortcut-fe $COMPARE_PATH/new/shortcut-fe
cp -RT $CLONE_PATH/chenmozhijin/turboacc/shortcut-fe $COMPARE_PATH/original/shortcut-fe
sed -i "s#DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x +kmod-shortcut-fe#DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x||TARGET_qualcommax +kmod-shortcut-fe#g" $COMPARE_PATH/new/shortcut-fe/simulated-driver/Makefile
#firewall4 nftables libnftnl
cp -RT $CLONE_PATH/openwrt/openwrt/package/network/config/firewall4/ $COMPARE_PATH/new/firewall4/
cp -RT $CLONE_PATH/openwrt/openwrt/package/network/utils/nftables/ $COMPARE_PATH/new/nftables/
cp -RT $CLONE_PATH/openwrt/openwrt/package/libs/libnftnl/ $COMPARE_PATH/new/libnftnl/
FIREWALL4_VERSION=$(grep -o 'FIREWALL4_VERSION=.*' "$CLONE_PATH/chenmozhijin/turboacc/version" | cut -d '=' -f 2)
LIBNFTNL_VERSION=$(grep -o 'LIBNFTNL_VERSION=.*' "$CLONE_PATH/chenmozhijin/turboacc/version" | cut -d '=' -f 2)
NFTABLES_VERSION=$(grep -o 'NFTABLES_VERSION=.*' "$CLONE_PATH/chenmozhijin/turboacc/version" | cut -d '=' -f 2)
cp -RT $CLONE_PATH/chenmozhijin/turboacc/firewall4-$FIREWALL4_VERSION/firewall4/patches/ $COMPARE_PATH/new/firewall4/patches/
cp -RT $CLONE_PATH/chenmozhijin/turboacc/nftables-$NFTABLES_VERSION/nftables/patches/ $COMPARE_PATH/new/nftables/patches/
cp -RT $CLONE_PATH/chenmozhijin/turboacc/libnftnl-$LIBNFTNL_VERSION/libnftnl/patches/ $COMPARE_PATH/new/libnftnl/patches/
FIREWALL4_NEW_VERSION=$(grep -o 'PKG_SOURCE_VERSION:=.*' $COMPARE_PATH/new/firewall4/Makefile | cut -d '=' -f 2)
NFTABLES_NEW_VERSION=$(grep -o 'PKG_VERSION:=.*' $COMPARE_PATH/new/nftables/Makefile | cut -d '=' -f 2)
LIBNFTNL_NEW_VERSION=$(grep -o 'PKG_VERSION:=.*' $COMPARE_PATH/new/libnftnl/Makefile | cut -d '=' -f 2)
echo "FIREWALL4_NEW_VERSION=$FIREWALL4_NEW_VERSION" >> $GITHUB_ENV
echo "NFTABLES_NEW_VERSION=$NFTABLES_NEW_VERSION" >> $GITHUB_ENV
echo "LIBNFTNL_NEW_VERSION=$LIBNFTNL_NEW_VERSION" >> $GITHUB_ENV
echo "FIREWALL4_NEW_VERSION=$FIREWALL4_NEW_VERSION"
echo "NFTABLES_NEW_VERSION=$NFTABLES_NEW_VERSION"
echo "LIBNFTNL_NEW_VERSION=$LIBNFTNL_NEW_VERSION"
echo "FIREWALL4_VERSION=$FIREWALL4_NEW_VERSION" > $OUTPUT_PATH/push/version
echo "NFTABLES_VERSION=$NFTABLES_NEW_VERSION" >> $OUTPUT_PATH/push/version
echo "LIBNFTNL_VERSION=$LIBNFTNL_NEW_VERSION" >> $OUTPUT_PATH/push/version
echo "FIREWALL4_VERSION=$FIREWALL4_NEW_VERSION" > $OUTPUT_PATH/test/version
echo "NFTABLES_VERSION=$NFTABLES_NEW_VERSION" >> $OUTPUT_PATH/test/version
echo "LIBNFTNL_VERSION=$LIBNFTNL_NEW_VERSION" >> $OUTPUT_PATH/test/version
mkdir -p $COMPARE_PATH/new/firewall4-$FIREWALL4_NEW_VERSION/firewall4 $COMPARE_PATH/new/nftables-$NFTABLES_NEW_VERSION/nftables $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl
cp -RT $COMPARE_PATH/new/firewall4/ $COMPARE_PATH/new/firewall4-$FIREWALL4_NEW_VERSION/firewall4
cp -RT $COMPARE_PATH/new/nftables/ $COMPARE_PATH/new/nftables-$NFTABLES_NEW_VERSION/nftables
cp -RT $COMPARE_PATH/new/libnftnl/ $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl
rm -rf $COMPARE_PATH/new/firewall4/ $COMPARE_PATH/new/nftables/ $COMPARE_PATH/new/libnftnl/
if [ -d "$CLONE_PATH/chenmozhijin/turboacc/firewall4-$FIREWALL4_NEW_VERSION" ]; then
cp -RT $CLONE_PATH/chenmozhijin/turboacc/firewall4-$FIREWALL4_NEW_VERSION $COMPARE_PATH/original/firewall4-$FIREWALL4_NEW_VERSION
cp -r $CLONE_PATH/chenmozhijin/turboacc/firewall4-* $OUTPUT_PATH/push/
rm -rf $OUTPUT_PATH/push/firewall4-$FIREWALL4_NEW_VERSION
else
echo "firewall4有新版本$FIREWALL4_NEW_VERSION"
mkdir -p $COMPARE_PATH/original/firewall4-$FIREWALL4_NEW_VERSION
cp -r $CLONE_PATH/chenmozhijin/turboacc/firewall4-* $OUTPUT_PATH/push/
fi
if [ -d "$CLONE_PATH/chenmozhijin/turboacc/nftables-$NFTABLES_NEW_VERSION" ]; then
cp -RT $CLONE_PATH/chenmozhijin/turboacc/nftables-$NFTABLES_NEW_VERSION $COMPARE_PATH/original/nftables-$NFTABLES_NEW_VERSION
cp -r $CLONE_PATH/chenmozhijin/turboacc/nftables-* $OUTPUT_PATH/push/
rm -rf $OUTPUT_PATH/push/nftables-$NFTABLES_NEW_VERSION
else
echo "nftables有新版本$NFTABLES_NEW_VERSION"
mkdir -p $COMPARE_PATH/original/nftables-$NFTABLES_NEW_VERSION
cp -r $CLONE_PATH/chenmozhijin/turboacc/nftables-* $OUTPUT_PATH/push/
fi
#修复WARNING: 'automake-1.16' is probably too old.
if [ "$(grep -c "# Network$" $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl/Makefile)" -eq '0' ];then
echo "添加PKG_FIXUP:=autoreconf"
sed -i '/PKG_LICENSE_FILES:=COPYING/a\PKG_FIXUP:=autoreconf' $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl/Makefile
fi
if [ -d "$CLONE_PATH/chenmozhijin/turboacc/libnftnl-$LIBNFTNL_NEW_VERSION" ]; then
cp -RT $CLONE_PATH/chenmozhijin/turboacc/libnftnl-$LIBNFTNL_NEW_VERSION $COMPARE_PATH/original/libnftnl-$LIBNFTNL_NEW_VERSION
cp -r $CLONE_PATH/chenmozhijin/turboacc/libnftnl-* $OUTPUT_PATH/push/
rm -rf $OUTPUT_PATH/push/libnftnl-$LIBNFTNL_NEW_VERSION
else
echo "libnftnl有新版本$LIBNFTNL_NEW_VERSION"
mkdir -p $COMPARE_PATH/original/libnftnl-$LIBNFTNL_NEW_VERSION
cp -r $CLONE_PATH/chenmozhijin/turboacc/libnftnl-* $OUTPUT_PATH/push/
fi
cp -RT $COMPARE_PATH/new/ $OUTPUT_PATH/test/
cp $CLONE_PATH/chenmozhijin/turboacc/README.md $OUTPUT_PATH/push/README.md
cp -RT $COMPARE_PATH/new/ $OUTPUT_PATH/push/
ls -la $(find $GITHUB_WORKSPACE -type d)
- name: 对比
id: diff
run: |
if diff -r "$COMPARE_PATH/original/" "$COMPARE_PATH/new/"; then
echo "The contents of $COMPARE_PATH/original/ and $COMPARE_PATH/new/ are the same."
echo "test=false" >> "$GITHUB_OUTPUT"
else
echo "The contents of $COMPARE_PATH/original/ and $COMPARE_PATH/new/ are different."
echo "test=true" >> "$GITHUB_OUTPUT"
fi
- name: 准备上传
run: |
cd $OUTPUT_PATH/push/
tar cvpzf $GITHUB_WORKSPACE/new.tgz *
- name: 上传 文件
uses: actions/upload-artifact@v4
with:
name: new
path: new.tgz
test:
needs: check
if: needs.check.outputs.test == 'true' || inputs.test
strategy:
fail-fast: false
max-parallel: 10
matrix:
tag_branche: [master,openwrt-24.10,openwrt-23.05,openwrt-22.03]
compile: [FLOW_OFFLOAD,SHORTCUT_FE,SHORTCUT_FE_CM,SHORTCUT_FE_DRV]
runs-on: ubuntu-22.04
steps:
- name: 下载new
uses: actions/download-artifact@v4
with:
name: new
- name: 解压
run: |
mkdir -p turboacc
export TURBOACC_PATH="$(pwd)/turboacc"
echo "TURBOACC_PATH=$TURBOACC_PATH" >> $GITHUB_ENV
tar xvpfz $GITHUB_WORKSPACE/new.tgz -C $TURBOACC_PATH
- name: 检测
run: ls -la $(find $GITHUB_WORKSPACE -type d)
- name: 安装编译依赖
run: |
sudo -E apt update
sudo -E apt-mark hold grub-efi-amd64-signed
sudo -E apt -y full-upgrade
sudo apt install -y build-essential clang flex bison g++ gawk gcc-multilib g++-multilib \
gettext git libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget
sudo -E systemctl daemon-reload
sudo -E apt -y autoremove --purge
sudo -E apt clean
sudo timedatectl set-timezone "Asia/Shanghai"
- name: 克隆源代码
run: |
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
export OPENWRT_ROOT_PATH="$(pwd)"
echo "OPENWRT_ROOT_PATH=$OPENWRT_ROOT_PATH" >> $GITHUB_ENV
- name: 切换标签/分支
run: |
echo "${{ matrix.tag_branche }}"
cd $OPENWRT_ROOT_PATH
git checkout "${{ matrix.tag_branche }}"
- name: 修复问题
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
sed -i 's/^ DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt$/ DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt +kmod-udptunnel4 +kmod-udptunnel6/' package/kernel/linux/modules/netsupport.mk #https://github.com/openwrt/openwrt/commit/ecc53240945c95bc77663b79ccae6e2bd046c9c8
sed -i 's/^ dnsmasq \\$/ dnsmasq-full \\/g' ./include/target.mk
sed -i 's/^ b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)"/ $(TOPDIR)\/tools\/b43-tools\/files\/b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)"/' ./package/kernel/mac80211/broadcom.mk
- name: 更新 feeds
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
./scripts/feeds update -a
./scripts/feeds install -a
- name: 生成配置文件
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
if [ "${{ matrix.compile }}" = "SHORTCUT_FE_DRV" ]; then
echo "CONFIG_TARGET_ipq807x=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_ipq807x_generic=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_ipq807x_generic_DEVICE_redmi_ax6=y" >> $OPENWRT_ROOT_PATH/.config
else
echo "CONFIG_TARGET_x86=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_x86_64=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_x86_64_DEVICE_generic=y" >> $OPENWRT_ROOT_PATH/.config
fi
make defconfig
- name: 添加turboacc
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
if [ "${{ matrix.compile }}" = "FLOW_OFFLOAD" ]; then
curl -sSL https://raw.githubusercontent.com/chenmozhijin/turboacc/luci/add_turboacc.sh -o add_turboacc.sh && bash add_turboacc.sh --no-sfe --local-pkg $TURBOACC_PATH
else
curl -sSL https://raw.githubusercontent.com/chenmozhijin/turboacc/luci/add_turboacc.sh -o add_turboacc.sh && bash add_turboacc.sh --local-pkg $TURBOACC_PATH
fi
kernel_version="$(sed -n '/CONFIG_LINUX_/p' $OPENWRT_ROOT_PATH/.config | sed -e 's/CONFIG_LINUX_//' -e 's/=y//' -e 's/_/./g')"
#log
echo "libnftnl-file"
ls $OPENWRT_ROOT_PATH/package/libs/libnftnl
echo "firewall4-file"
ls $OPENWRT_ROOT_PATH/package/network/config/firewall4
echo "nftables-file"
ls $OPENWRT_ROOT_PATH/package/network/utils/nftables
echo "firewall4-patches"
ls $OPENWRT_ROOT_PATH/package/network/config/firewall4/patches/
echo "libnftnl-patches"
ls $OPENWRT_ROOT_PATH/package/libs/libnftnl/patches/
echo "nftables-patches"
ls $OPENWRT_ROOT_PATH/package/network/utils/nftables/patches/
echo "hack-$kernel_version"
ls $OPENWRT_ROOT_PATH/target/linux/generic/hack-$kernel_version
echo "pending-$kernel_version"
ls $OPENWRT_ROOT_PATH/target/linux/generic/pending-$kernel_version
- name: 加载配置并生成配置文件
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
echo "compile = "${{ matrix.compile }}
rm -rf .config .config.old tmp
ls -la
if [ "${{ matrix.compile }}" = "SHORTCUT_FE_DRV" ]; then
echo "CONFIG_TARGET_ipq807x=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_ipq807x_generic=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_ipq807x_generic_DEVICE_redmi_ax6=y" >> $OPENWRT_ROOT_PATH/.config
else
echo "CONFIG_TARGET_x86=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_x86_64=y" >> $OPENWRT_ROOT_PATH/.config
echo "CONFIG_TARGET_x86_64_DEVICE_generic=y" >> $OPENWRT_ROOT_PATH/.config
fi
echo 'CONFIG_PACKAGE_luci-app-turboacc=y' >> .config
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_BBR_CCA=y' >> .config
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_NFT_FULLCONE=y' >> .config
if [ "${{ matrix.compile }}" = "FLOW_OFFLOAD" ]; then
echo "FLOW_OFFLOAD"
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=y' >> .config
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE=n' >> .config
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE_CM=n' >> .config
elif [ "${{ matrix.compile }}" = "SHORTCUT_FE" ]; then
echo "SHORTCUT_FE"
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=n' >> .config
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE=y' >> .config
echo 'CONFIG_PACKAGE_kmod-shortcut-fe-cm=n' >> .config
elif [ "${{ matrix.compile }}" = "SHORTCUT_FE_CM" ]; then
echo "SHORTCUT_FE_CM"
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=n' >> .config
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE_CM=y' >> .config
elif [ "${{ matrix.compile }}" = "SHORTCUT_FE_DRV" ]; then
echo "SHORTCUT_FE_DRV"
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=n' >> .config
echo "CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE_DRV=y" >> $OPENWRT_ROOT_PATH/.config
else
echo "compile = "${{ matrix.compile }}
exit 1
fi
echo ".config"
cat .config
make defconfig
echo "diffconfig"
./scripts/diffconfig.sh
- name: 下载 dl 库
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
make download -j16
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
make download -j16 || make download -j1 V=s
# - name: 下载工具链库
# run: |
# cd $OPENWRT_ROOT_PATH
# mkdir -p staging_dir
# CONFIG_TARGET_BOARD=$(sed -n 's/CONFIG_TARGET_BOARD="\(.*\)"/\1/p' .config) #x86
# CONFIG_TARGET_SUBTARGET=$(sed -n 's/CONFIG_TARGET_SUBTARGET="\(.*\)"/\1/p' .config) #64
# if [ "${{ matrix.tag_branche }}" = "master" ]; then
# RELEASE=snapshots
# elif [ "${{ matrix.tag_branche }}" = "openwrt-23.05" ] || [ "${{ matrix.tag_branche }}" = "v23.05.0" ]; then
# RELEASE=releases/v23.05.0
# elif [ "${{ matrix.tag_branche }}" = "openwrt-22.03" ] || [ "${{ matrix.tag_branche }}" = "v22.03.5" ]; then
# RELEASE=releases/22.03.5
# fi
# FILE_NAME=$(curl -s -L --retry 3 --connect-timeout 20 https://downloads.openwrt.org/snapshots/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/ | grep -m 1 -o "openwrt-toolchain-${CONFIG_TARGET_BOARD}-${CONFIG_TARGET_SUBTARGET}_gcc[^\"]*\.Linux-${CONFIG_TARGET_BOARD}_${CONFIG_TARGET_SUBTARGET}\.tar\.xz" | sed 's/^.*<a href="//' | sort -u)
# curl -L --retry 3 --connect-timeout 20 https://downloads.openwrt.org/$RELEASE/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/$FILE_NAME -o staging_dir/toolchain.tar.xz
# cd staging_dir
# tar xf toolchain.tar.xz
# cp -r ./openwrt-toolchain-*/toolchain-* .
# rm -rf ./openwrt-toolchain-*
- name: 获取信息
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
id: get-info
run: |
toolchain_commit=$(git log --pretty=tformat:"%h" -n1 tools toolchain)
target=$(sed -n '/^CONFIG_TARGET_BOARD/p' ${{ env.OPENWRT_ROOT_PATH }}/.config | sed -e 's/CONFIG_TARGET_BOARD\=\"//' -e 's/\"//')
subtarget=$(sed -n '/^CONFIG_TARGET_SUBTARGET/p' ${{ env.OPENWRT_ROOT_PATH }}/.config | sed -e 's/CONFIG_TARGET_SUBTARGET\=\"//' -e 's/\"//')
echo "target=$target" >> "$GITHUB_OUTPUT"
echo "subtarget=$subtarget" >> "$GITHUB_OUTPUT"
echo "toolchain_commit=$toolchain_commit" >> "$GITHUB_OUTPUT"
- name: 缓存toolchain
uses: actions/cache@v4
id: cache-toolchain
with:
path: |
${{ env.OPENWRT_ROOT_PATH }}/staging_dir/host*
${{ env.OPENWRT_ROOT_PATH }}/staging_dir/tool*
key: toolchain-${{ steps.get-info.outputs.toolchain_commit }}-${{ steps.get-info.outputs.target }}-${{ steps.get-info.outputs.subtarget }}
- name: 构建工具
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
make tools/install -j $(($(nproc)+1)) || make tools/install -j1 V=s
echo "======================="
echo "空间使用情况:"
echo "======================="
df --total -Th
echo "======================="
- name: 构建工具链
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
run: |
make toolchain/install -j $(($(nproc)+1)) || make toolchain/install -j1 V=s
echo "======================="
echo "空间使用情况:"
echo "======================="
df --total -Th
echo "======================="
- name: 构建内核
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
make target/compile -j $(($(nproc)+1)) || make target/compile -j$(nproc) V=s || make target/compile -j1 V=s
echo "======================="
echo "空间使用情况:"
echo "======================="
df --total -Th
echo "======================="
- name: 编译并生成安装包
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
make package/compile -j $(($(nproc)+1)) || make package/compile -j1 V=s
make package/install -j $(($(nproc)+1)) || make package/install -j1 V=s
echo "======================="
echo "空间使用情况:"
echo "======================="
df --total -Th
echo "======================="
du -h --max-depth=1 ./ --exclude=build_dir --exclude=bin
du -h --max-depth=1 ./build_dir
du -h --max-depth=1 ./bin
- name: 准备 artifact
working-directory: ${{ env.OPENWRT_ROOT_PATH }}
run: |
mkdir -p ./artifact
ls -la $(find ./bin/packages/ -type d)
cp -rf $(find ./bin/packages/ -type f \( -name "*.ipk" -o -name "*.apk" \)) ./artifact
cp -rf $(find ./bin/packages/ -type f \( -name "*.ipk" -o -name "*.apk" \)) ./artifact
- name: 上传build artifacts
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.tag_branche }}-${{ matrix.compile }}
path: ${{ env.OPENWRT_ROOT_PATH }}/artifact/**
- name: 收集日志
if: success() || failure()
run: |
mkdir -p logs
cd logs
export LOG_PATH="$(pwd)"
echo "LOG_PATH=$LOG_PATH" >> $GITHUB_ENV
cp -r $OPENWRT_ROOT_PATH/logs $LOG_PATH/openwrt-logs || echo "没有openwrt/logs"
cp $OPENWRT_ROOT_PATH/.config $LOG_PATH/openwrt.config || echo "没有openwrt/.config"
ls -la $(find $OPENWRT_ROOT_PATH/package/ -type d) >> $LOG_PATH/package_files.list
ls -la $(find $OPENWRT_ROOT_PATH/linux/generic/ -type d) >> $LOG_PATH/kp_files.list
- name: 上传日志
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.tag_branche }}-${{ matrix.compile }}
path: "${{ env.LOG_PATH }}"
push:
needs: [test,check]
if: ${{ ! inputs.test }}
runs-on: ubuntu-22.04
steps:
- name: 将存储库签出到运行器
uses: actions/checkout@v4
with:
ref: 'package'
path: upload
- name: 下载new
uses: actions/download-artifact@v4
with:
name: new
- name: 解压
run: |
mkdir -p turboacc
export TURBOACC_PATH="$(pwd)/turboacc"
echo "TURBOACC_PATH=$TURBOACC_PATH" >> $GITHUB_ENV
tar xvpfz $GITHUB_WORKSPACE/new.tgz -C $TURBOACC_PATH
- name: 上传
id: upload
run: |
rm -rf upload/*
cp -RT $TURBOACC_PATH upload
cd upload
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "update$(TZ='Asia/Shanghai' date +@%Y%m%d)"
git push
- name: 检测
run: ls -la $(find $GITHUB_WORKSPACE -type d)