From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.255.1646684617115868676 for ; Mon, 07 Mar 2022 12:23:37 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=XHNSa6MX; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: guo.dong@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646684617; x=1678220617; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+AoDz+yNDK2SV0lrG123Xyz0EjoCHm9DwReiKCvj3Aw=; b=XHNSa6MXqDjHiKmVB4g4558dWQoZ1qyoxD2kRGkwJfuGzbg7Sg1RmDyn KgOZnUZej4mrkESf1LxW5wBp4lLIqzkbQLKnis9qVjxKkZ01sOTsEDerk jJkmZCBE6BYyOAGfKP6EgXEeal6eemoLSTcKbI6udlPOUI3VBDdzh7yYY 9Vcnq6yVqd3oOVMo9K+vHv/IfIlmAfheFuP8xHFu8Bv7AW4kvzbTbe9Be rWyXmZse7mxinvnm5p9J95p4m2TiaTkI1X1K+hJCpefTU3rFBq5/wVlRt wjzZE1lG+dTO0cMUUGScYpir6EDgFN2GyrZIe7uqI8lkYAlxZktJ9Bi1y Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10279"; a="253326400" X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="253326400" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 12:23:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,163,1643702400"; d="scan'208";a="537262398" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga007.jf.intel.com with ESMTP; 07 Mar 2022 12:23:35 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 7 Mar 2022 12:23:31 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Mon, 7 Mar 2022 12:23:31 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Mon, 7 Mar 2022 12:23:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VZoon02UZhgX9WcxOIGyWiUzyV75kctHukqBYndKjXTfuh2IYSTLBJAUvfGQ84ybwr5zE2OcUJiXQm10lr42AtfwEgu6LZgaLgCRzzLJ34VGVqPul7mM6BBUO26J+fq2TBUfrbtNBeBVIpL3s2pk8QAksHzli+gETjFcnctZ2u28q5kIqZsodJ4u/I+zYVbaKPXiEZG460zEsGx5WiPKAVjJ1i9g7giYsyBmlMAdyL4r//RvPDJ6IjOl4nMobmrlv/9FUF7iEPrTCZ3AQ9CI5hxmHR1pv5yLVU4LczuHzilyfttGpOtxGdaokgOHAvd6knnDZCanM3xg1BocGIwagw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=U+MKxoG8ovJLprP1nXKqcbkM3bnQ1w8Cm7ImeplBG/0=; b=j3rf836scVUlod9ZEtwYkfOIJoE6uQiTIGX1dSDQpY0yqj2w9to/GXKcjDaeajCLnAHnaQk+7RNg3Bk96g6Jq7GEwRcveTRtiIjfgFwvMcfO+8vPe9kvtKPf3+JO+cSMlYpn5otMtZu2NZ0QzfnOLkkpy8f7MMCX2KRAuYKDv+pLTST0TWH6J8+bVSdEGbB8x6Tl+Um/JWKQ2Rw3O0CZgwmfrSNKNL76lJlFBlsgUp2581Q1sZEf4qVwwedxnkBM9y9QIP07vxCgIEwOaK770/1EuyqsgPvRPqYXARUU8jPvNtXEr68n0s482LSjUx6MG6xTnC14++/xjPo0pnRe3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) by BY5PR11MB4024.namprd11.prod.outlook.com (2603:10b6:a03:192::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.19; Mon, 7 Mar 2022 20:23:28 +0000 Received: from BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::45c8:c9c6:42a:a43d]) by BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::45c8:c9c6:42a:a43d%4]) with mapi id 15.20.5038.027; Mon, 7 Mar 2022 20:23:28 +0000 From: "Guo Dong" To: "Rhodes, Sean" , "devel@edk2.groups.io" CC: "Rhodes, Sean" , "Ni, Ray" , "Ma, Maurice" , "You, Benjamin" Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable Thread-Topic: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable Thread-Index: AQHYMHn2NKCV0A9eIUCCokyr9944oay0YWww Date: Mon, 7 Mar 2022 20:23:28 +0000 Message-ID: References: <761adf234fa5ca4fd3e6b3abc608927df1372251.1646475274.git.sean@starlabs.systems> In-Reply-To: <761adf234fa5ca4fd3e6b3abc608927df1372251.1646475274.git.sean@starlabs.systems> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a4422ed6-0999-4047-5599-08da00785713 x-ms-traffictypediagnostic: BY5PR11MB4024:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dENBHYmcoiW8JP+5qSyEVP9jPEKfHyoFq+7zUDi955CIa1/ytV9/ScsCPGWevI46zYDYOnkaH18wRSwPmz0pzChZeDt9dJSDJxuxTGT257TAYMfap19T3MS7DtG4snBLLM+cRu+/FATNt9EO9iGEZ5pVpYhl7xgP+mVRlYxbqxFS1AnjNnGrKFJ56khQ73qjgRNeIWAGEk0gMaX8WbkKV87C7Di6CC8aX2FOsJDbLQEN2RbrXSrAcBLql74Eod+vRgieEwubSBfsYUXbJSI9SWctkFwiqHQ0Yhc690Q9Ka5o4WHESu6pPX8gS6f1RGh8Ez4c61AdT5cfWMCp25/DUxl8x0dFyZg7TyvMjJV2umO7LvSy9/by4yONLzAnz1xhyI9LCIwsf63ciBmpVjMADKVAoZ1Atxfn6cRuBx+4ZJwbdbKuMtm2f4kgmhgsg5+v9ZtG5k9HTLO+g9/wtelzui7hvvelIfKOE0Ih9Zxu5QrOhM12mFnyarMuSiVG0V75qPmBC8QlZfNUXV7sYLP8a2p4uoRhFKaXUhrTr/IvzwNzI0hUhg1Vv/WaK7Ryy8fSfxuj6posgiEb4+svGUp+p6CKWrhGPQAsWkCACl8PrqdXjdCndkbyEHzAwDOuKN0zGz/WQNrNMRIHVjP+u6IOTEpKHrfquNYB9RY5T1cNzG81VJ8BxtkdHTc8Jl+O4mRXBZSM+kZRNsbO6bgm2oapzA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3622.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(122000001)(6506007)(7696005)(71200400001)(86362001)(186003)(64756008)(66476007)(66946007)(5660300002)(33656002)(8676002)(4326008)(82960400001)(38100700002)(8936002)(52536014)(66556008)(53546011)(110136005)(55016003)(76116006)(54906003)(107886003)(2906002)(508600001)(38070700005)(9686003)(83380400001)(66446008)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3vqkbNC7ZM3vznGzDRgvnc+F3Lz32IlLlf5wNoMJf8Ae9Q3vPf6uodnAGyWw?= =?us-ascii?Q?OtNb++H1fzmBJywDMfx53803E8i0nrVMdSmmf7brHB1fM2btTOZCkkyValuw?= =?us-ascii?Q?x32ytsnnuUUeiK9m6uX2QvrfHfytjDQ77ceCk6E5jiKmOcvokDIlbbJ3p2sh?= =?us-ascii?Q?wyvl1qcL3qcu2X3U7zkqoLBn4q5sljPR7wMSuBLDycRTaa5/9PGoNXXYl0W+?= =?us-ascii?Q?rbDkVawhr/q6NqFMQ90gCL5lws8S/RWT2i3gGrX3QTG80qN/UZpd2DGo7NNv?= =?us-ascii?Q?L664XLTfo3g0pCNkFAtAFXJza3Jcz8i01VqH2xrCf+7lOqynVkV6NrHgMHLf?= =?us-ascii?Q?YRrUup4VRIvmdhHR64QkZmPxgFN6PetiM7kINNqzeuD7BJAbN8wbqMi+2Vxh?= =?us-ascii?Q?/tj5zeJy/pZ9rrJn1xYB6eHzU+KVn8lghlfcoAVI636SKKeDPOk2ZoJT+kni?= =?us-ascii?Q?zaA35GUBEGCoMMuJMwdW39idnchxUU1MeRP/lKEDCRMJdyYOI7fEY+KoBNId?= =?us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wzGSmjdqw3SVbJN8laouDsL?= =?us-ascii?Q?NYyKqGaVatEuFkUVIc3GsBsRIZdBGoM54EymTIkr0Mg+6Xw0h/olvQw+G15x?= =?us-ascii?Q?nmGSTk46Kc47WSl1LUf+q8RmaN53XUHrs8gkBcPol7IWh/MabJs0xux2a4xg?= =?us-ascii?Q?tYmDiKJI7Pq+xbw5vMmsJs/6W87GV9gQIOcDaOFgbwF81o4KrZKqKXErItWb?= =?us-ascii?Q?kH2e18vNw5ve6hv8qHybzkNfe1v5c/TWWNuCQLwLJOwauKhDFpVlGQEsu+ue?= =?us-ascii?Q?/4D9LUKKfClyyXmmtLDyXaBiKTo=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3622.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4422ed6-0999-4047-5599-08da00785713 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2022 20:23:28.1588 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BKIdi3KKyRpkE33n+Hm6QMIfTtNyKYf4brk7HTHXORQ4GYDSEJAdHxTgT2dv/Z8rgxZcC6PcGYSB9fhEZEq0Yw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4024 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guo Dong -----Original Message----- From: Sean Rhodes =20 Sent: Saturday, March 5, 2022 3:15 AM To: devel@edk2.groups.io Cc: Rhodes, Sean ; Dong, Guo ; N= i, Ray ; Ma, Maurice ; You, Benjami= n Subject: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable Provide a build option to use [Esc] instead of [F2] for devices such as Chr= omebooks that don't have F-keys. Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Signed-off-by: Sean Rhodes --- .../PlatformBootManager.c | 44 +++++++++++++------ .../PlatformBootManagerLib.inf | 1 + UefiPayloadPkg/UefiPayloadPkg.dec | 3 ++ UefiPayloadPkg/UefiPayloadPkg.dsc | 2 + 4 files changed, 37 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; EfiBootManagerRegisterCont= inueKeyOption (0, &Enter, NULL); - //- // Map F2 to Boot Manager Menu- /= /- F2.ScanCode =3D SCAN_F2;- F2.UnicodeChar =3D CHAR_NULL;+ if (Fixed= PcdGetBool (PcdBootManagerEscape)) {+ //+ // Map Esc to Boot Manager = Menu+ //+ CustomKey.ScanCode =3D SCAN_ESC;+ CustomKey.UnicodeCh= ar =3D CHAR_NULL;+ } else {+ //+ // Map Esc to Boot Manager Menu+ = //+ CustomKey.ScanCode =3D SCAN_F2;+ CustomKey.UnicodeChar =3D CH= AR_NULL;+ }+ EfiBootManagerGetBootManagerMenu (&BootOption);- EfiBootMa= nagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &F2, N= ULL);+ EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.Option= Number, 0, &CustomKey, NULL); // // Also add Down key to Boot Manager = Menu since some serial terminals don't support F2 key.@@ -251,12 +260,21 @@= PlatformBootManagerAfterConsole ( // PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shel= l", LOAD_OPTION_ACTIVE); - Print (- L"\n"- L"F2 or Down to ente= r 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"+ );+ } } /**diff -= -git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib= .inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib= .inf index 9c4a9da943..80390e0d98 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL +++ ib.inf @@ -73,3 +73,4 @@ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity gEfiMdePkgTokenSpaceGuid= .PcdUartDefaultStopBits gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenu= File+ gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscapediff --git a/UefiP= ayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec index e9204d1168..4051172caf 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dec +++ b/UefiPayloadPkg/UefiPayloadPkg.dec @@ -86,6 +86,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x= 72, 0xcf, 0x80, 0xab, 0 # Above 4G Memory gUefiPayloadPkgTokenSpaceGuid.Pc= dDispatchModuleAbove4GMemory|TRUE|BOOLEAN|0x00000019 +# Boot Manager Key+gU= efiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x00000020+ = ## FFS filename to find the default variable initial data file. # @Prompt F= FS Name of variable initial data file gUefiPayloadPkgTokenSpaceGuid.PcdNvs= DataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xd= b, 0xab, 0xf6, 0xca, 0x69, 0xe6 }|VOID*|0x00000025diff --git a/UefiPayloadP= kg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc index 4fe81a61d6..558513baf1 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -34,6 +34,7 @@ DEFINE SECURITY_STUB_ENABLE =3D TRUE DEFINE SMM_SUPPORT = =3D FALSE DEFINE ABOVE_4G_MEMORY =3D TRUE+ DEFIN= E BOOT_MANAGER_ESCAPE =3D FALSE # # SBL: UEFI payload for= Slim Bootloader # COREBOOT: UEFI payload for coreboot@@ -401,6 +402,7 @@ !endif gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(A= BOVE_4G_MEMORY)+ gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT= _MANAGER_ESCAPE) [PcdsPatchableInModule.X64] gPcAtChipsetPkgTokenSpaceGu= id.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)--=20 2.32.0