diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39496ac..c991df3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ on: options: - LineageOS - crdroidandroid - - OnePlus12R-development + - yaap kernel_branch: description: Kernel Branch(such as lineage-23.2 sixteen-qpr1) @@ -36,18 +36,13 @@ on: type: choice options: - None - - Official-KernelSU - - KernelSU-Next - - KernelSU-Next-with-susfs - - KowSU - - ReSukiSU + - KernelSU-by-xx - ReSukiSU-with-susfs - jobs: - SM8550_Kernel_CI: + Kernel_CI: env: - CLANG_VER: clang-r547379 GH_TOKEN: ${{ github.token }} + SOC: sm8150 runs-on: ubuntu-latest permissions: contents: write @@ -80,8 +75,14 @@ jobs: - name: Clone Kernel Source run: | - git clone --depth=1 -b ${{ inputs.kernel_branch }} https://github.com/${{ inputs.kernel_source }}/android_kernel_oneplus_sm8550.git sm8550 - git clone --depth=1 -b ${{ inputs.kernel_branch }} https://github.com/${{ inputs.kernel_source }}/android_kernel_oneplus_sm8550-modules.git sm8550-modules + case "${{ inputs.kernel_source }}" in + "yaap") + git clone --depth=1 -b ${{ inputs.kernel_branch }} https://github.com/yaap/kernel_oneplus_${SOC}.git ${SOC} + ;; + *) + git clone --depth=1 -b ${{ inputs.kernel_branch }} https://github.com/${{ inputs.kernel_source }}/android_kernel_oneplus_${SOC}.git ${SOC} + ;; + esac - name: Download AOSP Clang run: | @@ -109,75 +110,71 @@ jobs: export OBJCOPY="${CLANG_ROOT}/llvm-objcopy" export OBJDUMP="${CLANG_ROOT}/llvm-objdump" export STRIP="${CLANG_ROOT}/llvm-strip" + export CROSS_COMPILE=aarch64-linux-gnu- - cd sm8550 + cd ${SOC} case "${{ inputs.ksu_type }}" in "None") ;; - "Official-KernelSU") - curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main - ;; - - "KowSU") - curl -LSs "https://raw.githubusercontent.com/KOWX712/KernelSU/main/kernel/setup.sh" | bash -s master + "KernelSU-by-xx") + curl -LSs "https://raw.githubusercontent.com/backslashxx/KernelSU/refs/heads/master/kernel/setup.sh" | bash -s master ;; + "ReSukiSU-with-susfs") + curl -LSs "https://raw.githubusercontent.com/ReSukiSU/ReSukiSU/main/kernel/setup.sh" | bash -s main + esac - "KernelSU-Next") - curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -s dev - ;; + touch ./.scmversion + + if [[ "${{ inputs.ksu_type }}" == *susfs ]]; then + curl -Lo susfs.patch https://raw.githubusercontent.com/JackA1ltman/NonGKI_Kernel_Build_2nd/refs/heads/mainline/Patches/Patch/susfs_patch_to_4.14.patch + curl -Lo inline.sh https://raw.githubusercontent.com/JackA1ltman/NonGKI_Kernel_Build_2nd/refs/heads/mainline/Patches/susfs_inline_hook_patches.sh + patch -p1 < susfs.patch + bash inline.sh + + echo "CONFIG_KSU=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=n" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + echo "CONFIG_KSU_SUSFS_SUS_MAP=y" >> arch/arm64/configs/vendor/sm8150-perf_defconfig + fi - "KernelSU-Next-with-susfs") - curl -LSs "https://raw.githubusercontent.com/pershoot/KernelSU-Next/refs/heads/dev-susfs/kernel/setup.sh" | bash -s dev-susfs + case "${{ inputs.kernel_source }}" in + "yaap") + make O=out gulch_defconfig vendor/debugfs.config ;; - - "ReSukiSU"|"ReSukiSU-with-susfs") - curl -LSs "https://raw.githubusercontent.com/ReSukiSU/ReSukiSU/main/kernel/setup.sh" | bash -s builtin + *) + make O=out vendor/sm8150-perf_defconfig vendor/oplus.config ;; esac - - if [[ "${{ inputs.ksu_type }}" == *susfs ]]; then - git clone -b gki-android13-5.15 https://gitlab.com/simonpunk/susfs4ksu.git susfs - cd susfs - cp ./kernel_patches/50_add_susfs_in_gki-android13-5.15.patch .. - cp ./kernel_patches/fs/* ../fs/ - cp ./kernel_patches/include/linux/* ../include/linux/ - cd .. - patch -p1 < 50_add_susfs_in_gki-android13-5.15.patch - echo "CONFIG_KSU_SUSFS=y" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=n" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> arch/arm64/configs/gki_defconfig - echo "CONFIG_KSU_SUSFS_SUS_MAP=y" >> arch/arm64/configs/gki_defconfig + + if [[ "${{ inputs.ksu_type }}" == "KernelSU-by-xx" ]]; then + echo "CONFIG_KSU_TAMPER_SYSCALL_TABLE=y" >> out/.config fi - touch ./.scmversion - - echo "CONFIG_TMPFS_XATTR=y" >> arch/arm64/configs/gki_defconfig - make O=out gki_defconfig vendor/kalama_GKI.config vendor/oplus/kalama_GKI.config vendor/debugfs.config - make -j2 O=out Image - name: Make AnyKernel3 run: | ZIP_NAME="${{ inputs.ksu_type }}_$(date -u +"%Y%m%d_%H%M")" git clone https://github.com/Kernel-SU/AnyKernel3.git - - cp sm8550/out/arch/arm64/boot/Image AnyKernel3/Image - cp sm8550/out/arch/arm64/boot/Image ./Image + cp ${SOC}/out/arch/arm64/boot/Image AnyKernel3/Image + cp ${SOC}/out/arch/arm64/boot/Image ./Image cd AnyKernel3 - + sed -i "s|ksu_supported=false|ksu_supported=true|" anykernel.sh + zip -r9 ../"${ZIP_NAME}.zip" * -x .git - name: Create GitHub Release run: | - REL_NAME="OPSM8550_${{ inputs.kernel_source }}-${{ inputs.kernel_branch }}_${{ inputs.ksu_type }}_$(date -u +"%Y%m%d_%H%M")" + REL_NAME="${SOC}_${{ inputs.kernel_source }}-${{ inputs.kernel_branch }}_${{ inputs.ksu_type }}_$(date -u +"%Y%m%d_%H%M")" cd ${GITHUB_WORKSPACE} ZIP_FILE=$(ls *.zip) gh release create "$REL_NAME" --title "$REL_NAME" --notes "" "${ZIP_FILE}" Image