summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Library
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2022-03-05 03:14:34 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-03-07 20:43:58 +0000
commitaf74efe494c5920c7992b543fada1af2b186bd8c (patch)
tree0a747927ba862129b86ddf4c5043294ec0ee1304 /UefiPayloadPkg/Library
parent79f2734e5a7bc2e5256eb0e599f45407855159c7 (diff)
downloadedk2-af74efe494c5920c7992b543fada1af2b186bd8c.tar.gz
edk2-af74efe494c5920c7992b543fada1af2b186bd8c.tar.bz2
edk2-af74efe494c5920c7992b543fada1af2b186bd8c.zip
UefiPayloadPkg: Make Boot Manager Key configurable
Provide a build option to use [Esc] instead of [F2] for devices such as Chromebooks that don't have F-keys. Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Ray Ni <ray.ni@Intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com>
Diffstat (limited to 'UefiPayloadPkg/Library')
-rw-r--r--UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c44
-rw-r--r--UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf1
2 files changed, 32 insertions, 13 deletions
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -164,7 +164,7 @@ PlatformBootManagerBeforeConsole (
)
{
EFI_INPUT_KEY Enter;
- EFI_INPUT_KEY F2;
+ EFI_INPUT_KEY CustomKey;
EFI_INPUT_KEY Down;
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
EFI_STATUS Status;
@@ -186,13 +186,22 @@ PlatformBootManagerBeforeConsole (
Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;
EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);
- //
- // Map F2 to Boot Manager Menu
- //
- F2.ScanCode = SCAN_F2;
- F2.UnicodeChar = CHAR_NULL;
+ if (FixedPcdGetBool (PcdBootManagerEscape)) {
+ //
+ // Map Esc to Boot Manager Menu
+ //
+ CustomKey.ScanCode = SCAN_ESC;
+ CustomKey.UnicodeChar = CHAR_NULL;
+ } else {
+ //
+ // Map Esc to Boot Manager Menu
+ //
+ CustomKey.ScanCode = SCAN_F2;
+ CustomKey.UnicodeChar = CHAR_NULL;
+ }
+
EfiBootManagerGetBootManagerMenu (&BootOption);
- EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &F2, NULL);
+ EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &CustomKey, NULL);
//
// Also add Down key to Boot Manager Menu since some serial terminals don't support F2 key.
@@ -251,12 +260,21 @@ PlatformBootManagerAfterConsole (
//
PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", LOAD_OPTION_ACTIVE);
- Print (
- L"\n"
- L"F2 or Down to enter Boot Manager Menu.\n"
- L"ENTER to boot directly.\n"
- L"\n"
- );
+ if (FixedPcdGetBool (PcdBootManagerEscape)) {
+ Print (
+ L"\n"
+ L"Esc or Down to enter Boot Manager Menu.\n"
+ L"ENTER to boot directly.\n"
+ L"\n"
+ );
+ } else {
+ Print (
+ L"\n"
+ L"F2 or Down to enter Boot Manager Menu.\n"
+ L"ENTER to boot directly.\n"
+ L"\n"
+ );
+ }
}
/**
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9c4a9da943..80390e0d98 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -73,3 +73,4 @@
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile
+ gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape