Build KernelSU Next SUSFS #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build KernelSU Next SUSFS | |
on: | |
workflow_dispatch: | |
inputs: | |
CPU: | |
description: "分支" | |
required: true | |
default: 'sm7675' | |
FEIL: | |
description: "配置文件" | |
required: true | |
default: 'oneplus_ace_3v_v' | |
CPUD: | |
description: "处理器代号" | |
required: true | |
default: 'pineapple' | |
ANDROID_VERSION: | |
description: "内核安卓版本" | |
required: true | |
default: 'android14' | |
KERNEL_VERSION: | |
description: "内核版本" | |
required: true | |
default: '6.1' | |
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 "wuua" | |
git config --global user.email "[email protected]" | |
- 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 and 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 | |
- name: Set up KernelSU Next | |
run: | | |
cd kernel_workspace/kernel_platform | |
curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash -s next | |
cd KernelSU-Next | |
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 | |
run: | | |
cd kernel_workspace | |
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }} | |
git clone https://github.com/TheWildJames/kernel_patches.git | |
cd kernel_platform | |
cp ../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./KernelSU-Next/ | |
cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch ./common/ | |
cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/ | |
cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/ | |
# Apply patches | |
cd ./KernelSU-Next | |
patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true | |
cd ../common | |
patch -p1 < 50_add_susfs_in_gki-${{ github.event.inputs.ANDROID_VERSION }}-${{ github.event.inputs.KERNEL_VERSION }}.patch || true | |
cp ../../kernel_patches/69_hide_stuff.patch ./ | |
patch -p1 -F 3 < 69_hide_stuff.patch | |
cd .. | |
cp ../kernel_patches/apk_sign.c_fix.patch ./ | |
patch -p1 -F 3 < apk_sign.c_fix.patch | |
cp ../kernel_patches/core_hook.c_fix.patch ./ | |
patch -p1 --fuzz=3 < ./core_hook.c_fix.patch | |
cp ../kernel_patches/selinux.c_fix.patch ./ | |
patch -p1 -F 3 < selinux.c_fix.patch | |
# Add configuration settings for SUSFS | |
echo "Adding configuration settings to gki_defconfig..." | |
echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig | |
echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig | |
- 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_KernelSU_Next_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} | |
path: ./AnyKernel3/* | |
- name: Upload boot.img | |
uses: actions/upload-artifact@v4 | |
with: | |
name: boot_KernelSU_Next_${{ env.KSUVER }}_${{ github.event.inputs.FEIL }} | |
path: kernel_workspace/kernel_platform/out/msm-kernel-${{ github.event.inputs.CPUD }}-gki/dist/boot.img |