Configuring UEFI

I followed a guide on settting up UEFI here, but on booting, I was presented with the UEFI shell.

When going into BIOS my options are

USB Hard Disk: UEFI
Hard Disk


Booting from USB works fine but the Hard Disk s not show as UEFI, although it was when I installed Ventoy on it.

Are the instructions for installing UEFI correct? They are from 2016, so they may be out of date.
 
It looks like I don't need

# gpart add -t freebsd-boot -l gpboot -b 40 -s 512K da0
da0p1 added
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0
bootcode written to da0
 
Are the instructions for installing UEFI correct?
No. Better instructions: https://wiki.freebsd.org/UEFI
Code:
# mount -t msdosfs /dev/da0p2 /mnt
# mkdir -p /mnt/EFI/BOOT
# cp /boot/boot1.efi /mnt/EFI/BOOT/
# umount /mnt
This is wrong. You can use boot1.efi but loader.efi is the recommended one. But that's not the problem. By default UEFI looks for a BOOTx64.efi file on AMD64/Intel 64 systems, not boot1.efi. So it has to be cp /boot/loader.efi /mnt/EFI/BOOT/BOOTx64.efi That's probably why your system refuses to boot and falls back on the EUFI shell.

It looks like I don't need
You don't need a freebsd-boot partition for UEFI boot. It's used when CSM is enabled, aka the traditional BIOS boot. I do recommend creating it because it allows the disk to boot in both configurations. Take extra care of the -i parameter though, it may not be the first partition on the disk. If you have an efi partition first you will overwrite it with gptboot(8) code.
 
Back
Top