From nobody Sun Nov 24 14:22:26 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+86327+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86327+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1643786198; cv=none; d=zohomail.com; s=zohoarc; b=ncas9r/D0ytOnp0nVIXovXWQskC3RrqQ8idDiFuscIxkLL/yi5dYc3Tktm5TS13pIYgYdpFO923f4V+bbJp3le6xtsYX+OFSMvoK4JY6GWXcuwDn5FqjI+06kTIMDhbEDr+gVW/R8R70qCsW593tkcGLeb052NMEGde6YrHlvAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643786198; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=HrJewFVpsSKiJc91MPEfsaPYQYs/FV+ptu9OpuxlucM=; b=e+cKAL79VaxsKnCykm2OogmItEebAnX/qH4QNNhfRqm3sy5pPfUUgQ21h3H3pez/qik3CjsgQOqaDggYWJlpf2I2tR/tFboDh49QKXwYtLzO/kOzV456ZPS2JQFcSBaf40LR5yPfjHabEqYv49gp6dJ1p7Z6h2cCwXPXuTN6Az8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86327+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1643786198104676.3612290279771; Tue, 1 Feb 2022 23:16:38 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Yy2oYY1788612xLkmbGfXCst; Tue, 01 Feb 2022 23:16:37 -0800 X-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.web12.60828.1643786195132424089 for ; Tue, 01 Feb 2022 23:16:35 -0800 X-Received: from [51.148.147.4] (helo=sean-StarBook.lan) by smarthost01b.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nF9sT-0001RL-Nj; Wed, 02 Feb 2022 07:16:29 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: guo.dong@intel.com, Sean Rhodes Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable Date: Wed, 2 Feb 2022 07:16:16 +0000 Message-Id: MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 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: LksF1GVnfl2xSTY2eX2lCodAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1643786197; bh=Q1RjW3OO6AWaXc6J3KIbceh5Tg6teHpTvp/Wil+jY0Q=; h=Cc:Date:From:Reply-To:Subject:To; b=uWIW+QNwiBExxKiBxfEXHf9/btrt5kRMeuav3tTM/iaCP+jHo7IUF8zuNQ74+a4P3/b xh05jGo/IoTCsQihy1XpPSF7uKuEfvpVeoCC94GvOapHAb/ZDHQ1I0MTYbt/usnow1RuK EFl93eo1ySbi+cgXxZoSjyf0wCdKfCptTlI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1643786199773100001 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. Signed-off-by: Sean Rhodes --- .../PlatformBootManager.c | 44 +++++++++++++------ .../PlatformBootManagerLib.inf | 1 + UefiPayloadPkg/UefiPayloadPkg.dec | 3 ++ UefiPayloadPkg/UefiPayloadPkg.dsc | 4 ++ 4 files changed, 39 insertions(+), 13 deletions(-) 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..5e1892458e 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -33,6 +33,8 @@ DEFINE UNIVERSAL_PAYLOAD =3D FALSE DEFINE SECURITY_STUB_ENABLE =3D TRUE DEFINE SMM_SUPPORT =3D FALSE + DEFINE BOOT_MANAGER_ESCAPE =3D FALSE + DEFINE PLATFORM_BOOT_TIMEOUT =3D 3 # # SBL: UEFI payload for Slim Bootloader # COREBOOT: UEFI payload for coreboot @@ -399,6 +401,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 (#86327): https://edk2.groups.io/g/devel/message/86327 Mute This Topic: https://groups.io/mt/88853648/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-