Lancelot KSU/APatch Supported 4.14.336 Kernel #49
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: Lancelot KSU/APatch Supported 4.14.336 Kernel | |
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 libarchive-tools 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 14.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_KSU=y" >> arch/arm64/configs/lancelot_defconfig | |
echo "CONFIG_OVERLAY_FS=y" >> arch/arm64/configs/lancelot_defconfig | |
echo "CONFIG_KALLSYMS=y" >> arch/arm64/configs/lancelot_defconfig | |
echo "CONFIG_KALLSYMS_ALL=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) O=out ARCH=arm64 CC="clang" CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- LLVM=1 LD=ld.lld AS=llvm-as AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip CONFIG_NO_ERROR_ON_MISMATCH=y lancelot_defconfig | |
make -j$(nproc --all) O=out ARCH=arm64 CC="clang" CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- LLVM=1 LD=ld.lld AS=llvm-as AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip CONFIG_NO_ERROR_ON_MISMATCH=y | |
- name: Creating update.zip (AnyKernel3) | |
run: | | |
cd $GITHUB_WORKSPACE/action_dir | |
git clone --depth=1 -b master https://github.com/orkunsdumps/AnyKernel3.git --depth=1 AnyKernel | |
cp kernel_tree/out/arch/arm64/boot/Image.gz-dtb AnyKernel/ | |
cd AnyKernel/ | |
rm -rf .git README.md *placeholder | |
- name: Uploading update.zip | |
uses: actions/upload-artifact@v4 | |
with: | |
name: KernelSU-${{ env.BUILD_TIME }}-lancelot-14 | |
path: action_dir/AnyKernel/* | |