|author||Nicholas Bishop <firstname.lastname@example.org>||Thu Jul 29 21:41:18 2021|
|committer||Nicholas Bishop <email@example.com>||Thu Jul 29 21:41:18 2021|
crdyboot: remove unnecessary system table clone Change-Id: Ie1b98827b29e87910b9bd44469653948272fb6c1
This is a work-in-progress UEFI bootloader for CloudReady. It is intended to be run either as a second-stage bootloader after shim when using the Microsoft keys, or as the first-stage bootloader when using custom keys. Then crdyboot will handle loading, verifying, and running the Linux kernel.
vboot subdirectory is a
no_std library that implements just the necessary parts of vboot in Rust. It uses bindgen to access structs and constants from
vboot_reference, but does not directly build any of the C code. This crate can be built for the host target so that tests can run.
crdyboot subdirectory contains the actual bootloader. It can only be built for the
tools subdirectory contains a single binary that is used by the various
x.py commands shown below.
Install nightly Rust:
rustup install nightly rustup component add rust-src --toolchain nightly
Provides headers needed for compiling C code compatible with the Rust UEFI targets.
sudo apt install mingw-w64-i686-dev mingw-w64-x86-64-dev
For building OVMF:
sudo apt install acpica-tools nasm uuid-dev
Other tools used for image signing and running in a VM:
sudo apt install efitools gdisk qemu-system-x86 sbsigntool
To format, lint, test, and build both vboot and crdyboot:
To build crdyboot for both 64-bit and 32-bit UEFI targets:
One-time step to build OVMF:
One-time step to enroll custom secure-boot keys:
One-time step to copy in an existing cloudready image:
cp /path/to/cloudready.bin workspace/disk.bin
One-time step to prepare the image:
To copy the latest crdyboot build to the image:
Then run it in QEMU:
./x.py qemu [--ia32] [--secure-boot]
To test secure boot with real hardware you will need to enroll custom keys. First build the enroller image (
workspace/enroller.bin to a USB, and write
workspace/disk.bin to a second USB, e.g. using writedisk.
Boot the DUT and enter the boot setup. Find the secure boot settings and change it to setup mode. (The details will vary from one vendor to another.)
Plug in the enroller USB and reboot. Use the boot menu to select the USB and wait for it to complete.
Unplug the enroller USB and plug in the cloudready USB, then reboot. Use the boot menu to select the USB.