Page MenuHomeFreeBSD

efibootmgr: Add option to request booting to the firmware user interface
ClosedPublic

Authored by scottph on Jul 27 2020, 11:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 10:09 PM
Unknown Object (File)
Feb 8 2024, 4:06 AM
Unknown Object (File)
Dec 23 2023, 12:51 AM
Unknown Object (File)
Dec 13 2023, 8:10 AM
Unknown Object (File)
Nov 8 2023, 7:25 PM
Unknown Object (File)
Nov 6 2023, 10:56 PM
Unknown Object (File)
Nov 5 2023, 5:41 PM
Unknown Object (File)
Nov 3 2023, 6:50 AM

Details

Summary

The OsIndications UEFI variable can request the firware to stop at
its UI instead of continuing with boot. Add flags for setting and
clearing this request.

MFC after: 1 week
Sponsored by: Ampere Computing, Inc.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bcr added a subscriber: bcr.

OK from manpages.

LGTM.
I didn't knew this features, looks useful, is the variable reset by the firmware ? (Or at least is supposed to be ?)

This revision is now accepted and ready to land.Jul 28 2020, 7:27 AM
In D25839#572447, @manu wrote:

I didn't knew this features, looks useful, is the variable reset by the firmware ? (Or at least is supposed to be ?)

If you have a Windows 10 box nearby, you can see it in the advanced reboot options. Yes, of course it doesn't keep looping in the setup screen after exiting it :) It is indeed a "next boot" request.

In D25839#572447, @manu wrote:

LGTM.
I didn't knew this features, looks useful, is the variable reset by the
firmware ? (Or at least is supposed to be ?)

The UEFI spec sec 8.5.4 says

Once the firmware consumes this bit in the OsIndications variable and stops at
the firmware user interface, the firmware should clear the bit from the
OsIndications variable in order to acknowledge to the OS that the information
was consumed and, more importantly, to prevent the firmware user interface from
showing again on subsequent boots.

So with the firmware "should" be doing that, but from the wording it seems like
firmwares that don't are a possibility.

usr.sbin/efibootmgr/efibootmgr.8
144 ↗(On Diff #75030)

Does linux have a similar option?

usr.sbin/efibootmgr/efibootmgr.8
144 ↗(On Diff #75030)

efibootmgr on linux doesn't have support for any interaction with OsIndications. There it seems the mechanism is to send the "SetRebootToFirmwareSetup" dbus request to logind which then sets OsIndications for you.

peeking into the linux efibootmgr repository, it seems they have added a -f/-F option which controls setting LOAD_OPTION_FORCE_RECONNECT on a boot option.

usr.sbin/efibootmgr/efibootmgr.8
144 ↗(On Diff #75030)

oh and to be clear, efibootmgr doesn't send that dbus request. That is sent by systemctl reboot --firmware-setup

So this is the moral equivalent of ipmitool chassis bootdev bios?

So this is the moral equivalent of ipmitool chassis bootdev bios?

Yep, exactly so