Skip to content

Commit dd5cce3

Browse files
luigix25mergify[bot]
authored andcommittedMar 13, 2025·
OvmfPkg/PlatformBootManagerCommonLib: Set UiApp as an optional boot option
Introduce gUiAppFileGuid: it has the same value of UiApp guid defined in the .inf file. This is used to register UiApp as a boot entry in the BootManagerMenu. This registration is done in PlatformBootManagerBeforeConsole because it must be done before the hotkeys are registered. This is because in a system with hotkeys still bound to UiApp, but with firmware disabled, you can still boot into the latter by hitting ESC or F2 during boot. UiApp can be enabled/disabled using fw_cfg option FirmwareSetupSupport Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
1 parent ca278f1 commit dd5cce3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
 

‎OvmfPkg/Library/PlatformBootManagerLibLight/PlatformBm.c

+17
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ PlatformBootManagerBeforeConsole (
777777
UINT16 FrontPageTimeout;
778778
RETURN_STATUS PcdStatus;
779779
EFI_STATUS Status;
780+
BOOLEAN FirmwareSetupEnabled;
780781

781782
//
782783
// Signal EndOfDxe PI Event
@@ -877,6 +878,22 @@ PlatformBootManagerBeforeConsole (
877878
Status
878879
));
879880

881+
Status = QemuFwCfgParseBool (
882+
"opt/org.tianocore/FirmwareSetupSupport",
883+
&FirmwareSetupEnabled
884+
);
885+
886+
if (RETURN_ERROR (Status)) {
887+
FirmwareSetupEnabled = TRUE;
888+
}
889+
890+
PlatformRegisterFvBootOption (
891+
&gUiAppFileGuid,
892+
L"EFI Firmware Setup",
893+
LOAD_OPTION_ACTIVE | LOAD_OPTION_CATEGORY_APP,
894+
FirmwareSetupEnabled
895+
);
896+
880897
//
881898
// Register platform-specific boot options and keyboard shortcuts.
882899
//

‎OvmfPkg/Library/PlatformBootManagerLibLight/PlatformBootManagerLib.inf

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
gEfiGlobalVariableGuid
7272
gRootBridgesConnectedEventGroupGuid
7373
gUefiShellFileGuid
74+
gUiAppFileGuid
7475

7576
[Protocols]
7677
gEfiFirmwareVolume2ProtocolGuid

0 commit comments

Comments
 (0)
Please sign in to comment.