Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release thay vì aosp-main để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trang này giải thích cách triển khai tệp nhị phân GBL.
Yêu cầu về chương trình cơ sở khởi động
Để sử dụng GBL, phần mềm khởi động phải đáp ứng các yêu cầu sau:
Tuân thủ UEFI. Chương trình cơ sở phải triển khai và sử dụng các giao thức UEFI bắt buộc. Bộ nhớ đệm cũng phải cho phép các tiện ích dành riêng cho nhà cung cấp bằng cách sử dụng các giao thức UEFI đã xác định.
Bảo mật. Phần mềm cơ sở phải triển khai tất cả khía cạnh của tính năng Khởi động được xác minh của Android (AVB), đảm bảo chỉ tải hình ảnh đã được xác thực.
Chế độ khởi động. Tệp nhị phân phải có khả năng xử lý nhiều chế độ khởi động, chẳng hạn như khởi động bình thường, khởi động khôi phục và khởi động nhanh.
Phân vùng động. Phần mềm khởi động phải triển khai logic lựa chọn khe để hỗ trợ đọc đúng khe khởi động A/B và tương thích với các phân vùng động và userdata trong super.
Cấu hình hệ điều hành. Phần mềm cơ sở phải có khả năng sửa đổi dòng lệnh hạt nhân, cây thiết bị (DTB) và bootconfig bằng các tuỳ chỉnh của OEM cần thiết để khởi động thiết bị.
Đang tải máy ảo được bảo vệ. Tệp nhị phân phải tải đúng cách phần mềm cơ sở của máy ảo được bảo vệ đã xác minh trước trước khi tải hạt nhân Android khi có máy ảo được bảo vệ. Để biết thêm thông tin, hãy xem trình tự khởi động của Microdroid.
Quản lý bộ nhớ. Phần mềm cơ sở khởi động phải hỗ trợ API phân bổ bộ nhớ UEFI.
Khả năng tương thích và khả năng tương thích ngược. Phần mềm cơ sở phải hoạt động trên các thiết bị của nhiều nhà cung cấp, SOC và duy trì khả năng tương thích ngược với phiên bản Android tương ứng.
Hỗ trợ chương trình cơ sở khởi động
Với các sửa đổi cần thiết để hỗ trợ các yêu cầu trong phần trước, các cách triển khai phần mềm UEFI sau đây sẽ hoạt động với GBF:
EDK2 (Tianocore). EDK2 là một phương thức triển khai UEFI nguồn mở phổ biến. Cần có tính năng hỗ trợ GBL cho trình tải khởi động dựa trên EDK2 và tính năng hỗ trợ UEFI đã có sẵn.
U-Boot. Một dự án trình tải khởi động nguồn mở linh hoạt và được sử dụng rộng rãi, đang đạt được khả năng tương thích UEFI để sử dụng GBL.
LittleKernel (LK). Trình tải khởi động nguồn mở mà một số nhà cung cấp sử dụng.
Chạy GBL
Bạn có thể lấy tệp nhị phân GBL tạo sẵn để chạy hoặc tạo tệp nhị phân của riêng mình và chạy tệp đó.
Tải và chạy tệp nhị phân GBL
GBL được phân phối dưới dạng một tệp nhị phân ứng dụng EFI duy nhất. Bạn có thể cập nhật tệp nhị phân này độc lập với chương trình cơ sở của thiết bị bằng cách sử dụng cơ chế cập nhật tiêu chuẩn của Android.
Kể từ Android 16, nếu vận chuyển thiết bị dựa trên chipset ARM-64, bạn nên triển khai phiên bản mới nhất do Google ký của GBL và tích hợp phiên bản đó vào chuỗi khởi động.
Tạo và chạy GBL
Cách tạo và chạy GBL:
Xác minh rằng bạn đã cài đặt công cụ repo và trình khởi động Bazel:
sudo apt install repo bazel-bootstrap
Khởi động thư mục hiện tại để kiểm soát nguồn bằng tệp kê khai uefi-gbl-mainline:
Nếu bạn có thắc mắc, hãy liên hệ với nhóm GBL bằng cách gửi email đến android-gbl@google.com.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Deploy GBL\n\nThis page explains how to deploy the GBL binary.\n\nBoot firmware requirements\n--------------------------\n\nTo use GBL, the boot firmware must meet the following requirements:\n\n- UEFI compliance. The firmware must implement and use the\n required UEFI protocols. The firmware must also allow for vendor-specific\n extensions using defined UEFI protocols.\n\n- Security. The firmware must implement all aspects of Android\n Verified Boot (AVB), ensuring only authenticated images are loaded.\n\n- Boot modes. The binary should be able to handle various boot modes, such as normal boot, recovery boot, and fastboot.\n\n- Dynamic partitioning. The boot firmware must implement slot selection logic so\n that it supports reading the correct A/B boot slot and is compatible with\n dynamic partitions and userdata in super.\n\n- OS configuration. The firmware must be capable of modifying the kernel\n command line, device tree (DTB), and bootconfig with OEM customizations\n needed to boot the device.\n\n- Protected VM loading. The binary should correctly load preverified protected\n VM firmware before the Android kernel in the presence of protected VMs. For\n further information, see Microdroid [boot sequence](/docs/core/virtualization/microdroid#boot-sequence).\n\n- Memory management. The boot firmware must support the UEFI memory allocation\n API.\n\n- Compatibility and backward compatibility. The firmware should work on devices\n with different vendor, SOCs, and maintain backward compatibility with the\n corresponding Android version.\n\n### Boot firmware support\n\nWith the modifications necessary to support requirements in the previous\nsection, the following UEFI firmware implementations work with the GBF:\n\n- [EDK2 (Tianocore)](https://github.com/tianocore/edk). A EDK2 is a popular open-source UEFI implementation. GBL support is needed for EDK2-based bootloaders, and UEFI support is already present.\n- [U-Boot](https://docs.u-boot.org/en/latest/). A flexible and widely used open-source bootloader project that is gaining UEFI compatibility for GBL usage.\n- [LittleKernel (LK)](https://github.com/littlekernel/lk). An open-source bootloader used by some vendors.\n\nRun GBL\n-------\n\nYou can obtain a prebuilt GBL binary to run or build your own and run it.\n\n### Obtain and run the GBL binary\n\nGBL is distributed as a single EFI app binary. You can update this\nbinary independently from the device's base firmware using Android's standard\nupdate mechanism.\n\nBeginning with Android 16, if you ship a device based\non ARM-64 chipset, we strongly recommend that you deploy the [latest\nGoogle-signed version](https://dl.google.com/android-gbl/android16/20250703/signed-gbl-img-13709664.zip) of GBL and integrate it into your boot chain.\n\n### Build and run the GBL\n\nTo build and run the GBL:\n\n1. Verify that you have the repo tool and Bazel bootstrap installed:\n\n sudo apt install repo bazel-bootstrap\n\n2. Initialize your current directory for source control using the `uefi-gbl-mainline` manifest file:\n\n repo init -u https://android.googlesource.com/kernel/manifest -b uefi-gbl-mainline\n repo sync -j16\n\n3. Build the EFI app:\n\n ./tools/bazel run //bootable/libbootloader:gbl_efi_dist --extra_toolchains=@gbl//toolchain:all\n\n4. Run the EFI app within Cuttlefish:\n\n cvd start --android_efi_loader=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003epath_to_the_EFI_app\u003c/span\u003e\u003c/var\u003e ...\n\n Instead of booting Android directly, this `cvd start` command uses the EFI\n app to boot Android.\n\n| **Note:** For x86 platform, use the EFI image built for x86_64.\n\nFile bugs and contact the bootloader team\n-----------------------------------------\n\nTo report a bug for the GBL, navigate to the\n[Android Generic Bootloader component in Buganizer](https://issuetracker.google.com/issues/new?component=1602063&template=2011730).\n\nFor questions, contact the GBL team, send an email to `android-gbl@google.com`."]]