Bringing Up Android on Custom Hardware: Kernel, Vendor Image and Treble

An Android device is not one software image but several: a bootloader, a kernel with vendor modules, a vendor image with HALs and firmware, and a system image built from the Android Open Source Project. On current releases the core kernel is the Generic Kernel Image from Google, and board-specific code lives in modules and vendor partitions.

At a glance

GKI
Generic Kernel Image: a kernel built by Google from the Android Common Kernel and shared across devices.
KMI
Kernel Module Interface: the symbols vendor modules may use, stable within a GKI generation.
GSI
Generic System Image: an AOSP system image used to prove the vendor side meets Treble.
VTS
Vendor Test Suite: checks that the vendor implementation honours its HAL and kernel interfaces.

The problem

Most projects start from the SoC vendor board support package, which carries the bootloader, kernel modules, HALs and device configuration for a reference board. Patching it until the new board boots is tempting, but core kernel changes will not survive GKI, and edits scattered through the tree make every Android update a merge exercise.

Bring-up also fails quietly. A missing firmware file, a wrong device tree property or an SELinux denial can leave the board in a boot loop with little on screen to explain why.

Treat the generic parts as fixed and put every board difference on the vendor side; that is what keeps the next Android update affordable.

The order that works

Start with a serial console and get the bootloader loading the kernel with your device tree and its overlays. Then load the vendor modules for storage, power, display and input, and confirm each one probes cleanly before moving up. Only when the kernel is stable is it worth chasing init, HAL and framework problems.

Keep board configuration in its own device directory, ship drivers as modules that use only symbols in the KMI, and boot a generic system image on the board early. If the GSI boots and passes basic tests, the Treble boundary is sound.

What good looks like

Agree the target Android release and kernel version with the SoC vendor, since together they fix the GKI and KMI rules that apply.

Bring up kernel and modules on a serial console, then HALs, then the framework.

Run VTS and boot a generic system image early, and keep running them as drivers are added, not only before release.

Where board-specific code lives
Image or partitionContentsComes from
BootloaderEarly hardware set-up, verified boot, fastbootSoC vendor and device maker
boot and init_bootGeneric kernel and, on newer releases, the generic ramdiskGoogle (GKI)
vendor_boot and vendor_dlkmVendor kernel modules and vendor ramdiskDevice maker
dtboDevice tree overlays for the boardDevice maker
vendor and odmHALs, firmware, SELinux policy, board configurationDevice maker
systemAndroid frameworkAOSP, built by the device maker
Typical layout on recent releases. Partition names and contents vary with the Android version and SoC.

Bring-up order

  1. Console: Bootloader loads kernel
  2. Kernel: Modules probe, storage mounts
  3. Init: Vendor services start
  4. HALs: Hardware reachable over Binder
  5. Framework: Home screen, then VTS
Each stage should be stable before the next is debugged.

What it changes

Clean Layering

Board-specific code lives in modules and vendor partitions, not in patches to generic code.

Faster Updates

A sound Treble boundary lets a newer system image run without rebuilding the vendor side.

Predictable Bring-Up

Problems are found layer by layer, with a console showing where boot stops.

Test Coverage

Vendor tests catch interface breaks before they reach a release build.

Where to go next

If the product needs Google Mobile Services, licensing and compatibility testing go through agreements with Google. Plan for that separately from AOSP bring-up.

Settle verified boot, keys and the update mechanism during bring-up; retrofitting them changes partition layouts.

Problems this prevents

  • Core kernel patches that block a move to GKI
  • Boot loops with no console to diagnose them
  • Vendor changes scattered across the AOSP tree
  • Treble breaks discovered at final testing

Discuss your project

Email support@aavico.com or use Get in Touch when the website finishes loading.