-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (65 loc) · 3.27 KB
/
build.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
name: Build Huawei-Sydney-KSU-Kernel
on:
workflow_dispatch:
schedule:
# Run once at 12:00 on Saturday.. See http://crontab.guru
- cron: '00 12 * * 6'
push:
branches:
- HEAD
pull_request:
branches:
- HEAD
jobs:
build:
runs-on: ubuntu-20.04
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
CCACHE_HARDLINK: "true"
KERNEL_CMDLINE: "ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=out"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: 100
- name: Set up ccache
uses: hendrikmuhs/[email protected]
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt install binutils make python2 libssl-dev flex unzip libssl-dev ca-certificates xz-utils mkbootimg cpio device-tree-compiler git git-lfs bc bison build-essential ccache curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libelf-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev adb fastboot -y
git clone https://github.com/Coconutat/ToolChains.git --dept=1 -b linaro_gcc_4.9
- name: GetTime
id: get_time
run: |
echo "TIME=$(TZ=UTC-8 date +%m%d%H%M )" >> $GITHUB_OUTPUT
- name: Build Kernel
run: |
sudo ln -sf /usr/bin/python2.7 /usr/bin/python
if [ -d include/config ];
then
echo "Find config,will remove it"
rm -rf include/config
else
echo "No Config,good."
fi
rm -rf KernelSU
rm -rf drivers/kernelsu
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main
export PATH=$(pwd)/ToolChains/bin/:$PATH
export ARCH=arm64
export SUBARCH=arm64
make $KERNEL_CMDLINE merge_kirin710_defconfig
make $KERNEL_CMDLINE -j$(nproc --all)
tools/mkbootimg --kernel out/arch/arm64/boot/Image.gz --base 0x0 --cmdline "loglevel=4 initcall_debug=n page_tracker=on unmovable_isolate1=2:192M,3:224M,4:256M printktimer=0xfff0a000,0x534,0x538 androidboot.selinux=enforcing buildvariant=user" --tags_offset 0x07988000 --kernel_offset 0x00008000 --ramdisk_offset 0x07b88000 --header_version 1 --os_version 9.0.0 --os_patch_level 2019-07 --output sydney_KSU-enforcing-${{ steps.get_time.outputs.TIME }}.img
tools/mkbootimg --kernel out/arch/arm64/boot/Image.gz --base 0x0 --cmdline "loglevel=4 initcall_debug=n page_tracker=on unmovable_isolate1=2:192M,3:224M,4:256M printktimer=0xfff0a000,0x534,0x538 androidboot.selinux=permissive buildvariant=user" --tags_offset 0x07988000 --kernel_offset 0x00008000 --ramdisk_offset 0x07b88000 --header_version 1 --os_version 9.0.0 --os_patch_level 2019-07 --output sydney_KSU-permissive-${{ steps.get_time.outputs.TIME }}.img
- name: Upload Sydney-KSU-Kernel
uses: actions/upload-artifact@v3
with:
name: sydney_KSU-kernel-${{ steps.get_time.outputs.TIME }}
path: |
sydney_KSU-*.img
out/.config