Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to build, run, and develop
Android bootloader features
on a Cuttlefish device.
AOSP sources
To develop Android bootloader features, use the Cuttlefish configuration of
U-boot with Cuttlefish in
the latest release branch (android16-release) or on
generic system image (GSI)
branches for Android 11 or higher. The following are the sources in AOSP:
Manifest
for the Cuttlefish configuration of
U-boot
(u-boot-mainline).
Build the bootloader target appropriate for your Cuttlefish architecture.
For example:
x86_64
$tools/bazelrun//u-boot:crosvm_x86_64_dist
aarch64
$tools/bazelrun//u-boot:crosvm_aarch64_dist
The resulting bootloader binary (u-boot.bin for arm64 and u-boot.rom for
x86_64) is found in $PATH_TO_REPO/out/u-boot-mainline/dist.
Launch the Cuttlefish device with the bootloader. Include the
pause_in_bootloader parameter to disable autoboot and let you interact
with the bootloader.
To interact with the bootloader, connect to the bootloader console.
$screen~/cuttlefish_runtime/console
When done with bootloader interactions, continue the boot by typing boot
into the console.
Test bootloader flow with different kernels
To test the bootloader flow with different kernels or kernel modules, pass in
the target artifacts (kernel and kernel modules) using the --kernel_path and
--initramfs_path arguments. The assembler repacks the boot images based on
the artifacts passed in the arguments.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-12 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-12 UTC."],[],[],null,["# Develop Android bootloader features\n\n\u003cbr /\u003e\n\nThis page describes how to build, run, and develop\n[Android bootloader](/docs/core/architecture/bootloader) features\non a Cuttlefish device.\n\nAOSP sources\n------------\n\nTo develop Android bootloader features, use the Cuttlefish configuration of\n[U-boot](https://www.denx.de/project/u-boot/) with Cuttlefish in\nthe latest release branch (`android16-release`) or on\n[generic system image (GSI)](/docs/setup/create/gsi)\nbranches for Android 11 or higher. The following are the sources in AOSP:\n\n- [Manifest](https://android.googlesource.com/kernel/manifest/+/refs/heads/u-boot-mainline)\n for the Cuttlefish configuration of\n [U-boot](https://www.denx.de/project/u-boot/)\n (`u-boot-mainline`).\n\n- [U-boot bootloader source](https://android.googlesource.com/platform/external/u-boot/+/refs/heads/main).\n\n- [x86 Cuttlefish default bootloader](https://android.googlesource.com/device/google/cuttlefish_prebuilts/+/refs/heads/android16-release/bootloader/crosvm_x86_64).\n\n- [aarch64 Cuttlefish default bootloader](https://android.googlesource.com/device/google/cuttlefish_prebuilts/+/refs/heads/android16-release/bootloader/crosvm_aarch64).\n\n- [QEMU bootloaders (arm, aarch64, x86_64, riscv)](https://ci.android.com/builds/branches/aosp_u-boot-mainline/grid?)\n\nDevelop a bootloader\n--------------------\n\nTo build, run, and develop bootloader features locally, follow these steps:\n| **Note:** Instead of building locally (to avoid downloading the U-boot source and setting up a bootloader development), you can download the relevant artifacts at [ci.android.com](https://ci.android.com/builds/branches/aosp_u-boot-mainline/grid?).\n\n1. Clone the manifest for the Android fork of U-boot:\n\n $ mkdir u-boot-mainline\n $ cd u-boot-mainline\n $ repo init -u https://android.googlesource.com/kernel/manifest -b u-boot-mainline\n $ repo sync -j$(nproc) -q\n\n2. Build the bootloader target appropriate for your Cuttlefish architecture.\n For example:\n\n - x86_64\n\n $ tools/bazel run //u-boot:crosvm_x86_64_dist\n\n - aarch64\n\n $ tools/bazel run //u-boot:crosvm_aarch64_dist\n\n The resulting bootloader binary (`u-boot.bin` for arm64 and `u-boot.rom` for\n x86_64) is found in `$PATH_TO_REPO/out/u-boot-mainline/dist`.\n3. Launch the Cuttlefish device with the bootloader. Include the\n `pause_in_bootloader` parameter to disable autoboot and let you interact\n with the bootloader.\n\n $ launch_cvd \\\n -bootloader /$PATH/$TO/u-boot-mainline/out/u-boot-mainline/dist/u-boot.rom \\\n -pause_in_bootloader -console=true\n\n | **Note:** If on aarch64, use `u-boot.bin` instead of `u-boot.rom`.\n4. To interact with the bootloader, connect to the bootloader console.\n\n $ screen ~/cuttlefish_runtime/console\n\n5. When done with bootloader interactions, continue the boot by typing `boot`\n into the console.\n\nTest bootloader flow with different kernels\n-------------------------------------------\n\nTo test the bootloader flow with different kernels or kernel modules, pass in\nthe target artifacts (kernel and kernel modules) using the `--kernel_path` and\n`--initramfs_path` arguments. The assembler repacks the boot images based on\nthe artifacts passed in the arguments. \n\n cvd create \\\n -kernel_path=/$PATH/$TO/common-android14-6.1/out/android14-6.1/dist/bzImage \\\n -initramfs_path=/$PATH/$TO/common-android14-6.1/out/android14-6.1/dist/initramfs.img\n\nFor more information, see\n[Develop Android Kernels](/docs/devices/cuttlefish/kernel-dev)."]]