|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +DEFCONFIG="vendor/bengal-perf_defconfig" |
| 4 | +ZIPNAME=4.19-A16-valeryn-ksun-3.2.0-`date +'%d.%m.%y-%H%M'`.zip |
| 5 | + |
| 6 | +set -x |
| 7 | + |
| 8 | +# Setup tools |
| 9 | +curl -o toolchain.tar.xz -L https://github.com/Joe7500/Builds/releases/download/Stuff/toolchain.tar.xz || exit 1 |
| 10 | +curl -o AnyKernel3.tar.xz -L https://github.com/Joe7500/Builds/releases/download/Stuff/AnyKernel3.tar.xz || exit 1 |
| 11 | +rm -rf toolchain prebuilts |
| 12 | +tar xf toolchain.tar.xz || exit 1 |
| 13 | +ln -s prebuilts/clang/host/linux-x86/clang-stablekern/ toolchain |
| 14 | +tar xf AnyKernel3.tar.xz || exit 1 |
| 15 | +PATH=$PWD/toolchain/bin:$PATH |
| 16 | + |
| 17 | +# Apply changes |
| 18 | +git cherry-pick 84b385eb683c32beed15194b8c69611b3f35447f || exit 1 |
| 19 | +git cherry-pick 70865a757dfceb92fd0dc7d9074b432086c7b73f || exit 1 |
| 20 | +git cherry-pick 3f72527874b7007742e2dd24d5dc22891c031c3b || exit 1 |
| 21 | +git cherry-pick 5c6b9ed54ab6f3ffb820dfa27c037137e3eeae52 || exit 1 |
| 22 | +git cherry-pick 9beaa41861278b138f028253cdb0b4c5f80ee646 |
| 23 | +grep -vE '<<<|===|>>>' arch/arm64/configs/vendor/bengal-perf_defconfig > arch/arm64/configs/vendor/bengal-perf_defconfig.1 |
| 24 | +mv arch/arm64/configs/vendor/bengal-perf_defconfig.1 arch/arm64/configs/vendor/bengal-perf_defconfig |
| 25 | +git add arch/arm64/configs/vendor/bengal-perf_defconfig |
| 26 | +git cherry-pick --continue --no-edit |
| 27 | + |
| 28 | +curl -o KernelSU-Next-susfs-3.2.0.tar.xz -L https://github.com/Joe7500/valeryn_xiaomi_sm6115/raw/refs/heads/build-actions/KernelSU-Next-susfs-3.2.0.tar.xz || exit 1 |
| 29 | +tar xf KernelSU-Next-susfs-3.2.0.tar.xz |
| 30 | + |
| 31 | +cd KernelSU-Next |
| 32 | +git reset --hard |
| 33 | +git switch legacy-susfs |
| 34 | +git tag 3.2.0-legacy-susfs |
| 35 | +cd .. |
| 36 | +bash KernelSU-Next/kernel/setup.sh 3.2.0-legacy-susfs |
| 37 | + |
| 38 | +echo "CONFIG_KSU=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 39 | +echo "# CONFIG_KPROBES is not set" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 40 | +echo "CONFIG_HAVE_SYSCALL_TRACEPOINTS=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 41 | +echo "CONFIG_KSU_MANUAL_HOOK=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 42 | +echo "CONFIG_KSU_SUSFS=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 43 | +echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 44 | +echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 45 | +echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 46 | +echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 47 | +echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 48 | +echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 49 | +echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 50 | +echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 51 | +echo "CONFIG_KSU_SUSFS_SUS_MAP=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 52 | +if grep -q "THREAD_INFO_IN_TASK" "drivers/kernelsu/Kconfig"; then |
| 53 | + echo "CONFIG_THREAD_INFO_IN_TASK=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 54 | +fi |
| 55 | +echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=n" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 56 | + |
| 57 | +echo "-perf" > localversion |
| 58 | + |
| 59 | +# Build it |
| 60 | +rm -rf out/ |
| 61 | +mkdir out/ |
| 62 | +make O=out ARCH=arm64 LLVM=1 LLVM_IAS=1 $DEFCONFIG |
| 63 | +make O=out ARCH=arm64 LLVM=1 LLVM_IAS=1 -j$(nproc) || exit 1 |
| 64 | +make O=out ARCH=arm64 LLVM=1 LLVM_IAS=1 -j$(nproc) Image.gz || exit 1 |
| 65 | +make O=out ARCH=arm64 LLVM=1 LLVM_IAS=1 -j$(nproc) dtbs || exit 1 |
| 66 | +make O=out ARCH=arm64 LLVM=1 LLVM_IAS=1 -j$(nproc) INSTALL_HDR_PATH=kernel_headers headers_install |
| 67 | + |
| 68 | +# Make anykernel package |
| 69 | +kernel="out/arch/arm64/boot/Image.gz" |
| 70 | +dtbo="out/arch/arm64/boot/dtbo.img" |
| 71 | +dtb="out/arch/arm64/boot/dtb.img" |
| 72 | + |
| 73 | +cp "out/arch/arm64/boot/dtb" "out/arch/arm64/boot/dtb.img" |
| 74 | + |
| 75 | +cp $kernel AnyKernel3 |
| 76 | +cp $dtbo AnyKernel3 |
| 77 | +cp $dtb AnyKernel3 |
| 78 | + |
| 79 | +cd AnyKernel3 |
| 80 | +zip -r9 "../$ZIPNAME" * -x .git *placeholder |
| 81 | +cd .. |
0 commit comments