aboutsummaryrefslogtreecommitdiff
path: root/release/tools
diff options
context:
space:
mode:
authorRebecca Cran <bcran@FreeBSD.org>2018-12-20 19:39:37 +0000
committerRebecca Cran <bcran@FreeBSD.org>2018-12-20 19:39:37 +0000
commitdb8b56134506840832bec2d1ce07b9e00d4d6d71 (patch)
tree242e3d5aea577a1691fc784b6b35da9690e23d5c /release/tools
parentd5cee48f3e65662051e15c85e4fc1841d72977fe (diff)
downloadsrc-db8b56134506840832bec2d1ce07b9e00d4d6d71.tar.gz
src-db8b56134506840832bec2d1ce07b9e00d4d6d71.zip
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
Notes
Notes: svn path=/head/; revision=342283
Diffstat (limited to 'release/tools')
-rw-r--r--release/tools/vmimage.subr9
1 files changed, 8 insertions, 1 deletions
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} \