Home

Awesome

<div align="center"> <h1>Android Kernel Build Action</h1> <h3><i>Powered By GitHub Actions</i></h3> </div>

A Workflow to build Android Kernel automatically

[!IMPORTANT] This workflow is universal. You need to have a certain foundation in writing github workflows and a little knowledge of the Android kernel to use this.

Warning

Strongly recommends using the stable version (tags such as v1.2) instead of the development version (main branch), because main branch is not a stable branch which may have some technical problems.

How to use?

name: CI

on:
  workflow_dispatch:

jobs:
  build-kernel:
    name: Build Kernel
    runs-on: ubuntu-20.04
    steps:
      - name: Build
        uses: dabao1955/kernel_build_action@main
        with:
          kernel-url: https://github.com/AcmeUI-Devices/android_kernel_xiaomi_cas
          kernel-branch: taffy
          config: cas_defconfig
          arch: arm64
          aosp-gcc: true
          aosp-clang: true
          android-version: 12
          aosp-clang-version: r383902

Or use the preset workflow file to modify it.

[!NOTE] You do not need to fork this repository.

If you just want to compile the kernel, please do not submit PR after modification!

Inputs

[!WARNING]

enable lxc or nethunter input options may cause kernel compilation failed!

inputrequireddescriptionexample value
kernel-urltrueURL of Android kernel source code for your phonehttps://github.com/username/project
kernel-dirfalseThe directory name of the Android kernel source code. This option may be used for OPLUS Kernel source code.kernel
depthfalse1
vendorfalsefalse
vendor-urlfalseurl of additional source code for the Android kernel source code. This option may be used for OPLUS source code.https://github.com/username/project
vendor-dirfalsevendor
kernel-branchtrueThe branch of the source code that needs to be cloned, defaults branch to git clone is mainmain
vendor-branchtrueThe branch of the vendor source code that needs to be cloned, defaults branch to git clone is mainmain
configtrueCompile the selected configuration file for the Android kerneldefconfig
archtrueThe architecture of your mobile phone SOC is arm64 by defaultarm64
android-versiontrueThe Android version required when downloading aosp-clang. If you want to use the latest aosp-clang or you do not use aosp-clang to compile the kernel, please ignore this option12
ksufalseEnable KernelSUtrue
ksu-versionfalseKernelSU versionv0.9.5
ksu-lkm(may not build successfully for non-GKI devices)falseBuild KernelSU as a linux kernel moduletrue
ksu-otherfalsefalse
ksu-urlfalseUde 3rd KernelSUhttps://github.com/xxx/KernelSU/
disable-ltofalsefalse
lxcfalseEnable LXC and docker to configfalse
lxc-patchfalseAdd patch avoid not booting after enable lxcfalse
nethunterfalseEnable Kali nethunterfalse
nethunter-patchfalsefalse
kvmfalsefalse
ccachefalseEnable ccache(Only valid when compiled with clang)false
aosp-gcctrueUse aosp-gcc to compile the kernel or assist in compiling the kernel (when aosp-clang is enabled)false
other-gcc32-urlfalsePlease fill in the download link of other gcc32 in this option. Supports .xz, .zip, .tar and .git formatshttps://github.com/username/gcc
other-gcc32-branchfalsemain
other-gcc64-urlfalsePlease fill in the download link of other gcc64 in this option. Supports .xz, .zip, .tar and .git formatshttps://github.com/username/gcc
other-gcc64-branchfalsemain
aosp-clangfalseCompile the kernel using aosp-clangfalse
aosp-clang-versionfalseplease search for them according to your own needs at official website and choose the appropriate clang according to the Android system version instead of blindly choosing r383902r383902
other-clang-urlfalsePlease fill in the download link of other clang in this option. Supports .xz, .zip, .tar and .git formatshttps://github.com/kdrag0n/proton-clang
other-clang-branchfalse10.0
anykernel3falsePackage the compiled kernel using AnyKernel3. If this option is disabled, You need to fill bootimg-url.false
anykernel3-urlfalse3rdparty AnyKernel3 urlhttps://github.com/username/AnyKernel3
releaseflaseAfter the kernel compilation is completed, it will be automatically published to the releases pagetrue
access-tokenfalsePlease fill it if you want to release kernelghp_xxxxxx
bootimg-urlfalseA URL that can download the local boot.imghttps://127.0.0.1/boot.img
extra-cmdfalseCompile the kernel with extra options, such as LD=ld.lldAS=llvm-as

FAQ

[!CAUTION] Please Read this first if you have some questions!

How to use 3rd clang?

You should disable aosp-clang and android-ndk options to use it.

Why KernelSU version built with this action is still v0.9.5?

See KernelSU 's release note for more details.

How to submit issue about features requests?

In principle, it only accept Bug Reports and do not accept external Feature Requests; if you want new features, you are welcome to submit a Pull Request. We will still develop new features that we think are useful.

Why the workflow exits with a code with an error value of some nubmer?

Build failed while using third-party GCC ?

Try add LLVM=1 option with clang.

Credits