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

View File

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

View File

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