Use this reference when manually adjusting migration output. For standard migration steps, see the Migration Guide.
Kernel & Toolchain
| Property | Purpose |
|---|---|
kernel_dir | Kernel source path relative to the Android source root |
kernel_arch | Kbuild architecture, such as arm64 |
image_name | Kernel image filename under arch/<arch>/boot |
clang_version | Toolchain version under prebuilts/clang/host/linux-x86 |
clang_path | Custom Clang directory (takes precedence over clang_version) |
rust_version | Optional Rust toolchain version |
make_flags | Variables or flags passed to Kbuild |
additional_flags | Extra device-specific Kbuild flags |
environment | Build environment variables in NAME=value format |
build_jobs | Kbuild job parallelism |
Source builds require kernel_dir and image_name. If no toolchain version is specified, the version exported by envsetup is preferred.
Kconfig
config: {
defconfig: "gki_defconfig",
fragments: [
"vendor/common.config",
"vendor/device.config",
],
merge_at_once: true,
overrides: [
"CONFIG_EXAMPLE=y",
],
lto: "thin",
},defconfig is the base config, fragments are layered configs, and overrides append individual options. lto accepts none, thin, or full.
Config names without / and names starting with vendor/ are resolved under arch/<arch>/configs/ in the kernel tree. Other supported paths can be specified relative to the Android source root.
DTB and DTBO
| Property | Purpose |
|---|---|
enabled | Enable this output |
target | Kbuild target |
image_name | Output filename |
input_globs | Collect DT files from Kbuild output |
src | Prebuilt DTB/DTBO input for prebuilt kernels |
custom_command | Custom build command for flows not covered by defaults |
dtb.qcom_merge enables Qualcomm DT merge and requires both DTB and DTBO outputs to be enabled. In this mode, inputs are built via dtb.target and then merged into both images.
DTBO-only options
config and page_size apply only to DTBO, not DTB. page_size defaults to 4096.
custom_command can reference $(kernelDir), $(kernelOut), and $(out).
Modules
Four installation targets are supported: system_dlkm, vendor_dlkm, vendor_ramdisk, and recovery. Configure both an install list and a load list for each target:
modules: {
enabled: true,
auto_collect_deps: true,
install_strip: true,
vendor_dlkm_module_install_list: ["modules.include.vendor_dlkm"],
vendor_dlkm_module_load_list: ["modules.load.vendor_dlkm"],
},Each target also supports a corresponding blocklist. vendor_dlkm_install_all adds all built modules not installed in system_dlkm to vendor_dlkm. module_aliases uses old_name.ko:new_name.ko syntax.
For external modules, see Migration Guide.
Prebuilt Kernel
prebuilt specifies a prebuilt kernel image and skips source Kbuild. Optional companion properties prebuilt_config, prebuilt_headers, and prebuilt_modules apply only to prebuilt kernels.
Output References
Other Soong modules can reference a module named kernel via these output tags:
| Reference | Output |
|---|---|
:kernel | Kernel image |
:kernel{.config} | Final kernel configuration |
:kernel{.dtb} | DTB image |
:kernel{.dtbo} | DTBO image |
:kernel{.modules} | Kernel modules archive |
Each tag is available only when the corresponding output is enabled. Kernel headers are exposed via generated headers; existing generated_kernel_includes usage remains valid.
Products only need to include the main module, not internal module installers.
Additional Configuration
The full property schema and build entry point live at:
vendor/uwu/build/soong/kernel/kernel.go