From nobody Sun Nov 24 12:30:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+86812+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86812+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16453793852522.9164199614855306; Sun, 20 Feb 2022 09:49:45 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id N1fZYY1788612xBr0B8B4Axl; Sun, 20 Feb 2022 09:49:46 -0800 X-Received: from smarthost01a.sbp.mail.zen.net.uk (smarthost01a.sbp.mail.zen.net.uk [212.23.1.1]) by mx.groups.io with SMTP id smtpd.web09.995.1645379383857869576 for ; Sun, 20 Feb 2022 09:49:44 -0800 X-Received: from [217.155.46.38] (helo=sean-StarBook.lan) by smarthost01a.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nLqL6-0004pg-Cx; Sun, 20 Feb 2022 17:49:40 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: guo.dong@intel.com, Sean Rhodes , Ray Ni , Maurice Ma , Benjamin You Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable Date: Sun, 20 Feb 2022 17:49:38 +0000 Message-Id: <9952101ad95845e055baed9256efc61bbdfccf98.1645379378.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01a-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sean@starlabs.systems X-Gm-Message-State: SMDQ6CVIwy3c68CihTpEOLcJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1645379386; bh=0Qv3EOEixjzFnDoPZ9ty0cAS0WXN/ctfcZ4d6o7Fjrc=; h=Cc:Date:From:Reply-To:Subject:To; b=Rs8MkIGGfDPLvolj5UW4jLJaGbXZv+diiATpWr4qZwoKb1R0v6sw2bnZmBXA3Ch6UN0 ITmoV4nLVsyysz1lXJcm+4Mc4Nbc3hc/e2vUqzjCCXe2G2ptK9TDyjrK/hJgHE6hZ6nEB 0nZ6/u/btUUso/+7RHoRSqD1gGCv+YRbCAo= X-ZohoMail-DKIM: fail (Signature date is -1 seconds in the future.) X-ZM-MESSAGEID: 1645379388390100001 Content-Type: text/plain; charset="utf-8" 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 ( ) { 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 =3D CHAR_CARRIAGE_RETURN; EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL); =20 - // - // Map F2 to Boot Manager Menu - // - F2.ScanCode =3D SCAN_F2; - F2.UnicodeChar =3D CHAR_NULL; + if (FixedPcdGetBool (PcdBootManagerEscape)) { + // + // Map Esc to Boot Manager Menu + // + CustomKey.ScanCode =3D SCAN_ESC; + CustomKey.UnicodeChar =3D CHAR_NULL; + } else { + // + // Map Esc to Boot Manager Menu + // + CustomKey.ScanCode =3D SCAN_F2; + CustomKey.UnicodeChar =3D CHAR_NULL; + } + EfiBootManagerGetBootManagerMenu (&BootOption); - EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumbe= r, 0, &F2, NULL); + EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumbe= r, 0, &CustomKey, NULL); =20 // // Also add Down key to Boot Manager Menu since some serial terminals do= n't support F2 key. @@ -251,12 +260,21 @@ PlatformBootManagerAfterConsole ( // PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", L= OAD_OPTION_ACTIVE); =20 - 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" + ); + } } =20 /** 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 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile + gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape 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 =20 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0= xab, 0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 }|VOI= D*|0x00000018 =20 +# Boot Manager Key +gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x00000020 + ## FFS filename to find the default variable initial data file. # @Prompt FFS Name of variable initial data file gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0= x42, 0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 }|VOI= D*|0x00000025 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 DEFINE SECURITY_STUB_ENABLE =3D TRUE DEFINE SMM_SUPPORT =3D FALSE + DEFINE BOOT_MANAGER_ESCAPE =3D FALSE # # SBL: UEFI payload for Slim Bootloader # COREBOOT: UEFI payload for coreboot @@ -399,6 +400,8 @@ gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask | 0x1 !endif =20 + gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE) + [PcdsPatchableInModule.X64] gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER) gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER) --=20 2.32.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86812): https://edk2.groups.io/g/devel/message/86812 Mute This Topic: https://groups.io/mt/89276535/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-