2424 kernel_version :
2525 required : true
2626 type : string
27-
27+ ksun_branch :
28+ required : true
29+ type : string
30+ default : stable
31+
2832jobs :
2933 build-kernel-oneplus-kernelsu-susfs :
3034 runs-on : ubuntu-latest
@@ -89,11 +93,11 @@ jobs:
8993
9094 ANYKERNEL_BRANCH="gki-2.0"
9195 SUSFS_BRANCH="gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}"
92-
96+
9397 # Debug print the branches
9498 echo "Using branch for AnyKernel3: $ANYKERNEL_BRANCH"
9599 echo "Using branch for SUSFS: $SUSFS_BRANCH"
96-
100+
97101 # Clone repositories using the branch names
98102 git clone https://github.com/TheWildJames/AnyKernel3.git -b "$ANYKERNEL_BRANCH"
99103 git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH"
@@ -113,19 +117,20 @@ jobs:
113117 $REPO --version
114118 $REPO --trace sync -c --no-clone-bundle --no-tags --optimized-fetch -j$(nproc --all) --fail-fast
115119
116- - name : Add KernelSU
120+ - name : Add KernelSU Next
117121 run : |
118122 echo "Changing to configuration directory: $CONFIG..."
119123 cd "$CONFIG/kernel_platform"
120124
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
123132
124133 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
129134
130135 - name : Apply SUSFS Patches
131136 run : |
@@ -141,9 +146,29 @@ jobs:
141146
142147 cd ./KernelSU-Next
143148
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
147172
148173 # Change to common directory and apply SUSFS patch
149174 cd ../common
@@ -152,11 +177,11 @@ jobs:
152177 fi
153178 patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
154179
155- - name : Apply KSU Hooks
180+ - name : Apply KSUN Hooks
156181 run : |
157182 echo "Changing to configuration directory: $CONFIG..."
158183 cd "$CONFIG/kernel_platform/common"
159- # Apply additional patch
184+ echo "Applying KSUN Hooks..."
160185 cp ../../../kernel_patches/next/syscall_hooks.patch ./
161186 patch -p1 --fuzz=3 < ./syscall_hooks.patch
162187
@@ -174,7 +199,7 @@ jobs:
174199 cd "$CONFIG/kernel_platform"
175200
176201 echo "Adding configuration settings to gki_defconfig..."
177-
202+
178203 # Add KSU configuration settings
179204 echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig
180205 echo "CONFIG_KSU_WITH_KPROBES=n" >> ./common/arch/arm64/configs/gki_defconfig
@@ -207,22 +232,22 @@ jobs:
207232 cd "$CONFIG/kernel_platform"
208233
209234 echo "Running sed commands..."
210-
235+
211236 sed -i 's/CONFIG_LTO=n/CONFIG_LTO=y/' "./common/arch/arm64/configs/gki_defconfig"
212237 sed -i 's/CONFIG_LTO_CLANG_FULL=y/CONFIG_LTO_CLANG_THIN=y/' "./common/arch/arm64/configs/gki_defconfig"
213238 sed -i 's/CONFIG_LTO_CLANG_NONE=y/CONFIG_LTO_CLANG_THIN=y/' "./common/arch/arm64/configs/gki_defconfig"
214239
215240 # Run sed commands for modifications
216241 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
220245 sed -i "/stable_scmversion_cmd/s/-maybe-dirty//g" ./build/kernel/kleaf/impl/stamp.bzl || echo "No stamp.bzl!"
221246 sed -i 's/-dirty//' ./common/scripts/setlocalversion
222247 sed -i 's/-dirty//' ./msm-kernel/scripts/setlocalversion
223248 sed -i 's/-dirty//' ./external/dtc/scripts/setlocalversion
224249 sed -i 's/-dirty//' ./build/kernel/kleaf/workspace_status_stamp.py || echo "No workspace_status_stamp.py!"
225-
250+
226251 sed -i '/echo "LTO $LTO "/i export LTO=thin' ./oplus/build/oplus_setup.sh
227252 sed -i 's/export REPACK_IMG=true/export REPACK_IMG=false/g' ./oplus/build/oplus_setup.sh
228253
@@ -277,7 +302,7 @@ jobs:
277302 run : |
278303 echo "Changing to configuration directory: $CONFIG..."
279304 cd "$CONFIG"
280-
305+
281306 echo "Copying Image"
282307 cp ./out/dist/Image ../AnyKernel3/Image
283308 if [ "${{ inputs.model }}" == "OPAce5Pro" ]; then
@@ -291,7 +316,7 @@ jobs:
291316 run : |
292317 echo "Navigating to AnyKernel3 directory..."
293318 cd ./AnyKernel3
294-
319+
295320 # Zip the files in the AnyKernel3 directory with a new naming convention
296321 ZIP_NAME="${{ inputs.model }}_${{ inputs.android_version }}_${{ inputs.kernel_version }}_Next_SUSFS_AnyKernel3.zip"
297322 echo "Creating zip file $ZIP_NAME..."
0 commit comments