From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01a.ixn.mail.zen.net.uk (smarthost01a.ixn.mail.zen.net.uk [212.23.1.20]) by mx.groups.io with SMTP id smtpd.web11.3508.1645393147211350188 for ; Sun, 20 Feb 2022 13:39:07 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.20, mailfrom: sean@starlabs.systems) Received: from [217.155.46.38] (helo=sean-StarBook.lan) by smarthost01a.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nLtv7-0001VS-MH; Sun, 20 Feb 2022 21:39:05 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: guo.dong@intel.com, Sean Rhodes , Ray Ni , Maurice Ma , Benjamin You Subject: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable Date: Sun, 20 Feb 2022 21:39:03 +0000 Message-Id: <330fb76dffcd8ee2d3dfdbb395f1b1ae2707a6f3.1645393143.git.sean@starlabs.systems> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Originating-smarthost01a-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 Content-Transfer-Encoding: quoted-printable Provide a build option to use [Esc] instead of [F2] for devices such as Chromebooks that don't have F-keys. Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Signed-off-by: Sean Rhodes --- .../Library/BrotliCustomDecompressLib/brotli | 2 +- .../PlatformBootManager.c | 44 +++++++++++++------ .../PlatformBootManagerLib.inf | 1 + UefiPayloadPkg/UefiPayloadPkg.dec | 3 ++ UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++ 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli b/MdeMod= ulePkg/Library/BrotliCustomDecompressLib/brotli index f4153a09f8..666c3280cc 160000 --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli @@ -1 +1 @@ -Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea +Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= ger.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 ( )=0D {=0D EFI_INPUT_KEY Enter;=0D - EFI_INPUT_KEY F2;=0D + EFI_INPUT_KEY CustomKey;=0D EFI_INPUT_KEY Down;=0D EFI_BOOT_MANAGER_LOAD_OPTION BootOption;=0D EFI_STATUS Status;=0D @@ -186,13 +186,22 @@ PlatformBootManagerBeforeConsole ( Enter.UnicodeChar =3D CHAR_CARRIAGE_RETURN;=0D EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);=0D =0D - //=0D - // Map F2 to Boot Manager Menu=0D - //=0D - F2.ScanCode =3D SCAN_F2;=0D - F2.UnicodeChar =3D CHAR_NULL;=0D + if (FixedPcdGetBool (PcdBootManagerEscape)) {=0D + //=0D + // Map Esc to Boot Manager Menu=0D + //=0D + CustomKey.ScanCode =3D SCAN_ESC;=0D + CustomKey.UnicodeChar =3D CHAR_NULL;=0D + } else {=0D + //=0D + // Map Esc to Boot Manager Menu=0D + //=0D + CustomKey.ScanCode =3D SCAN_F2;=0D + CustomKey.UnicodeChar =3D CHAR_NULL;=0D + }=0D +=0D EfiBootManagerGetBootManagerMenu (&BootOption);=0D - EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumbe= r, 0, &F2, NULL);=0D + EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumbe= r, 0, &CustomKey, NULL);=0D =0D //=0D // Also add Down key to Boot Manager Menu since some serial terminals do= n't support F2 key.=0D @@ -251,12 +260,21 @@ PlatformBootManagerAfterConsole ( //=0D PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", L= OAD_OPTION_ACTIVE);=0D =0D - Print (=0D - L"\n"=0D - L"F2 or Down to enter Boot Manager Menu.\n"=0D - L"ENTER to boot directly.\n"=0D - L"\n"=0D - );=0D + if (FixedPcdGetBool (PcdBootManagerEscape)) {=0D + Print (=0D + L"\n"=0D + L"Esc or Down to enter Boot Manager Menu.\n"=0D + L"ENTER to boot directly.\n"=0D + L"\n"=0D + );=0D + } else {=0D + Print (=0D + L"\n"=0D + L"F2 or Down to enter Boot Manager Menu.\n"=0D + L"ENTER to boot directly.\n"=0D + L"\n"=0D + );=0D + }=0D }=0D =0D /**=0D diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= gerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= gerLib.inf index 9c4a9da943..80390e0d98 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf @@ -73,3 +73,4 @@ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity=0D gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits=0D gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile=0D + gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape=0D diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayload= Pkg.dec index 551f0a4915..f2fcdf6a74 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dec +++ b/UefiPayloadPkg/UefiPayloadPkg.dec @@ -83,6 +83,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSi= ze|0x04000000|UINT32|0x =0D gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0= xab, 0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 }|VOI= D*|0x00000018=0D =0D +# Boot Manager Key=0D +gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0000002= 0=0D +=0D ## FFS filename to find the default variable initial data file.=0D # @Prompt FFS Name of variable initial data file=0D gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0= x42, 0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 }|VOI= D*|0x00000025=0D diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 1ce96a51c1..ee9680a2b7 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -33,6 +33,7 @@ DEFINE UNIVERSAL_PAYLOAD =3D FALSE=0D DEFINE SECURITY_STUB_ENABLE =3D TRUE=0D DEFINE SMM_SUPPORT =3D FALSE=0D + DEFINE BOOT_MANAGER_ESCAPE =3D FALSE=0D #=0D # SBL: UEFI payload for Slim Bootloader=0D # COREBOOT: UEFI payload for coreboot=0D @@ -399,6 +400,8 @@ gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask | 0x1=0D !endif=0D =0D + gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE= )=0D +=0D [PcdsPatchableInModule.X64]=0D gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)= =0D gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER= )=0D --=20 2.32.0