forked from Laomaoi/Action-KernelSU-Next
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (113 loc) · 5.06 KB
/
Build-KernelSU-Next-SUSFS.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
name: Build KernelSU Next SUSFS
on:
workflow_dispatch:
inputs:
CPU:
description: "分支"
required: true
default: 'sm7675'
FEIL:
description: "配置文件"
required: true
default: 'oneplus_ace_3v_v'
CPUD:
description: "处理器代号"
required: true
default: 'pineapple'
ANDROID_VERSION:
description: "内核安卓版本"
required: true
default: 'android14'
KERNEL_VERSION:
description: "内核版本"
required: true
default: '6.1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 8192
temp-reserve-mb: 2048
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: Configure Git
run: |
git config --global user.name "build"
git config --global user.email "[email protected]"
- name: Install dependencies
run: |
sudo apt update && sudo apt upgrade -y
sudo apt install -y python3 git curl
- name: Install repo tool
run: |
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/repo
chmod a+x ~/repo
sudo mv ~/repo /usr/local/bin/repo
- name: Initialize repo and sync
run: |
mkdir kernel_workspace && cd kernel_workspace
repo init -u https://github.com/morannlx/kernel_manifest.git -b refs/heads/oneplus/${{ github.event.inputs.CPU }} -m ${{ github.event.inputs.FEIL }}.xml --depth=1
repo sync
rm kernel_platform/common/android/abi_gki_protected_exports_* || echo "No protected exports!"
rm kernel_platform/msm-kernel/android/abi_gki_protected_exports_* || echo "No protected exports!"
sed -i 's/ -dirty//g' kernel_platform/common/scripts/setlocalversion
sed -i 's/ -dirty//g' kernel_platform/msm-kernel/scripts/setlocalversion
- name: Set up KernelSU Next
run: |
cd kernel_workspace/kernel_platform
curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash -s next
cd KernelSU-Next
KSU_VERSION=$(expr $(/usr/bin/git rev-list --count HEAD) "+" 10200)
echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
sed -i "s/DKSU_VERSION=16/DKSU_VERSION=${KSU_VERSION}/" kernel/Makefile
- name: Set up susfs
run: |
cd kernel_workspace
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}
git clone https://github.com/TheWildJames/kernel_patches.git
cd kernel_platform
cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/
cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch ./common/
cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/
cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
# Apply patches
cd ./KernelSU-Next
patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true
cd ../common
patch -p1 < 50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch || true
cp ../../kernel_patches/69_hide_stuff.patch ./
patch -p1 -F 3 < 69_hide_stuff.patch
git add -A && git commit -a -m "BUILD Kernel"
cd ..
cd ./msm-kernel && git add -A && git commit -a -m "BUILD Kernel"
cd ..
cp ../kernel_patches/apk_sign.c_fix.patch ./
patch -p1 -F 3 < apk_sign.c_fix.patch
cp ../kernel_patches/core_hook.c_fix.patch ./
patch -p1 --fuzz=3 < ./core_hook.c_fix.patch
cp ../kernel_patches/selinux.c_fix.patch ./
patch -p1 -F 3 < selinux.c_fix.patch
- name: Build kernel
run: |
cd kernel_workspace
./kernel_platform/oplus/build/oplus_build_kernel.sh ${{ github.event.inputs.CPUD }} gki
- name: Make AnyKernel3
run: |
git clone https://github.com/Kernel-SU/AnyKernel3 --depth=1
rm -rf ./AnyKernel3/.git
cp kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/dist/Image ./AnyKernel3/
- name: Upload AnyKernel3
uses: actions/upload-artifact@v4
with:
name: AnyKernel3_KernelSU_Next_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }}
path: ./AnyKernel3/*
- name: Upload Image
uses: actions/upload-artifact@v4
with:
name: Image_KernelSU_Next_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }}
path: kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/dist/Image