24
24
kernel_version :
25
25
required : true
26
26
type : string
27
-
27
+ ksun_branch :
28
+ required : true
29
+ type : string
30
+ default : stable
31
+
28
32
jobs :
29
33
build-kernel-oneplus-kernelsu-susfs :
30
34
runs-on : ubuntu-latest
@@ -89,11 +93,11 @@ jobs:
89
93
90
94
ANYKERNEL_BRANCH="gki-2.0"
91
95
SUSFS_BRANCH="gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}"
92
-
96
+
93
97
# Debug print the branches
94
98
echo "Using branch for AnyKernel3: $ANYKERNEL_BRANCH"
95
99
echo "Using branch for SUSFS: $SUSFS_BRANCH"
96
-
100
+
97
101
# Clone repositories using the branch names
98
102
git clone https://github.com/TheWildJames/AnyKernel3.git -b "$ANYKERNEL_BRANCH"
99
103
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH"
@@ -113,19 +117,20 @@ jobs:
113
117
$REPO --version
114
118
$REPO --trace sync -c --no-clone-bundle --no-tags --optimized-fetch -j$(nproc --all) --fail-fast
115
119
116
- - name : Add KernelSU
120
+ - name : Add KernelSU Next
117
121
run : |
118
122
echo "Changing to configuration directory: $CONFIG..."
119
123
cd "$CONFIG/kernel_platform"
120
124
121
- echo "Adding KernelSU..."
122
- curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s next
125
+ echo "Adding KernelSU Next..."
126
+
127
+ if [ "${{ inputs.ksun_branch }}" == "stable" ]; then
128
+ curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -
129
+ else
130
+ curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s ${{ inputs.ksun_branch }}
131
+ fi
123
132
124
133
git submodule update --init --recursive
125
- cd KernelSU-Next/kernel
126
- KSU_VERSION=$(expr $(/usr/bin/git rev-list --count HEAD) "+" 10200)
127
- echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
128
- sed -i "s/DKSU_VERSION=11998/DKSU_VERSION=${KSU_VERSION}/" Makefile
129
134
130
135
- name : Apply SUSFS Patches
131
136
run : |
@@ -141,22 +146,42 @@ jobs:
141
146
142
147
cd ./KernelSU-Next
143
148
144
- echo "Applying next SUSFS patches..."
145
- cp ../../../kernel_patches/next/0001-kernel-patch-susfs-v1.5.5-to-KernelSU-Next-v1.0.5.patch ./
146
- patch -p1 --forward < 0001-kernel-patch-susfs-v1.5.5-to-KernelSU-Next-v1.0.5.patch || true
149
+ if [ "${{ inputs.ksun_branch }}" == "stable" ] || [ "${{ inputs.ksun_branch }}" == "next" ]; then
150
+ echo "Applying next SUSFS patches..."
151
+ cp ../../../kernel_patches/next/kernel-patch-susfs-v1.5.7-to-KernelSU-Next.patch ./ksun_susfs_latest.patch
152
+ patch -p1 --forward < ksun_susfs_latest.patch || true
153
+ fi
154
+
155
+ # Determine base version based on branch
156
+ if [ "${{ inputs.ksun_branch }}" == "stable" ]; then
157
+ BASE_VERSION=10200
158
+ elif [ "${{ inputs.ksun_branch }}" == "next" ]; then
159
+ BASE_VERSION=10200
160
+ elif [ "${{ inputs.ksun_branch }}" == "next-susfs" ]; then
161
+ BASE_VERSION=10198
162
+ elif [ "${{ inputs.ksun_branch }}" == "next-susfs-dev" ]; then
163
+ BASE_VERSION=10198
164
+ else
165
+ BASE_VERSION=10200
166
+ fi
167
+
168
+ cd ./kernel
169
+ KSU_VERSION=$(expr $(/usr/bin/git rev-list --count HEAD) "+" $BASE_VERSION)
170
+ echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
171
+ sed -i "s/DKSU_VERSION=11998/DKSU_VERSION=${KSU_VERSION}/" Makefile
147
172
148
173
# Change to common directory and apply SUSFS patch
149
- cd ../common
174
+ cd ../../ common
150
175
if [ "${{ inputs.soc }}" == "sun" ]; then
151
176
sed -i '/#include <trace\/hooks\/blk.h>/a #include <trace/hooks/fs.h>' ./fs/namespace.c
152
177
fi
153
178
patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
154
179
155
- - name : Apply KSU Hooks
180
+ - name : Apply KSUN Hooks
156
181
run : |
157
182
echo "Changing to configuration directory: $CONFIG..."
158
183
cd "$CONFIG/kernel_platform/common"
159
- # Apply additional patch
184
+ echo "Applying KSUN Hooks..."
160
185
cp ../../../kernel_patches/next/syscall_hooks.patch ./
161
186
patch -p1 --fuzz=3 < ./syscall_hooks.patch
162
187
@@ -174,7 +199,7 @@ jobs:
174
199
cd "$CONFIG/kernel_platform"
175
200
176
201
echo "Adding configuration settings to gki_defconfig..."
177
-
202
+
178
203
# Add KSU configuration settings
179
204
echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig
180
205
echo "CONFIG_KSU_WITH_KPROBES=n" >> ./common/arch/arm64/configs/gki_defconfig
@@ -207,22 +232,22 @@ jobs:
207
232
cd "$CONFIG/kernel_platform"
208
233
209
234
echo "Running sed commands..."
210
-
235
+
211
236
sed -i 's/CONFIG_LTO=n/CONFIG_LTO=y/' "./common/arch/arm64/configs/gki_defconfig"
212
237
sed -i 's/CONFIG_LTO_CLANG_FULL=y/CONFIG_LTO_CLANG_THIN=y/' "./common/arch/arm64/configs/gki_defconfig"
213
238
sed -i 's/CONFIG_LTO_CLANG_NONE=y/CONFIG_LTO_CLANG_THIN=y/' "./common/arch/arm64/configs/gki_defconfig"
214
239
215
240
# Run sed commands for modifications
216
241
sed -i 's/check_defconfig//' ./common/build.config.gki
217
- sed -i '$s|echo "\$res"|echo "\$res-Wild+ "|' ./common/scripts/setlocalversion
218
- sed -i '$s|echo "\$res"|echo "\$res-Wild+ "|' ./msm-kernel/scripts/setlocalversion
219
- sed -i '$s|echo "\$res"|echo "\$res-Wild+ "|' ./external/dtc/scripts/setlocalversion
242
+ sed -i '$s|echo "\$res"|echo "\$res-Wild"|' ./common/scripts/setlocalversion
243
+ sed -i '$s|echo "\$res"|echo "\$res-Wild"|' ./msm-kernel/scripts/setlocalversion
244
+ sed -i '$s|echo "\$res"|echo "\$res-Wild"|' ./external/dtc/scripts/setlocalversion
220
245
sed -i "/stable_scmversion_cmd/s/-maybe-dirty//g" ./build/kernel/kleaf/impl/stamp.bzl || echo "No stamp.bzl!"
221
246
sed -i 's/-dirty//' ./common/scripts/setlocalversion
222
247
sed -i 's/-dirty//' ./msm-kernel/scripts/setlocalversion
223
248
sed -i 's/-dirty//' ./external/dtc/scripts/setlocalversion
224
249
sed -i 's/-dirty//' ./build/kernel/kleaf/workspace_status_stamp.py || echo "No workspace_status_stamp.py!"
225
-
250
+
226
251
sed -i '/echo "LTO $LTO "/i export LTO=thin' ./oplus/build/oplus_setup.sh
227
252
sed -i 's/export REPACK_IMG=true/export REPACK_IMG=false/g' ./oplus/build/oplus_setup.sh
228
253
@@ -277,7 +302,7 @@ jobs:
277
302
run : |
278
303
echo "Changing to configuration directory: $CONFIG..."
279
304
cd "$CONFIG"
280
-
305
+
281
306
echo "Copying Image"
282
307
cp ./out/dist/Image ../AnyKernel3/Image
283
308
if [ "${{ inputs.model }}" == "OPAce5Pro" ]; then
@@ -291,7 +316,7 @@ jobs:
291
316
run : |
292
317
echo "Navigating to AnyKernel3 directory..."
293
318
cd ./AnyKernel3
294
-
319
+
295
320
# Zip the files in the AnyKernel3 directory with a new naming convention
296
321
ZIP_NAME="${{ inputs.model }}_${{ inputs.android_version }}_${{ inputs.kernel_version }}_Next_SUSFS_AnyKernel3.zip"
297
322
echo "Creating zip file $ZIP_NAME..."
0 commit comments