Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145898388
D55469.id172553.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D55469.id172553.diff
View Options
diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig
--- a/usr.sbin/bsdinstall/scripts/bootconfig
+++ b/usr.sbin/bsdinstall/scripts/bootconfig
@@ -83,11 +83,13 @@
update_uefi_bootentry()
{
- nentries=$(efibootmgr | grep -c "${EFI_LABEL_NAME}$")
+ local nentries=$(efibootmgr | grep -c "${EFI_LABEL_NAME}$")
+ local loader_path=$1
+
# No entries so directly create one and return
if [ ${nentries} -eq 0 ]; then
f_dprintf "Creating UEFI boot entry"
- efibootmgr --create --activate --label "$EFI_LABEL_NAME" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null
+ efibootmgr --create --activate --label "$EFI_LABEL_NAME" --loader "${loader_path}" > /dev/null
return
fi
@@ -97,13 +99,13 @@
for entry in $(efibootmgr | awk "\$NF == \"$EFI_LABEL_NAME\" { sub(/.*Boot/,\"\", \$1); sub(/\*/,\"\", \$1); print \$1 }"); do
efibootmgr -B -b ${entry}
done
- efibootmgr --create --activate --label "$EFI_LABEL_NAME" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null
+ efibootmgr --create --activate --label "$EFI_LABEL_NAME" --loader "${loader_path}" > /dev/null
return
fi
FREEBSD_BOOTLABEL=$(dialog_uefi_entryname "${EFI_LABEL_NAME}")
[ $? -eq $DIALOG_CANCEL ] && exit 1
- efibootmgr --create --activate --label "$FREEBSD_BOOTLABEL" --loader "${mntpt}/${FREEBSD_BOOTNAME}" > /dev/null
+ efibootmgr --create --activate --label "$FREEBSD_BOOTLABEL" --loader "${loader_path}" > /dev/null
}
f_dialog_title "Boot Configuration"
@@ -151,21 +153,22 @@
# over gmirror, so we only do this for ZFS.
esps=${TMPDIR:-"/tmp"}/bsdinstall-esps
if [ -f "$esps" ]; then
- mntpt=$(mktemp -d -t bsdinstall-esp)
+ tmpdir=$(mktemp -d -t bsdinstall-esp)
for dev in $(cat $esps); do
f_dprintf "Installing ${file} onto redundant ESP ${dev}"
- mount -t msdos "$dev" "$mntpt"
+ mount -t msdos "$dev" "$tmpdir"
uefi_copy_loader "$BSDINSTALL_CHROOT/boot/${file}" \
- "${mntpt}/efi/freebsd" "${mntpt}/efi/boot" \
+ "${tmpdir}/efi/freebsd" "${tmpdir}/efi/boot" \
boot${ARCHBOOTNAME}.efi
- umount "$mntpt"
+ umount "$tmpdir"
done
- rmdir "${mntpt}"
+ rmdir "${tmpdir}"
fi
- # Try to set the UEFI NV BootXXXX variables to record the boot location
+ # Try to set the UEFI NV BootXXXX variables to record the boot location.
+ # Note that the ESP is mounted at ${mntpt}/efi.
if [ "$BSDINSTALL_CONFIGCURRENT" ] && [ "$ARCHBOOTNAME" != ia32 ]; then
- update_uefi_bootentry
+ update_uefi_bootentry "${mntpt}/efi/freebsd/${file}"
fi
f_dprintf "Finished configuring ESP"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 26, 9:48 PM (11 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28981233
Default Alt Text
D55469.id172553.diff (2 KB)
Attached To
Mode
D55469: bsdinstall: fix EFI boot entry creation
Attached
Detach File
Event Timeline
Log In to Comment