From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.sbp.mail.zen.net.uk (smarthost01b.sbp.mail.zen.net.uk [212.23.1.3]) by mx.groups.io with SMTP id smtpd.web09.39104.1643662333334767331 for ; Mon, 31 Jan 2022 12:52:13 -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.3, mailfrom: sean@starlabs.systems) Received: from [217.155.46.38] (helo=sean-StarBook.lan) by smarthost01b.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nEdek-0004aU-SC; Mon, 31 Jan 2022 20:52:10 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Sean Rhodes Subject: [PATCH 43/43] UefiPayloadPkg: Make Boot Manager Key configurable Date: Mon, 31 Jan 2022 20:52:07 +0000 Message-Id: <53aafe973bba20c146ae8a2dc51ee4f37e3f5207.1643662304.git.sean@starlabs.systems> X-Mailer: git-send-email 2.32.0 In-Reply-To: <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662304.git.sean@starlabs.systems> References: <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662304.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01b-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. Signed-off-by: Sean Rhodes --- .../PlatformBootManager.c | 43 +++++++++++++------ .../PlatformBootManagerLib.inf | 1 + UefiPayloadPkg/UefiPayloadPkg.dec | 3 ++ UefiPayloadPkg/UefiPayloadPkg.dsc | 8 ++++ 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= ger.c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c index a8ead775ea..6163e776c4 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,21 @@ 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 EfiBootManagerGetBootManagerMenu (&BootOption);=0D - EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumbe= r, 0, &F2, NULL);=0D + EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumb= er, 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 +259,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..7246c3495b 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|TRUE|BOOLEAN|0x00000020= =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..3d7c7a6baf 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -33,6 +33,8 @@ 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 + DEFINE PLATFORM_BOOT_TIMEOUT =3D 3=0D #=0D # SBL: UEFI payload for Slim Bootloader=0D # COREBOOT: UEFI payload for coreboot=0D @@ -399,6 +401,12 @@ gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask | 0x1=0D !endif=0D =0D +!if $(BOOT_MANAGER_ESCAPE) =3D=3D TRUE=0D + gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|TRUE=0D +!else=0D + gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE=0D +!endif=0D +=0D [PcdsPatchableInModule.X64]=0D gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)= =0D gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER= )=0D --=20 2.32.0