diff options
author | Luigi Leonardi <leonardi@redhat.com> | 2024-12-13 12:19:14 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-12-23 10:36:19 +0000 |
commit | 103aed83a7e4a71bf93ee6f8caa937f5e9a21411 (patch) | |
tree | fd074e5fb4c59beaa153a0a987e94276776251eb | |
parent | 07bb2265426d94411c7f185478e614f624c56050 (diff) | |
download | edk2-103aed83a7e4a71bf93ee6f8caa937f5e9a21411.tar.gz |
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>
-rw-r--r-- | OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 16 | ||||
-rw-r--r-- | OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 | ||||
-rw-r--r-- | OvmfPkg/OvmfXen.dsc | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c index 579eae8780..fdd4db5ca8 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -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
);
//
diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index c6ffc1ed9e..1a422ebb0e 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -56,6 +56,7 @@ PlatformBmPrintScLib
Tcg2PhysicalPresenceLib
XenPlatformLib
+ QemuFwCfgSimpleParserLib
[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 5e845e5f91..3f52483dc0 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -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
|