Page MenuHomeFreeBSD

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

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

Details

Reviewers
imp
manu
bcran
Group Reviewers
manpages
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
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

scottph created this revision.Mon, Jul 27, 11:19 PM
scottph requested review of this revision.Mon, Jul 27, 11:19 PM
bcr accepted this revision as: manpages.Tue, Jul 28, 6:42 AM
bcr added a subscriber: bcr.

OK from manpages.

manu accepted this revision.Tue, Jul 28, 7:27 AM

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.Tue, Jul 28, 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.

imp added inline comments.Tue, Jul 28, 3:21 PM
usr.sbin/efibootmgr/efibootmgr.8
144

Does linux have a similar option?

scottph added inline comments.Tue, Jul 28, 4:29 PM
usr.sbin/efibootmgr/efibootmgr.8
144

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.

scottph added inline comments.Tue, Jul 28, 5:05 PM
usr.sbin/efibootmgr/efibootmgr.8
144

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?