A workflow to automatically build an Android kernel
Note
You will need a GitHub account.
Note
All options are located in config.env
| Base section options | Optional | Description | Example value |
|---|---|---|---|
| KERNEL_SOURCE | ❌ |
Link to kernel repository | https://github.com/Jbub5/android_kernel_xiaomi_mt6768 |
| KERNEL_SOURCE_BRANCH | ❌ |
Branch name of kernel repository | kernel-tree |
| KERNEL_ARCH | ❌ |
The Linux kernel architecture | arm64 |
| KERNEL_IMAGE_NAME | ❌ |
Format of the kernel image for flashable AnyKernel3 zip | Image.gz-dtb |
| KernelSU section options | Optional | Description | Example value |
|---|---|---|---|
| ENABLE_KERNELSU | ✅ |
Enables accounting for the KernelSU options written below | true |
| KERNELSU_SETUP_SOURCE | ❌ |
Link to KernelSU setup script | https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh |
| KERNELSU_TAG | ✅ |
Repository branch or tag of KernelSU | v1.0.1 |
| ADD_KPROBES_CONFIG | ✅ |
Apply patches kernel source code to support KernelSU installation via kprobe | false |
| KSU_HOOKS_PATCH | ✅ |
Apply patches kernel source code to support KernelSU | false |
| KSU_REVERT | ✅ |
Revert the commit that removed non-GKI kernel support | true |
Important
KernelSU no longer supports non-GKI kernels after version v1.0.0. The last supported version is v0.9.5, please make sure to use the correct tag.
| APatch section options | Optional | Description | Example value |
|---|---|---|---|
| ADD_APATCH_SUPPORT | ✅ |
Add required configs for APatch and accounting for options written below | false |
| FIX_APATCH_OPENELA | ✅ |
Apply fix for bmax121/APatch#400 | false |
| Compiler section options | Optional | Description | Example value |
|---|---|---|---|
| USE_CLANG | ✅ |
Enable Clang toolchain usage and accounting for options written below | true |
| CLANG_SOURCE | ❌ |
Link to clang archive or repository | https://github.com/ZyCromerZ/Clang/releases/download/21.0.0git-20250415-release/Clang-21.0.0git-20250415.tar.gz |
| CLANG_BRANCH | ✅ |
Branch name of clang repository | main |
| USE_GCC | ✅ |
Enable GCC toolchain usage and accounting for options written below | false |
| USE_GCC_64 | ✅ |
Enable GCC 64-bit | true |
| GCC_64_SOURCE | ❌ |
Link to GCC 64-bit archive or repository | https://snapshots.linaro.org/gnu-toolchain/14.0-2023.06-1/aarch64-linux-gnu/gcc-linaro-14.0.0-2023.06-x86_64_aarch64-linux-gnu.tar.xz |
| GCC_64_BRANCH | ✅ |
Branch name of GCC 64-bit repository | main |
| USE_GCC_32 | ✅ |
Enable GCC 32-bit | true |
| GCC_32_SOURCE | ❌ |
Link to GCC 32-bit archive or repository | https://snapshots.linaro.org/gnu-toolchain/14.0-2023.06-1/arm-linux-gnueabihf/gcc-linaro-14.0.0-2023.06-x86_64_arm-linux-gnueabihf.tar.xz |
| GCC_32_BRANCH | ✅ |
Branch name of GCC 32-bit repository | main |
Important
You can use only Clang or GCC, but not both at the same time.
| Anykernel3 section options | Optional | Description | Example value |
|---|---|---|---|
| USE_ANYKERNEL3 | ✅ |
Enable creating flashable AnyKernel3 zip and accounting for options written below | true |
| ANYKERNEL3_SOURCE | ❌ |
Link to AnyKernel3 source | https://github.com/Jbub5/AnyKernel3.git |
| ANYKERNEL3_BRANCH | ✅ |
Branch name of AnyKernel3 repository | proton |
| Build section options | Optional | Description | Example value |
|---|---|---|---|
| EXTRA_CMDS | ✅ |
Additional compiler options | LLVM=1 LLVM_IAS=1 LD=ld.lld AS=llvm-as AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf STRIP=llvm-strip CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- CROSS_COMPILE_COMPAT=arm-linux-gnueabi- CONFIG_NO_ERROR_ON_MISMATCH=y TARGET_BUILD_VARIANT=user |
| DISABLE_LTO | ✅ |
LTO is used to optimize the kernel but sometimes causes errors | false |
| DISABLE_CC_WERROR | ✅ |
Disable CONFIG_CC_WERROR | false |
| ENABLE_PYTHON2 | ✅ |
Many old kernels require python2 to build them | false |
| ENABLE_CCACHE | ✅ |
Enable ccache | false |
| REMOVE_UNUSED_PACKAGES | ✅ |
Remove unnecessary packages and free up more disk space for builder | false |
| NEED_DTBO | ✅ |
Upload DTBO | false |
| BUILD_BOOT_IMG | ✅ |
Repack boot.img by replacing the kernel in it with the compiled kernel | false |
| SOURCE_BOOT_IMAGE | ✅ |
Link to the original boot.img for repackage it | https://raw.githubusercontent.com/xiaoleGun/KernelSU_action/main/boot/boot.img |
| Misc section options | Optional | Description | Example value |
|---|---|---|---|
| OLD_ANDROID_SUPPORT | ✅ |
Enable support for MIUI 12.5 and custom ROMs based on Android 11 through 12 | false |
| ADD_OVERLAYFS_CONFIG | ✅ |
Automatically put the configs needed for OverlayFS into your defconfig | false |
Important
Enabling OLD_ANDROID_SUPPORT breaks support for Android 13+.
| Proton specific section options | Optional | Description | Example value |
|---|---|---|---|
| FIX_WIFI_SPEED | ✅ |
Rollback to old connectivity drivers that have better Wi-Fi speed, but cause spontaneous reboots on some devices | false |













