This page describes how to develop Android kernels on Cuttlefish devices.
Supported kernel manifests
Cuttlefish supports the following kernel manifests on the Android latest release branch and AOSP GSI releases.
- On
android-latest-releasecommon-android-mainline
- On
android-15.0.0_r36common-android16-6.12common-android15-6.6common-android14-6.1common-android14-5.15
- On
aosp-android13-gsicommon-android13-5.15common-android13-5.10
- On
aosp-android12-gsicommon-android12-5.10common-android12-5.4common-android-4.19-stable
- On
aosp-android11-gsicommon-android11-5.4common-android-4.19-stablecommon-android-4.14-stable
The following are kernel sources for kernel development on Cuttlefish devices.
kernel/common-android-mainlinekernel/common-android16-6.12kernel/common-android15-6.6kernel/common-android14-6.1kernel/common-android14-5.15kernel/common-android13-5.15kernel/common-android13-5.10
Develop Android kernels
To develop kernels on Cuttlefish devices, follow these steps:
Clone the appropriate kernel repo manifest for your Cuttlefish device and make any changes.
mkdir common-android-mainlinecd common-android-mainlinerepo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainlinerepo sync -c -j$(nproc) -qBuild the kernel and ramdisk. For more information, see Building the Vendor Modules for the Virtual Device.
tools/bazel run //common-modules/virtual-device:virtual_device_x86_64_distIf using
common-android-4.19-stable,common-android-4.14-stable, orcommon-android11-5.4kernel manifests, run:BUILD_CONFIG=common/build.config.gki.x86_64 build/build.sh && BUILD_CONFIG=common-modules/virtual-device/build.config.cuttlefish.x86_64 build/build.shInstead of building locally (to avoid downloading the kernel source, setting up a kernel development environment), you can download the relevant artifacts at ci.android.com.
Launch the kernel and ramdisk with Cuttlefish.
cvd create \ -kernel_path=./out/virtual_device_x86_64/dist/bzImage \ -initramfs_path=./out/virtual_device_x86_64/dist/initramfs.imgIf launching a non-GKI kernel (anything at or under 4.19), omit the
-initramfs_pathargument.If you're launching the kernel on an aarch64 version of Cuttlefish, use the
aarch64build configuration and use theImageartifact instead ofbzImage.cvd create \ -kernel_path=./out/virtual_device_aarch64/dist/Image \ -initramfs_path=./out/virtual_device_aarch64/dist/initramfs.img