From nobody Sun Nov 24 13:33:59 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+86368+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+86368+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1643905627; cv=none; d=zohomail.com; s=zohoarc; b=CPNk0TqSvhPocW6zIlwqdyshWW6s0QLuu3A9ztWucMfQkaRLzKC2U3yR0n/tWxUF8rnUSX0BOM/kLdNOdyOctsj2LMwnWP+OdXhPDtgs1tLZnSWMnhA3Xle+UTI4u+Apx7gmU94A/uy7Ksf3JhHw7rUPTgGuUlGUn5qoCe0KqUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643905627; 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=CxWDqH+OolUxUuefd4TcHpCOyn7uCEAtG/JsqNmsLQU=; b=Ve7gsDsV6qqVjt72eQLLK2BlnFJkvNQMOBu58KgRh/FtkmZCvu2/M5zm+6CLRbCWWZWMfPs4EPze6OuKDya6kEpChrEg/HqSIiI9KWQxbmRH5qHE3nEkcMVRpvYAd1JZ+CUrX8bxXBPB1oPXbJnBloPtSnq3VF99f5PpRiFwUIs= 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+86368+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1643905627253866.364927470389; Thu, 3 Feb 2022 08:27:07 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id b9RoYY1788612xqqy4YqYPHM; Thu, 03 Feb 2022 08:27:06 -0800 X-Received: from smarthost01c.ixn.mail.zen.net.uk (smarthost01c.ixn.mail.zen.net.uk [212.23.1.22]) by mx.groups.io with SMTP id smtpd.web11.11430.1643905624957570095 for ; Thu, 03 Feb 2022 08:27:05 -0800 X-Received: from [51.148.147.4] (helo=sean-StarBook.lan) by smarthost01c.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nFewl-0000gh-Ns; Thu, 03 Feb 2022 16:26:59 +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: Thu, 3 Feb 2022 16:26:57 +0000 Message-Id: <33fdf40cb81d7b65041bf71834e0bdf325070dea.1643905617.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01c-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: NjRj58cyu2VHaHEqLd04oOYgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1643905626; bh=iAko1HnyGJ3ok7I/XVONQNsfI1DBhVkUaeatqmi9c0U=; h=Cc:Date:From:Reply-To:Subject:To; b=PhfK4XuHzcUWt+o+74zunBWgqJFvuHdroXjnlMIi+UHfV9q51zcy0dhjRb4hEdnvrtb IqP+gO7i4KzK+osO/JLYnY0KRLYNt4STgfX69m3K4q/5vM+zBTDk0Xwx0SLq+oisvr+CV 0/YDhUQ09S40u9yXC9F0tdVTWUY6qcG6zCU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1643905629915100001 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 | 3 ++ 4 files changed, 38 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..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 (#86368): https://edk2.groups.io/g/devel/message/86368 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-