@@ -1,5 +1,9 @@
-#!/bin/sh
+#!/bin/bash
BOARD_DIR="$(dirname $0)"
cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
+
+# The QEMU virt machine expects flash devices to be 64M.
+truncate -s 64M "${BINARIES_DIR}/QEMU_EFI.fd"
+truncate -s 64M "${BINARIES_DIR}/QEMU_VARS.fd"
@@ -22,13 +22,12 @@ qemu-system-aarch64 \
-cpu cortex-a57 \
-m 512 \
-nographic \
- -bios </path/to/QEMU_EFI.fd> \
+ -drive file=output/images/QEMU_EFI_RESIZED.fd,if=pflash,format=raw \
+ -drive file=output/images/QEMU_VARS_RESIZED.fd,if=pflash,format=raw \
-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 .
+Note that output/images/QEMU_*.fd are the flash device files built by
+the EDK2 package.
@@ -12,6 +12,8 @@ BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_PACKAGE_HOST_GENIMAGE=y
# Bootloader
+BR2_TARGET_EDK2=y
+BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU=y
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_ARM64_EFI=y