Too many BIOSes (so far only confirmed on amd64) don't really support
efibootmgr selection of boot. That's the most reliable, when it works,
since there's no guesswork. However, many do not save, unmolested, the
variables that efibootmgr sets, so as a fallback we also install
loader.efi as bootXXX.efi (where XXX is either aa64 or x64) if it
doesn't already exist in /efi/boot on the ESP. The standard only
defines this for removable devices, but it's almost ubiquitously used
as a fallback. Many BIOSes implement a drive selection feature that
takes over the efibootmgr protocol, rendinering it useless (either
generally, or for those vendors not on the short list). bootxxx.efi
works around this. However, we don't install it unconditionally there,
as that breaks some popular multi-boot setups.
Details
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 33555 Build 30810: arc lint + arc unit
Event Timeline
usr.sbin/bsdinstall/scripts/bootconfig | ||
---|---|---|
134 | Do we want BOOTx64.EFI or bootx64.efi |
Another case where this might happen is in PR249320 - my laptop had a mb swap, and so lost the EFI variables. It was slightly awkward to get it booted again (to copy to bootx64.efi, or run efiboomgr).
usr.sbin/bsdinstall/scripts/bootconfig | ||
---|---|---|
128 | style nit - other bsdinstall source lines up the cases themselves under case |
You description is wrong. No BIOS will boot off an EFI partition. Don't mix BIOS and UEFI firmware implementation.
usr.sbin/bsdinstall/scripts/bootconfig | ||
---|---|---|
166 | Are you certain that this will not overwrite existing entries? |
BIOS is the generic program that runs before the OS. UEFI is a kind of BIOS. This terminology pre-dates the IBM/PC and was used in CP/M and others.
CMS is what will never load a program from an ESP.
usr.sbin/bsdinstall/scripts/bootconfig | ||
---|---|---|
166 | -f file True if file exists and is a regular file. ! expression True if expression is false. So if ! -f --> no file exists, then we copy. |
I don't consider UEFI to be basic at all, both are completely different. If you would refer to it as firmware, I would agree, but not to UEFI as BIOS.
Agreed. People still call it a "BIOS" due to inertia, but we should be precise and call it UEFI or perhaps system firmware.
For example, Microsoft has done a lot of work around UEFI, and talks about it like this:
Detect if WinPE is booted into BIOS or UEFI Mode
Return code Firmware mode
0x1 BIOS
0x2 UEFI
usr.sbin/bsdinstall/scripts/bootconfig | ||
---|---|---|
134 | Since the EFI partition has a FAT filesystem which isn't case-sensitive it doesn't matter. |
usr.sbin/bsdinstall/scripts/bootconfig | ||
---|---|---|
157 | There are also ways to lose the boot manager entries on physical platforms too -- for example a firmware update often requires resetting the configuration, which is frustrating when BOOTx64.efi doesn't exist. |
usr.sbin/bsdinstall/scripts/bootconfig | ||
---|---|---|
157 | True, but this can be worked around. |