Page MenuHomeFreeBSD

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

Authored by scottph on Jul 27 2020, 11:19 PM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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