From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.6030.1614675837194438463 for ; Tue, 02 Mar 2021 01:03:57 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: zhiguang.liu@intel.com) IronPort-SDR: AIz4bxa0Jkya1fdQKMglsnPHiKs9gDi0LDMX7xdcKc6DuYIPLLoA2lG7UrVpAckaOj3PKqsC2M f6xMOVpssdXQ== X-IronPort-AV: E=McAfee;i="6000,8403,9910"; a="186867163" X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="186867163" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2021 01:03:55 -0800 IronPort-SDR: 6aJDZYl8uDpzrrBdbSx4Dv/4sjbg3LsF/apwagPRQHbstNLppxdIv+grdnOvVTx+oXoygYge6J giV7awrTfljw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="506260177" Received: from fieedk002.ccr.corp.intel.com ([10.239.158.144]) by fmsmga001.fm.intel.com with ESMTP; 02 Mar 2021 01:03:52 -0800 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Eric Dong , Liming Gao , Nate DeSimone , Prince Agyeman Subject: [PATCH] [edk2-platforms]Intel/BoardModulePkg: Always sort load option Date: Tue, 2 Mar 2021 17:03:42 +0800 Message-Id: <20210302090342.130-1-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.30.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Currently, load option is only sorted when setup is the first priority in b= oot option. This condition is not needed because the below reasons: 1. Setup option may have different string name depending on platform side. It shouldn't be hardcoded here. 2. Always sorting meets the needs that setup should not be the first priori= ty Cc: Eric Dong Cc: Liming Gao Cc: Nate DeSimone Cc: Prince Agyeman Signed-off-by: Zhiguang Liu --- Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | = 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBds= HookLib.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsH= ookLib.c index d7612fb80a..60acf48dd6 100644 --- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib= .c +++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib= .c @@ -992,37 +992,6 @@ ConnectSequence ( EfiBootManagerConnectAll ();=0D }=0D =0D -=0D -/**=0D - The function is to consider the boot order which is not in our expectati= on.=0D - In the case that we need to re-sort the boot option.=0D -=0D - @retval TRUE Need to sort Boot Option.=0D - @retval FALSE Don't need to sort Boot Option.=0D -**/=0D -BOOLEAN=0D -IsNeedSortBootOption (=0D - VOID=0D - )=0D -{=0D - EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions;=0D - UINTN BootOptionCount;=0D -=0D - BootOptions =3D EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOpti= onTypeBoot);=0D -=0D - //=0D - // If setup is the first priority in boot option, we need to sort boot o= ption.=0D - //=0D - if ((BootOptionCount > 1) &&=0D - (((StrnCmp (BootOptions->Description, L"Enter Setup", StrLen (L"Enter = Setup"))) =3D=3D 0) ||=0D - ((StrnCmp (BootOptions->Description, L"BootManagerMenuApp", StrLen (L"= BootManagerMenuApp"))) =3D=3D 0))) {=0D - return TRUE;=0D - }=0D -=0D - return FALSE;=0D -}=0D -=0D -=0D /**=0D Connects Root Bridge=0D **/=0D @@ -1383,7 +1352,5 @@ BdsAfterConsoleReadyBeforeBootOptionCallback ( =0D EfiBootManagerRefreshAllBootOption ();=0D =0D - if (IsNeedSortBootOption()) {=0D - EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootO= ption);=0D - }=0D + EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootOpt= ion);=0D }=0D --=20 2.30.0.windows.2