aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2020-10-09 00:16:26 +0000
committerWarner Losh <imp@FreeBSD.org>2020-10-09 00:16:26 +0000
commitc6d56081c9dca474130c0b34c39451b21c55102f (patch)
tree21fa9d1b9a5feae127c01c796a5314fff9a19058
parent42f96162c3d648ea4302dbb4c28b1edf1da3651b (diff)
downloadsrc-c6d56081c9dca474130c0b34c39451b21c55102f.tar.gz
src-c6d56081c9dca474130c0b34c39451b21c55102f.zip
Notes
-rwxr-xr-xusr.sbin/bsdinstall/scripts/bootconfig24
1 files changed, 24 insertions, 0 deletions
diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig
index 944a2f10681a..93a3bc0a53c2 100755
--- a/usr.sbin/bsdinstall/scripts/bootconfig
+++ b/usr.sbin/bsdinstall/scripts/bootconfig
@@ -124,6 +124,15 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then
done
fi
+ case $(uname -m) in
+ arm64) ARCHBOOTNAME=aa64 ;;
+ amd64) ARCHBOOTNAME=x64 ;;
+ # arm) ARCHBOOTNAME=arm ;; # No other support for arm install
+ # i386) ARCHBOOTNAME=ia32 ;; # no support for this in i386 kernels, rare machines
+ *) die "Unsupported arch $(uname -m) for UEFI install"
+ esac
+ BOOTNAME="/EFI/BOOT/BOOT${ARCHBOOTNAME}.EFI"
+
for esp in $ESPS; do
f_dprintf "Formatting /dev/${esp} as FAT32"
newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1
@@ -142,6 +151,21 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then
mkdir -p "$mntpt/EFI/freebsd"
cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi"
+ #
+ # The following shouldn't be necessary. UEFI defines a way to
+ # specifically select what to boot (which we do via
+ # efibootmgr). However, virtual environments often times lack
+ # support for the NV variables efibootmgr sets. In addition,
+ # some UEFI implementations have features that interfere with
+ # the setting of these variables. To combat that, we install the
+ # default removable media boot file as a fallback if it doesn't
+ # exist. We don't install it all the time since that can
+ # interfere with other installations on the drive (like rEFInd).
+ #
+ if [ ! -f "${mntpt}/${BOOTNAME}" ]; then
+ cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${BOOTNAME}"
+ fi
+
if [ "$num_esps" -gt 1 ]; then
bootlabel="FreeBSD (${esp})"
else