-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (88 loc) · 4.83 KB
/
rockchip-m4.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
name: Build NanoPi M4
on:
workflow_dispatch:
jobs:
build:
name: Build rockchip m4
runs-on: ubuntu-24.04
steps:
- name: Setup Ubuntu
run: |
sudo apt update
sudo apt install -y subversion build-essential gettext 2to3 python3-pyelftools python3-distutils-extra
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.5'
cache: false
- name: Go Version
run: go version
- name: checkout
uses: actions/checkout@v4
- name: Build
run: |
git clone https://github.com/immortalwrt/immortalwrt.git openwrt
cp -rf r3/m4.patch openwrt/
cd openwrt
wget https://raw.githubusercontent.com/anon540/r3/refs/heads/main/r3/0001-ar.patch
wget https://raw.githubusercontent.com/anon503/r3/refs/heads/main/r3/01-ip-addr.patch
git apply 0001-ar.patch
git apply 01-ip-addr.patch
git apply m4.patch
./scripts/feeds update -a
./scripts/feeds install -a
cd feeds/packages
wget https://patch-diff.githubusercontent.com/raw/openwrt/packages/pull/25783.patch
wget https://gist.githubusercontent.com/mj22226/351f11e66f08f06e37a985719a31ddb4/raw/b35ba7a3aac1949bd6bbeaad065a0a93dc3c34f0/01-cpu.patch
wget https://gist.githubusercontent.com/mj22226/b66f5c1bd5fc7e1cb3cf2c690b5dbd5a/raw/b955e726cbb0948d932c8d6143229ad604320149/20-lxc.patch
git apply 01-cpu.patch
git apply 20-lxc.patch
git apply 25783.patch
cd -
sed -i "71s/'0'/'1'/" feeds/luci/applications/luci-app-statistics/root/etc/config/luci_statistics
sed -i "84s/'0'/'1'/" feeds/luci/applications/luci-app-statistics/root/etc/config/luci_statistics
sed -i "195s/'0'/'1'/" feeds/luci/applications/luci-app-statistics/root/etc/config/luci_statistics
sed -i "212s/'0'/'1'/" feeds/luci/applications/luci-app-statistics/root/etc/config/luci_statistics
sed -i "13s/'1'/'0'/" feeds/packages/utils/dockerd/files/etc/config/dockerd
sed -i "4s/login/login -f root/" feeds/packages/utils/ttyd/files/ttyd.config
./scripts/feeds update -a
./scripts/feeds install -a -f
wget https://github.com/mj22226/openwrt-arm64/releases/download/rockchip-18.1.7/llvm-bpf-18.1.7.Linux-aarch64.tar.zst
tar -xvf llvm-bpf-18.1.7.Linux-aarch64.tar.zst
mv rk-m4 .config
echo 'CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT="/opt/hostedtoolcache/go/1.23.5/arm64/bin"' >> .config
make defconfig
wget https://gist.githubusercontent.com/mj22226/9a69bb754a83e8a5cf03fcc60d62d473/raw/cc6f36831d6098de4a7fccf04a312d36a0dbc999/01-key.patch
git apply 01-key.patch
make download -j32
rm 01-key.patch
mkdir -p files/www/repo
wget https://gist.githubusercontent.com/mj22226/2ce53b7a5e5742be6f9052a4e4d3203d/raw/674531914187c1afa92427ef51e6fa01f95aae3f/feeds-rk.patch
git apply feeds-rk.patch
make -j$(nproc) 'IGNORE_ERRORS=n m' || true
mv bin/packages/aarch64_generic/base/*cpufreq* bin/targets/rockchip/armv8/packages/
make -j$(nproc) package/index V=s
cp -R bin/targets/rockchip/armv8/packages/ files/www/repo/
make -j$(nproc) 'IGNORE_ERRORS=n m' || true
tar -czvf bin/targets/rockchip/armv8/feeds-packages.tar.gz bin/packages || true
tar -czvf bin/targets/rockchip/armv8/packages.tar.gz bin/targets/rockchip/armv8/packages || true
tar -czvf bin/targets/rockchip/armv8/logs.tar.gz logs
rm -rf bin/targets/rockchip/armv8/packages
echo "D=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Delete tag
uses: ClementTsang/delete-tag-and-release@v0.4.0
with:
delete_release: true
tag_name: m4-arm64-6.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
name: NanoPi M4 Firmware Images ${{ env.D }}
tag: m4-arm64-6.6
replacesArtifacts: true
makeLatest: true
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: openwrt/bin/targets/rockchip/armv8/*