Contents

Switch to dark mode

Using uwuCLI ​

From the source root, run:

bash
uwu

Follow the prompts to select your device and kernel migration. uwuCLI reads the existing configuration and generates the corresponding uwu_kernel module. Handle any items reported as requiring manual adaptation.

The sections below show how common legacy settings map to uwu_kernel.

Kernel ​

Legacy kernel builds typically define:

make
TARGET_KERNEL_SOURCE := kernel/<vendor>/<kernel>
TARGET_KERNEL_ARCH := arm64
BOARD_KERNEL_IMAGE_NAME := Image

After migration, declare a uwu_kernel module:

Android.bp
uwu_kernel {
    name: "kernel",

    kernel_dir: "kernel/<vendor>/<kernel>",
    kernel_arch: "arm64",
    image_name: "Image",
}

Configure toolchains and additional flags as needed; see Configuration Reference.

Kernel Configuration ​

For example, legacy configuration:

make
TARGET_KERNEL_CONFIG := \
    gki_defconfig \
    vendor/device.config

TARGET_KERNEL_ADDITIONAL_FLAGS := \
    CONFIG_EXAMPLE=y

Maps to:

Android.bp
additional_flags: [
    "CONFIG_EXAMPLE=y",
],

config: {
    defconfig: "gki_defconfig",
    fragments: [
        "vendor/device.config",
    ],
},

DTB and DTBO ​

Declare the outputs your device requires inside uwu_kernel:

Android.bp
dtb: {
    enabled: true,
    target: "dtbs",
    image_name: "dtb.img",
},

dtbo: {
    enabled: true,
    target: "dtbs",
    image_name: "dtbo.img",
    page_size: 4096,
},

Qualcomm DT merge

When setting qcom_merge: true under dtb, both dtb.enabled and dtbo.enabled must be set to true.

Kernel Modules ​

Each partition that installs modules configures two lists:

  • install list: modules installed into the partition.
  • load list: modules loaded from that partition.

The load list must be a subset of the install list.

Android.bp
modules: {
    enabled: true,
    auto_collect_deps: true,

    system_dlkm_module_install_list: ["modules.include.system_dlkm"],
    system_dlkm_module_load_list: ["modules.load.system_dlkm"],

    vendor_dlkm_module_install_list: ["modules.include.vendor_dlkm"],
    vendor_dlkm_module_load_list: ["modules.load.vendor_dlkm"],
},

uwuCLI converts existing module configuration and the static lists it references. auto_collect_deps adds dependencies of modules in the install list; it does not infer the install list from the load list.

External Modules ​

External modules living outside the main kernel tree can be configured as:

Android.bp
modules: {
    enabled: true,
    external_module_root: "kernel/<vendor>/<device>-modules",
    external_modules: [
        "vendor/example",
    ],
},

Plain entries use the external module's own Makefile. To build via the main kernel's Kbuild M= mode, append :kbuild (for example, "vendor/example:kbuild").

Connecting to the Android Build ​

Select the Soong kernel in your device configuration and add it to the product:

make
BOARD_USES_SOONG_KERNEL := true
SOONG_KERNEL_MODULE := //device/<vendor>/<device>:kernel

PRODUCT_PACKAGES += kernel

Replace the path with the actual module location, then build using your normal device build flow.

Configurations Requiring Manual Adaptation ​

Custom DTB/DTBO Makefiles, scripts that depend on legacy output paths, and platform-specific build wrappers may need manual adjustments. uwuCLI reports anything it cannot convert automatically; commonly needed missing features can be reported to the project.

For specific build failures, see Troubleshooting.