Bug 247845 - FreeBSD does not boot when UEFI bootvar entry does not exist in NVRAM
Summary: FreeBSD does not boot when UEFI bootvar entry does not exist in NVRAM
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 12.1-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Keywords: uefi
Depends on:
Reported: 2020-07-08 10:50 UTC by Michael Osipov
Modified: 2020-09-14 18:22 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov 2020-07-08 10:50:30 UTC
I'll try to be as detailed as possible:
I have a Fujitsu CELSIUS W410 which has M/B D3062-A13 by Fujitsu. The fireware version is up to date: V4.6.4.0 - R1.29.0 (18.06.2015). Yes, the machine is old. I have unplugged all drives which still contain Windows to avoid any issues during installation/boot.
The firmware config is set to UEFI mode only, no CSM, no ATAPI. Pure new mode. Downloaded FreeBSD-12.1-STABLE-amd64-20200702-r362880-memstick.img and wrote to a stick with Rufus. The firmware properly shows it as "UEFI: <stick name>". The FreeBSD EFI loader comes up and I am can install the system.
I have selected Auto (UFS) on the 60 GB SSD, bsdinstall created ESP, ufs for / and swap. Reboot the system, nothing happens. ESP DOES contain the default loader, but not picked up by the system. After some digging I have found: https://forums.freebsd.org/threads/cant-boot-on-uefi.68141/#post-406138. efibootmgr -v does not show any bootvar in NVRAM. Strage. Added manually one, the system started to boot, even "gop list" works.
Tried FreeBSD-13.0-CURRENT-amd64-20200702-r362853-memstick.img, installed the same way with UFS, there is a bootvar in NVRAMm, it has been created automatically.
After some search I have found: https://github.com/freebsd/freebsd/blob/master/usr.sbin/bsdinstall/scripts/bootconfig#L151-L152 which does not exist fo 12-STABLE: https://github.com/freebsd/freebsd/blob/4df7391aa971ab3c1ac672de3eb5ed72a384b58f/usr.sbin/bsdinstall/scripts/bootconfig#L38-L39

My understanding is that FreeBSD 12 relies on the default fallback loader while the UEFI implementation of my M/B does not locate it on disk although this one has been selected for boot. I guess my firmware is buggy, but FreeBSD 12 does not know about that. Since 12 is the latest and greatest for the years to come, I expect some better handling: either an explicit bootvar or or warning that the fallback might not always work on all systems. Others will trip with way less knowledge to dig into.
Comment 1 Michael Osipov 2020-07-08 10:52:39 UTC
I have just found: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1366546/comments/1

If this is correct, FreeBSD fails to create the entry and thus being non-UEFI compliant.