[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-26 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)."]]