OvmfPkg/PlatformBootManagerLib: Introduce support for fw_cfg for UEFI Shell

usage: qemu -fw_cfg name=opt/org.tianocore/EFIShellSupport,string=no

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
This commit is contained in:
Luigi Leonardi 2024-12-13 12:19:14 +01:00 committed by mergify[bot]
parent 07bb226542
commit 103aed83a7
3 changed files with 17 additions and 1 deletions

View File

@ -15,6 +15,8 @@
#include <Library/Tcg2PhysicalPresenceLib.h> #include <Library/Tcg2PhysicalPresenceLib.h>
#include <Library/XenPlatformLib.h> #include <Library/XenPlatformLib.h>
#include <Library/QemuFwCfgSimpleParserLib.h>
// //
// Global data // Global data
// //
@ -1843,6 +1845,18 @@ PlatformBootManagerAfterConsole (
EfiBootManagerRefreshAllBootOption (); EfiBootManagerRefreshAllBootOption ();
} }
BOOLEAN ShellEnabled;
RETURN_STATUS RetStatus;
RetStatus = QemuFwCfgParseBool (
"opt/org.tianocore/EFIShellSupport",
&ShellEnabled
);
if (RETURN_ERROR (RetStatus)) {
ShellEnabled = TRUE;
}
// //
// Register UEFI Shell // Register UEFI Shell
// //
@ -1850,7 +1864,7 @@ PlatformBootManagerAfterConsole (
&gUefiShellFileGuid, &gUefiShellFileGuid,
L"EFI Internal Shell", L"EFI Internal Shell",
LOAD_OPTION_ACTIVE, LOAD_OPTION_ACTIVE,
TRUE ShellEnabled
); );
// //

View File

@ -56,6 +56,7 @@
PlatformBmPrintScLib PlatformBmPrintScLib
Tcg2PhysicalPresenceLib Tcg2PhysicalPresenceLib
XenPlatformLib XenPlatformLib
QemuFwCfgSimpleParserLib
[Pcd] [Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent

View File

@ -168,6 +168,7 @@
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxeLib.inf QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxeLib.inf
QemuFwCfgSimpleParserLib|OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParserLib.inf
QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf