Contents

Switch to dark mode

Use this reference when manually adjusting migration output. For standard migration steps, see the Migration Guide.

Kernel & Toolchain ​

PropertyPurpose
kernel_dirKernel source path relative to the Android source root
kernel_archKbuild architecture, such as arm64
image_nameKernel image filename under arch/<arch>/boot
clang_versionToolchain version under prebuilts/clang/host/linux-x86
clang_pathCustom Clang directory (takes precedence over clang_version)
rust_versionOptional Rust toolchain version
make_flagsVariables or flags passed to Kbuild
additional_flagsExtra device-specific Kbuild flags
environmentBuild environment variables in NAME=value format
build_jobsKbuild job parallelism

Source builds require kernel_dir and image_name. If no toolchain version is specified, the version exported by envsetup is preferred.

Kconfig ​

Android.bp
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 ​

PropertyPurpose
enabledEnable this output
targetKbuild target
image_nameOutput filename
input_globsCollect DT files from Kbuild output
srcPrebuilt DTB/DTBO input for prebuilt kernels
custom_commandCustom 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:

Android.bp
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:

ReferenceOutput
:kernelKernel 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:

text
vendor/uwu/build/soong/kernel/kernel.go