From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Sun, 05 May 2019 19:38:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2019 19:38:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,435,1549958400"; d="scan'208";a="297361731" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 05 May 2019 19:38:40 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 5 May 2019 19:38:40 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 5 May 2019 19:38:39 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.33]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.213]) with mapi id 14.03.0415.000; Mon, 6 May 2019 10:38:37 +0800 From: "Ni, Ray" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Justen, Jordan L" , Andrew Fish Subject: Re: [Patch V2 2/2] EmulatorPkg: Make the shell be the first boot option Thread-Topic: [Patch V2 2/2] EmulatorPkg: Make the shell be the first boot option Thread-Index: AQHVA7Bt4heOWO/2zUGZKK2W2/PokqZdYc5Q Date: Mon, 6 May 2019 02:38:37 +0000 Deferred-Delivery: Mon, 6 May 2019 02:38:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C12AD22@SHSMSX104.ccr.corp.intel.com> References: <20190506020618.12032-1-zhiguang.liu@intel.com> <20190506020618.12032-3-zhiguang.liu@intel.com> In-Reply-To: <20190506020618.12032-3-zhiguang.liu@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTJlNDYwOTctNmNmZS00N2ZjLTlkYmQtZTNhMjM5YjkzMTQxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidjRBMEVGRVJ5bEMyY0IzZnFRSG9QaFE0SWcra2YzdWlkbGJkSlpXK3RJNytyN09pbnpRajFpZEFrOGluTWtrTSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: Liu, Zhiguang > Sent: Monday, May 6, 2019 10:06 AM > To: devel@edk2.groups.io > Cc: Justen, Jordan L ; Andrew Fish > ; Ni, Ray > Subject: [Patch V2 2/2] EmulatorPkg: Make the shell be the first boot opt= ion >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1649 >=20 > Make the shell be the first boot option by default, So it can boot into U= EFI > Internal Shell directly >=20 > Signed-off-by: Zhiguang Liu > Cc: Jordan Justen > Cc: Andrew Fish > Cc: Ray Ni > --- > EmulatorPkg/Library/PlatformBmLib/PlatformBm.c | 30 > ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) >=20 > diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c > b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c > index 191ce58cfb..03f6157ae8 100644 > --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c > +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c > @@ -332,6 +332,35 @@ PlatformBdsRegisterStaticBootOptions ( > PrintXY (10, 50, &White, &Black, L"Enter to boot directly."); } >=20 > +/** > + Returns the priority number. > + > + @param BootOption > +**/ > +UINTN > +BootOptionPriority ( > + CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOption > + ) > +{ > + // > + // Make sure Shell is first > + // > + if (StrCmp (BootOption->Description, L"UEFI Shell") =3D=3D 0) { > + return 0; > + } > + return 100; > +} > + > +INTN > +EFIAPI > +CompareBootOption ( > + CONST EFI_BOOT_MANAGER_LOAD_OPTION *Left, > + CONST EFI_BOOT_MANAGER_LOAD_OPTION *Right > + ) > +{ > + return BootOptionPriority (Left) - BootOptionPriority (Right); } > + > /** > Do the platform specific action after the console is connected. >=20 > @@ -377,6 +406,7 @@ PlatformBootManagerAfterConsole ( > PlatformBdsRegisterStaticBootOptions (); > PlatformBdsConnectSequence (); > EfiBootManagerRefreshAllBootOption (); > + EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, > + (SORT_COMPARE)CompareBootOption); > break; > } > } > -- > 2.21.0.windows.1