en Variable Reference - JackA1ltman/NonGKI_Kernel_Build_2nd GitHub Wiki
Variable Reference
Build with Actions ยท Quick Reference
Not all variables need to be set. Configure only what your build requires.
CMDS โ Build Commands
| Variable | Description |
|---|---|
CUSTOM_CMDS |
Typically used only to declare CLANG_TRIPLE |
EXTRA_CMDS |
Build flags, e.g. LD=ld.lld LLVM=1 LLVM_IAS=1 |
KERNEL โ Kernel & Toolchain Sources
| Variable | Description |
|---|---|
KERNEL_SOURCE |
Kernel source Git URL |
KERNEL_BRANCH |
Kernel source branch |
CLANG_SOURCE |
Supports .git / .tar.gz / .tar.xz / .xz / .zip / antman |
CLANG_BRANCH |
Required only for .git sources |
GCC_GNU |
true to use the system's built-in GNU GCC; leave other GCC variables empty |
GCC_XX_SOURCE |
Provide both ARM and ARM64 versions (same format as CLANG) |
GCC_XX_BRANCH |
Required only for .git sources |
DEFCONFIG
| Variable | Description |
|---|---|
DEFCONFIG_SOURCE |
URL to an extra custom defconfig file (single file only โ no .git or archives) |
DEFCONFIG_NAME |
Full defconfig name, e.g. vendor/mi845_defconfig |
DEFCONFIG_ORIGIN_IMAGE |
boot.img URL โ used to extract a defconfig or as input for MKBOOTIMG packaging |
DEFCONFIG_FROM_BOOT |
true to extract the defconfig from the boot.img |
BOOT_SOURCE |
Alternative to DEFCONFIG_ORIGIN_IMAGE when only MKBOOTIMG packaging is needed |
KERNELSU / SUSFS
| Variable | Description |
|---|---|
KERNELSU_SOURCE |
KernelSU fork source URL (typically a .sh script; use .git for special cases) |
KERNELSU_BRANCH |
KernelSU fork branch |
KERNELSU_AUTO_GET |
true to skip manual SOURCE/BRANCH setup |
KERNELSU_AUTO_FORK |
Choose from: xxksu (no SuSFS support) / rsuntk / sukisu / resukisu / next |
KERNELSU_METHOD |
Integration method: shell (default) / manual / only |
SUSFS_ENABLE |
true to enable SuSFS |
SUSFS_FIXED |
true to apply a secondary patch (used with the SuSFS patch variables below) |
PATCHES_SOURCE |
GitHub path to your SuSFS secondary patch repo (e.g. Username/RepoName) |
PATCHES_BRANCH |
Corresponding branch |
SUSFS_FOLDER_FIXED |
Directory containing the patch file (e.g. Patch); leave empty if none |
SUSFS_PATCH_FIXED |
Patch filename without the .patch extension (e.g. susfs) |
PACK โ Packaging
| Variable | Description |
|---|---|
PACK_METHOD |
Anykernel3 or MKBOOTIMG |
PACK_KMODULES |
true to bundle compiled .ko kernel modules into the Anykernel3 package |
KPM
| Variable | Description |
|---|---|
KPM_ENABLE |
true to add CONFIG_KALLSYMS=y and CONFIG_KALLSYMS_ALL=y to defconfig |
KPM_INLINE |
true to auto-inject KPM support (SukiSU-Ultra / ReSukiSU only) |
KPM_KPATCH_NEXT |
true to use KernelSU Next's modular KPM solution (KPatch-Next) |
KPM_PATCH_SOURCE |
URL to the patch binary; leave as default in most cases |
DTBO
| Variable | Description |
|---|---|
NEED_DTBO |
true to inject DTBO generation code and build DTBO (not all devices need this) |
NEED_SAFE_DTBO |
Set both this and NEED_DTBO to true to use MKDTBOIMG for DTBO generation |
DTB
| Variable | Description |
|---|---|
GENERATE_DTB |
true to generate a DTB device tree file and bundle it into the kernel |
GENERATE_CHIP |
Chipset name; default is qcom, can also be mediatek or a custom string |
Baseband Guard
| Variable | Description |
|---|---|
BASEBAND_GUARD_ENABLE |
true to enable Baseband Guard |
BASEBAND_GUARD_BOOT |
true to enable boot partition write protection (prevents tools like Kernel Flasher from modifying the boot partition) |
Debugging
| Variable | Description |
|---|---|
BUILD_DEBUGGER |
true to halt at the first failure, archive error files, and upload them |
SKIP_PATCH |
Used with BUILD_DEBUGGER โ skips all failed patch steps to allow compilation to continue |
defconfig Merging
| Variable | Description |
|---|---|
BUILD_OTHER_CONFIG |
true to merge additional config files into the main defconfig |
MERGE_CONFIG_FILES |
Comma-separated list of extra .config files, e.g. "vendor/debugfs.config,vendor/lahaina_QGKI.config" |
Miscellaneous
| Variable | Description |
|---|---|
PYTHON_VERSION |
Set to "2" to enable Python 2 on Ubuntu 20.04/22.04 |
FREE_MORE_SPACE |
true to free up additional disk space (~4 min overhead; non-container Ubuntu only) |
REKERNEL_ENABLE |
true to embed Re:Kernel; recommended for non-Google-ecosystem users running freezer apps |
HOOK_METHOD |
Leave as default (Normal / Syscall; Syscall is the current standard) |
KERNEL_PATCH |
For kernel version โค 4.9 only โ applies a backport patch when enabled |
HIDE_STUFF |
true to inject code that obscures some LineageOS traces (limited effectiveness) |