mirror of
https://github.com/JackA1ltman/NonGKI_Kernel_Build_2nd.git
synced 2026-08-19 15:03:40 +08:00
Page:
en Variable Reference
Pages
Fork 项目
Home
en Automated Release
en Choosing a Toolchain
en Compiling on a Mobile Device
en Compiling the Kernel
en Compiling the Stock Vendor Kernel
en Configuring the YML File
en Embedding KernelSU and Patching SuSFS
en Fork the Repository
en Hiding Root Common Methods
en Introduction
en Kernel Build FAQ
en Packaging and Flashing
en Requirements
en Running and Downloading Artifacts
en Setting Up the Environment
en Variable Reference
内核编译答疑
利用移动设备编译内核
变量参考
基础需求
嵌入KernelSU和SuSFS修补
序章
打包与刷入
搭建基础环境
编译内核
编译器选择
编译设备厂商原始内核
自动发布
运行与产物
配置 YML 文件
隐藏Root常规方式
No results
4
en Variable Reference
JackAltman edited this page 2026-08-09 12:18:19 +08:00
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 |
DROIDSPACES_ENABLE |
true to supported Droidspaces |
HOOK_METHOD |
Leave as default |
KERNEL_PATCH |
For kernel version ≤ 4.9 only — applies a backport patch when enabled |
NOMOUNT_ENABLE |
true to put the kernel into nomount |
🌐 Language / 语言
📖 English
Local Build
- Setting Up the Environment
- Choosing a Toolchain
- Compiling the Kernel
- Compiling on a Mobile Device
- Compiling the Stock Vendor Kernel
- Embedding KernelSU & Patching SuSFS
- Packaging and Flashing
- Kernel Build FAQ
Build with Actions
- Fork the Repository
- Configuring the YML File
- Variable Reference
- Running and Downloading Artifacts
- Automated Release
Hide Root Trace
📖 中文
基础编译
利用 Action 构建内核
隐藏Root痕迹