mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
UEFI platforms with a Devicetree have recently gained support for some form of network booting. [1][2] On those platforms, the UEFI firmware downloads the disk image over the network and presents it to UEFI applications using the simple filesystem protocol. This is sufficient for OS loaders such as e.g. GRUB to find their configuration and load the kernel image. The firmware must also describe the ramdisk to the OS, so that it finds its root filesystem. On ACPI based platforms this is done with an NVDIMM Firmware Interface Table (NFIT). On Devicetree based platforms, this can be done with a pmem node. [3] Add a kernel config fragment to add pmem support, which enables network boot on UEFI platforms with Devicetree. Also, briefly mention that we support this scenario in the readme. This can be tested on Qemu, with the following procedure: Build aarch64_efi_defconfig in a folder, to obtain output/images/disk.img, and serve the image over HTTP with python: $ python -m http.server -d output/images/ In another terminal and another folder, configure a U-Boot based firmware starting from qemu_aarch64_ebbr_defconfig, and with the following additional configurations: BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2026.04" BR2_TARGET_UBOOT_NEEDS_DTC=y Add the following U-Boot configurations to board/qemu/aarch64-ebbr/u-boot.fragment: CONFIG_EFI_HTTP_BOOT=y CONFIG_NET_LWIP=y Build everything; you should obtain output/images/flash.bin. Start Qemu as per board/qemu/aarch64-ebbr/readme.txt, but omitting the hd0 -device and -drive stanzas. U-Boot should start; interrupt it with enter. At U-Boot prompt, type the following commands: => setenv loadaddr 0x43000000 => efidebug boot rm 0 => efidebug boot add -u 0 net http://10.0.2.2:8000/disk.img => efidebug boot order 0 => bootefi bootmgr U-Boot should download the disk image over HTTP and boot Linux with UEFI. Look for the following message in Linux boot log, to confirm that it did indeed mount its rootfs from the downloaded image: EXT4-fs (pmem0p2): mounted filesystem ... Link: https://www.linaro.org/blog/installing-fedora-with-uefi-http-boot/ [1] Link: https://docs.u-boot-project.org/en/latest/develop/uefi/uefi.html#uefi-http-boot-using-the-legacy-tcp-stack [2] Link: https://github.com/ARM-software/edge-iot-arch-guide/blob/main/source/http-boot/pmem_node.md [3] Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Dick Olsson <hi@senzilla.io> Signed-off-by: Julien Olivain <ju.o@free.fr>
The aarch64_efi_defconfig allows to build a minimal Linux system that can boot on all AArch64 servers providing an EFI firmware. This includes all Arm EBBR[1] compliant systems, and all Arm SystemReady[2] compliant systems for example. Building and booting ==================== $ make aarch64_efi_defconfig $ make The file output/images/disk.img is a complete disk image that can be booted, it includes the grub2 bootloader, Linux kernel and root filesystem. Testing under Qemu ================== This image can also be tested using Qemu: qemu-system-aarch64 \ -M virt \ -cpu cortex-a57 \ -m 512 \ -nographic \ -bios </path/to/QEMU_EFI.fd> \ -drive file=output/images/disk.img,if=none,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -netdev user,id=eth0 \ -device virtio-net-device,netdev=eth0 Note that </path/to/QEMU_EFI.fd> needs to point to a valid aarch64 UEFI firmware image for qemu. It may be provided by your distribution as a edk2-aarch64 or AAVMF package, in path such as /usr/share/edk2/aarch64/QEMU_EFI.fd . U-Boot based qemu firmware ========================== A qemu firmware with support for UEFI based on U-Boot can be built following the instructions in [3], with qemu_arm64_defconfig. This should give you a nor_flash.bin, which you can use with qemu as an alternative to QEMU_EFI.fd. You will also need to change the machine specification to "-M virt,secure=on" on qemu command line, to enable TrustZone support, and you will need to increase the memory with "-m 1024". HTTP boot --------- Some U-Boot and Devicetree based firmwares are capable of booting with UEFI from HTTP(s). [4] The aarch64_efi_defconfig has appropriate persistent memory support compiled in the Linux kernel to support this scenario. [5] [1]: https://github.com/ARM-software/ebbr [2]: https://developer.arm.com/architectures/system-architectures/arm-systemready [3]: https://github.com/glikely/u-boot-tfa-build [4]: https://docs.u-boot-project.org/en/latest/develop/uefi/uefi.html#uefi-http-boot-using-the-legacy-tcp-stack [5]: https://github.com/ARM-software/edge-iot-arch-guide/blob/main/source/http-boot/pmem_node.md