aboutsummaryrefslogtreecommitdiff
path: root/release/i386/make-memstick.sh
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/i386/make-memstick.sh
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/i386/make-memstick.sh')
-rwxr-xr-xrelease/i386/make-memstick.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/release/i386/make-memstick.sh b/release/i386/make-memstick.sh
index 6774e86ae550..92818ec6e6da 100755
--- a/release/i386/make-memstick.sh
+++ b/release/i386/make-memstick.sh
@@ -12,6 +12,9 @@
set -e
+scriptdir=$(dirname $(realpath $0))
+. ${scriptdir}/../../tools/boot/install-boot.sh
+
PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH
@@ -36,9 +39,15 @@ makefs -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${1}
rm ${1}/etc/fstab
rm ${1}/etc/rc.conf.local
+# Make an ESP in a file.
+espfilename=$(mktemp /tmp/efiboot.XXXXXX)
+make_esp_file ${espfilename} ${fat32min} ${1}/boot/loader.efi
+
mkimg -s mbr \
-b ${1}/boot/mbr \
+ -p efi:=${espfilename}
-p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \
-o ${2}
+rm ${espfilename}
rm ${2}.part