Skip to content

Commit 789556a

Browse files
committed
Support patching based on SusFS Version
1 parent bbd6ccb commit 789556a

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,32 @@ jobs:
138138
cd ./KernelSU-Next
139139
140140
echo "Applying next SUSFS patches..."
141-
cp ../../../kernel_patches/next/ksun_susfs_v1.5.7_patch_12647+.patch ./ksun_susfs_latest.patch
142-
patch -p1 --forward < ksun_susfs_latest.patch || true
143-
141+
susfs_version=$(grep '#define SUSFS_VERSION' ../common/include/linux/susfs.h | awk -F'"' '{print $2}')
142+
echo "SUSVER=$susfs_version" >> $GITHUB_ENV
144143
BASE_VERSION=10200
145-
cd ./kernel
146-
KSU_VERSION=$(expr $(/usr/bin/git rev-list --count HEAD) "+" $BASE_VERSION)
144+
KSU_VERSION=$(expr $(curl -sI -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/commits?sha=${{ inputs.ksun_branch }}&per_page=1" | grep -i "link:" | sed -n 's/.*page=\([0-9]*\)>; rel="last".*/\1/p') "+" $BASE_VERSION)
147145
echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
148-
sed -i "s/DKSU_VERSION=11998/DKSU_VERSION=${KSU_VERSION}/" Makefile
146+
echo "KernelSU Next Version: $KSU_VERSION"
147+
echo "SusFS Version: $susfs_version"
148+
149+
case "$susfs_version" in
150+
"v1.5.7")
151+
cp ../../../kernel_patches/next/ksun_susfs_v1.5.7_patch_12647+.patch ./ksun_susfs_latest.patch
152+
;;
153+
"v1.5.8")
154+
# cp ../../../kernel_patches/next/0001-kernel-implement-susfs-v1.5.8-KernelSU-Next-v1.0.8.patch ./ksun_susfs_latest.patch
155+
curl -o ksun_susfs_latest.patch -Ls https://raw.githubusercontent.com/fatalcoder524/kernel_patches_additional/refs/heads/main/0001-kernel-implement-susfs-v1.5.8-KernelSU-Next-v1.0.8.patch
156+
;;
157+
*)
158+
echo "Invalid version: $susfs_version"
159+
exit 1
160+
;;
161+
esac
162+
patch -p1 --forward < ksun_susfs_latest.patch || true
163+
149164
150165
# Change to common directory and apply SUSFS patch
151-
cd ../../common
166+
cd ../common
152167
if [ "${{ inputs.android_version }}" = "android15" ] && [ "${{ inputs.kernel_version }}" = "6.6" ]; then
153168
if ! grep -qxF '#include <trace/hooks/fs.h>' ./fs/namespace.c; then
154169
sed -i '/#include <trace\/hooks\/blk.h>/a #include <trace\/hooks\/fs.h>' ./fs/namespace.c
@@ -336,10 +351,10 @@ jobs:
336351
cp ./out/dist/Image ../AnyKernel3/Image
337352
338353
echo "Navigating to AnyKernel3 directory..."
339-
cd ./AnyKernel3
354+
cd ../AnyKernel3
340355
341356
# Zip the files in the AnyKernel3 directory with a new naming convention
342-
ZIP_NAME="${{ inputs.model }}_${{ inputs.android_version }}_${{ inputs.kernel_version }}_Next_SUSFS_AnyKernel3.zip"
357+
ZIP_NAME="AnyKernel3_${{ inputs.model }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}_Next_${{ env.KSUVER }}_SUSFS_${{ env.SUSVER }}.zip"
343358
echo "Creating zip file $ZIP_NAME..."
344359
zip -r "../$ZIP_NAME" ./*
345360

0 commit comments

Comments
 (0)