Skip to content

Commit 3852441

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

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,34 @@ 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+
set -x
142+
susfs_version=$(grep '#define SUSFS_VERSION' ../common/include/linux/susfs.h | awk -F'"' '{print $2}')
143+
echo "SUSVER=$susfs_version" >> $GITHUB_ENV
144144
BASE_VERSION=10200
145-
cd ./kernel
146-
KSU_VERSION=$(expr $(/usr/bin/git rev-list --count HEAD) "+" $BASE_VERSION)
145+
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)
147146
echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
148-
sed -i "s/DKSU_VERSION=11998/DKSU_VERSION=${KSU_VERSION}/" Makefile
147+
set +x
148+
echo "KernelSU Next Version: $KSU_VERSION"
149+
echo "SusFS Version: $susfs_version"
150+
151+
case "$susfs_version" in
152+
"v1.5.7")
153+
cp ../../../kernel_patches/next/ksun_susfs_v1.5.7_patch_12647+.patch ./ksun_susfs_latest.patch
154+
;;
155+
"v1.5.8")
156+
# cp ../../../kernel_patches/next/0001-kernel-implement-susfs-v1.5.8-KernelSU-Next-v1.0.8.patch ./ksun_susfs_latest.patch
157+
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
158+
;;
159+
*)
160+
echo "Invalid version: $susfs_version"
161+
exit 1
162+
;;
163+
esac
164+
patch -p1 --forward < ksun_susfs_latest.patch || true
165+
149166
150167
# Change to common directory and apply SUSFS patch
151-
cd ../../common
168+
cd ../common
152169
if [ "${{ inputs.android_version }}" = "android15" ] && [ "${{ inputs.kernel_version }}" = "6.6" ]; then
153170
if ! grep -qxF '#include <trace/hooks/fs.h>' ./fs/namespace.c; then
154171
sed -i '/#include <trace\/hooks\/blk.h>/a #include <trace\/hooks\/fs.h>' ./fs/namespace.c
@@ -339,7 +356,7 @@ jobs:
339356
cd ./AnyKernel3
340357
341358
# 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"
359+
ZIP_NAME="${{ inputs.model }}_${{ inputs.android_version }}_${{ inputs.kernel_version }}_Next_${{ env.KSUVER }}_SUSFS_$susfs_version_AnyKernel3.zip"
343360
echo "Creating zip file $ZIP_NAME..."
344361
zip -r "../$ZIP_NAME" ./*
345362

0 commit comments

Comments
 (0)