Skip to content

Lancelot KSU/APatch Supported A15 Kernel from CRDroid #12

Lancelot KSU/APatch Supported A15 Kernel from CRDroid

Lancelot KSU/APatch Supported A15 Kernel from CRDroid #12

Workflow file for this run

name: Lancelot KSU/APatch Supported A15 Kernel from CRDroid
on:
schedule:
- cron: "0 0 * * 6"
workflow_dispatch:
push:
jobs:
build:
name: Build kernel with KernelSU support.
runs-on: ubuntu-latest
steps:
- name: Preparing build environment
run: |
echo "BUILD_TIME=$(TZ=Europe/Moscow date "+%Y%m%d%H%M")" >> $GITHUB_ENV
sudo apt update
sudo apt install git ccache automake flex lzop bison gperf build-essential zip curl zlib1g-dev g++-multilib libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven libssl-dev pwgen libswitch-perl policycoreutils minicom libxml-sax-base-perl libxml-simple-perl bc libc6-dev-i386 lib32ncurses5-dev libx11-dev lib32z-dev libgl1-mesa-dev xsltproc unzip device-tree-compiler python2 python3
mkdir -p $GITHUB_WORKSPACE/action_dir
- name: Cloning Proton Clang
run: |
cd $GITHUB_WORKSPACE/action_dir
git clone https://github.com/kdrag0n/proton-clang --depth=1
- name: Cloning kernel tree
run: |
cd $GITHUB_WORKSPACE/action_dir
git clone https://github.com/crdroidandroid/android_kernel_xiaomi_mt6768 -b 15.0 kernel_tree --depth=1
- name: Patching kernel tree for KernelSU support
run: |
cd $GITHUB_WORKSPACE/action_dir/kernel_tree
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.9.5
wget -P $GITHUB_WORKSPACE/ https://raw.githubusercontent.com/xiaoleGun/KernelSU_Action/main/patches/patches.sh
bash $GITHUB_WORKSPACE/patches.sh
echo "CONFIG_KALLSYMS=y" >> arch/arm64/configs/lancelot_defconfig
echo "CONFIG_KALLSYMS_ALL=y" >> arch/arm64/configs/lancelot_defconfig
echo "CONFIG_KSU=y" >> arch/arm64/configs/lancelot_defconfig
echo "CONFIG_OVERLAY_FS=y" >> arch/arm64/configs/lancelot_defconfig
- name: Building kernel
run: |
cd $GITHUB_WORKSPACE/action_dir/kernel_tree
export PATH=$GITHUB_WORKSPACE/action_dir/proton-clang/bin:$PATH
export KBUILD_BUILD_HOST=github
export KBUILD_BUILD_USER=BadSoul_SFC
make -j$(nproc --all) CC=clang O=out ARCH=arm64 LD=ld.lld CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- lancelot_defconfig
make -j$(nproc --all) CC=clang O=out ARCH=arm64 LD=ld.lld CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi-
- name: Creating update.zip (AnyKernel3)
run: |
cd $GITHUB_WORKSPACE/action_dir
git clone https://github.com/osm0sis/AnyKernel3 --depth=1 AnyKernel3
sed -i 's/do.devicecheck=1/do.devicecheck=0/g' AnyKernel3/anykernel.sh
sed -i 's|BLOCK=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot;|BLOCK=auto;|g' AnyKernel3/anykernel.sh
sed -i 's/is_slot_device=0;/is_slot_device=auto;/g' AnyKernel3/anykernel.sh
cp kernel_tree/out/arch/arm64/boot/Image.gz-dtb AnyKernel3/
rm -rf AnyKernel3/.git* AnyKernel3/README.md
- name: Uploading update.zip
uses: actions/upload-artifact@v4
with:
name: KernelSU-${{ env.BUILD_TIME }}-lancelot-15
path: action_dir/AnyKernel3/*