forked from Numbersf/Action-KernelSU-Next
-
Notifications
You must be signed in to change notification settings - Fork 8
115 lines (104 loc) · 4.48 KB
/
MKerneISU-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
name: Build MKSU-SUSFS For OnePlus Kernel 6.1 Devices
on:
workflow_dispatch:
inputs:
CPU:
description: "处理器分支"
required: true
default: 'sm8650'
FEIL:
description: "配置文件"
required: true
default: 'oneplus_ace5'
CPUD:
description: "处理器代号"
required: true
default: 'pineapple'
SUSFS_ENABLED:
description: "添加 SUSFS"
required: true
type: boolean
default: true
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 "liw378721@gmail.com"
- 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 和 sync
run: |
mkdir kernel_workspace && cd kernel_workspace
repo init -u https://github.com/OnePlusOSS/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
sed -i 's/ -dirty//g' kernel_platform/external/dtc/scripts/setlocalversion
- name: Set up MKSU
run: |
cd kernel_workspace/kernel_platform
curl -LSs "https://raw.githubusercontent.com/5ec1cff/KernelSU/refs/heads/main/kernel/setup.sh" | bash -
cd KernelSU
git revert -m 1 $(git log --grep="remove devpts hook" --pretty=format:"%h") -n
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
if: github.event.inputs.SUSFS_ENABLED == 'true'
run: |
cd kernel_workspace
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-android14-6.1
git clone https://github.com/TanakaLun/kernel_patches4mksu.git
cd kernel_platform
cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU/
cp ../kernel_patches4mksu/mksu_susfs.patch ./KernelSU/
cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-android14-6.1.patch ./common/
cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/
cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
# Apply patches
cd ./KernelSU
patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true
patch -p1 --forward < mksu_susfs.patch || true
cd ../common
patch -p1 < 50_add_susfs_in_gki-android14-6.1.patch || true
cp ../../kernel_patches4mksu/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 ..
- 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_MKSU_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }}
path: ./AnyKernel3/*