From db8b56134506840832bec2d1ce07b9e00d4d6d71 Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Thu, 20 Dec 2018 19:39:37 +0000 Subject: Rework UEFI ESP generation Currently, the installer uses pre-created 800KB FAT12 filesystems that it dd's onto the ESP partition. This changeset improves that by having the installer generate a FAT32 filesystem directly onto the ESP using newfs_msdos and then copying loader.efi into /EFI/freebsd. For live installs it then runs efibootmgr to add a FreeBSD boot entry in the BIOS. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D17947 --- release/tools/vmimage.subr | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'release/tools/vmimage.subr') diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index d36b47d86123..287c2741f156 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -6,6 +6,9 @@ # Common functions for virtual machine image build scripts. # +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../../tools/boot/install-boot.sh + export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin" trap "cleanup" INT QUIT TRAP ABRT TERM @@ -29,10 +32,14 @@ write_partition_layout() { -o ${VMIMAGE} ;; arm64:aarch64) + # Create an ESP + espfilename=$(mktemp /tmp/efiboot.XXXXXX) + make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi mkimg -s mbr -f ${VMFORMAT} \ - -p efi:=${BOOTFILES}/efi/boot1/boot1.efifat \ + -p efi:=${espfilename} \ -p freebsd:=${VMBASE} \ -o ${VMIMAGE} + rm ${espfilename} ;; powerpc:powerpc*) mkimg -s apm -f ${VMFORMAT} \ -- cgit v1.2.3