forked from soffchen/NanoPi-R2S
-
Notifications
You must be signed in to change notification settings - Fork 0
183 lines (143 loc) · 7.08 KB
/
APnanopie.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
name: NanoPi-R2S RK3328 OpenWrt 19.07 Build
on:
push:
paths:
- 'CHANGELOG.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
ref: master
- name: Initialize Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo rm -rf /usr/share/dotnet /usr/local/lib/android/sdk
sudo docker image prune -a -f
sudo apt-get -y install upx-ucl
sudo apt-get -y purge dotnet* ghc* google* llvm* mysql* php* zulu* firefox hhvm
sudo apt-get -y autoremove --purge
wget -O - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | bash
#- name: Setup Debug Session
# uses: P3TERX/debugger-action@master
- name: Install Repo
run: |
git clone https://github.com/friendlyarm/repo
sudo cp repo/repo /usr/bin/
- name: Download Source
run: |
rm -rf friendlywrt-rk3328
mkdir friendlywrt-rk3328
cd friendlywrt-rk3328
repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v19.07.1 -m rk3328.xml --repo-url=https://github.com/friendlyarm/repo --no-clone-bundle
repo sync -c --no-clone-bundle -j8
- name: Merge LEDE
run: |
cd friendlywrt-rk3328
git clone https://github.com/coolsnowwolf/lede
cd friendlywrt
cp -r ../lede/package/lean package/
sed -i 's/^src-git luci.*/src-git luci https:\/\/github.com\/coolsnowwolf\/luci/' feeds.conf.default
sed -i 's/^src-git packages.*/src-git packages https:\/\/github.com\/coolsnowwolf\/packages/' feeds.conf.default
- name: Install Extra Packages
run: |
cd friendlywrt-rk3328/friendlywrt/package
git clone https://github.com/frainzy1477/luci-app-clash
sed -i 's/SUBMENU:=2. Clash/SUBMENU:=3. Applications/' luci-app-clash/Makefile
git clone https://github.com/rufengsuixing/luci-app-adguardhome
git clone https://github.com/fw876/helloworld
mv helloworld/luci-app-ssr-plus/ .
rm -rf helloworld/
rm -rf lean/luci-theme-argon
git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git
git clone -b master https://github.com/vernesong/OpenClash
mv OpenClash/luci-app-openclash/ .
rm -rf OpenClash/
git clone https://github.com/songchenwen/nanopi-r2s
mv nanopi-r2s/luci-app-r2sflasher/ .
rm -rf nanopi-r2s/
git clone https://github.com/pymumu/smartdns.git
mv smartdns smartdns1
mv smartdns1/package/openwrt .
mv openwrt smartdns
rm -rf smartdns1
cp -r ../../../package/luci-app-smartdns .
- name: Install Clash Binaries
run: |
cd friendlywrt-rk3328/friendlywrt/package/base-files/files
mkdir -p etc/clash
wget -qO- https://github.com/Dreamacro/clash/releases/download/v1.0.0/clash-linux-armv8-v1.0.0.gz | gunzip -c > etc/clash/clash
chmod +x etc/clash/clash
mkdir -p etc/openclash/core
cp etc/clash/clash etc/openclash/core/
mkdir -p usr/share/clash
echo 1.0.0 > usr/share/clash/core_version
- name: Update Target.mk
run: |
cd friendlywrt-rk3328/friendlywrt/include
sed -i 's/dnsmasq /dnsmasq-full default-settings luci /' target.mk
- name: Update Feeds
run: |
cd friendlywrt-rk3328/friendlywrt
./scripts/feeds update -a
./scripts/feeds install -a
- name: Install Mods
run: |
cd friendlywrt-rk3328
sed -i '/STAMP_BUILT/d' friendlywrt/feeds/packages/utils/runc/Makefile
sed -i '/STAMP_BUILT/d' friendlywrt/feeds/packages/utils/containerd/Makefile
wget -O friendlywrt/package/feeds/packages/zstd/Makefile https://raw.githubusercontent.com/coolsnowwolf/packages/89080f226affe0815c7fb8ff77f3f2d53058e9ec/utils/zstd/Makefile
wget -O friendlywrt/package/kernel/kmod-sched-cake/Makefile https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/kmod-sched-cake-oot/Makefile
#cp ../patches/31-usb_wifi friendlywrt/package/base-files/files/etc/hotplug.d/usb/31-usb_wifi
sed -i "/redirect_https/d" friendlywrt/package/network/services/uhttpd/files/uhttpd.config
sed -i '/Load Average/i\\t\t<tr><td width="33%"><%:CPU Temperature%></td><td><%=luci.sys.exec("cut -c1-2 /sys/class/thermal/thermal_zone0/temp")%><span>℃</span></td></tr>' friendlywrt/feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
sed -i 's/pcdata(boardinfo.system or "?")/"ARMv8"/' friendlywrt/feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
sed -i 's/services/vpn/g' friendlywrt/package/feeds/luci/luci-app-openvpn/luasrc/controller/openvpn.lua
- name: Patch Kernel
run: |
cd friendlywrt-rk3328/kernel/
git apply ../../patches/001-add-full_cone_nat.patch
- name: Custom Configure Files
run: |
rm -f friendlywrt-rk3328/friendlywrt/.config*
cp r2s-rk3328-config friendlywrt-rk3328/configs/config_rk3328
- name: Set Default Values
run: |
cd friendlywrt-rk3328/friendlywrt
sed -i '/uci commit luci/i\uci set luci.main.mediaurlbase=/luci-static/argon' package/lean/default-settings/files/zzz-default-settings
- name: Install UPX
run: |
ln -s /usr/bin/upx-ucl friendlywrt-rk3328/friendlywrt/staging_dir/host/bin/upx
- name: Build OpenWrt
run: |
cd friendlywrt-rk3328
sed -i 's/set -eu/set -u/' scripts/mk-friendlywrt.sh
./build.sh nanopi_r2s.mk
- name: Fix Rootfs Owner and Group
run: |
sudo df -lh
lodev=$(sudo losetup -f)
echo "found unused loop dev $lodev"
sudo losetup -o 100663296 $lodev friendlywrt-rk3328/out/*.img
sudo rm -rf /mnt/friendlywrt-tmp
sudo mkdir -p /mnt/friendlywrt-tmp
sudo mount $lodev /mnt/friendlywrt-tmp
sudo chown -R root:root /mnt/friendlywrt-tmp
sudo umount /mnt/friendlywrt-tmp
sudo losetup -d $lodev
- name: Assemble Artifact
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
find friendlywrt-rk3328/out/ -name "FriendlyWrt_*img*" | xargs -I{} sh -c 'f=$(basename $1); zip -r -j "./artifact/${f}.zip" $1' sh {} \;
#find friendlywrt-rk3328/friendlywrt/bin/targets/rockchip-rk3328/generic -name "openwrt*-squashfs.img" | xargs -I{} sh -c 'f=$(basename $1); zip -r -j "./artifact/${f}.zip" $1' sh {} \;
cp friendlywrt-rk3328/friendlywrt/.config ./artifact/
- name: Upload Artifact
uses: actions/upload-artifact@master
with:
name: FriendlyWrt_NanoPi-R2S RK3328 v19.07
path: ./artifact/