public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zhiguang Liu" <zhiguang.liu@intel.com>
To: devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Prince Agyeman <prince.agyeman@intel.com>
Subject: [PATCH] [edk2-platforms]Intel/BoardModulePkg: Always sort load option
Date: Tue,  2 Mar 2021 17:03:42 +0800	[thread overview]
Message-ID: <20210302090342.130-1-zhiguang.liu@intel.com> (raw)

Currently, load option is only sorted when setup is the first priority in boot 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 priority

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 35 +----------------------------------
 1 file changed, 1 insertion(+), 34 deletions(-)

diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.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 ();
 }
 
-
-/**
-  The function is to consider the boot order which is not in our expectation.
-  In the case that we need to re-sort the boot option.
-
-  @retval  TRUE         Need to sort Boot Option.
-  @retval  FALSE        Don't need to sort Boot Option.
-**/
-BOOLEAN
-IsNeedSortBootOption (
-  VOID
-  )
-{
-  EFI_BOOT_MANAGER_LOAD_OPTION  *BootOptions;
-  UINTN                         BootOptionCount;
-
-  BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);
-
-  //
-  // If setup is the first priority in boot option, we need to sort boot option.
-  //
-  if ((BootOptionCount > 1) &&
-    (((StrnCmp (BootOptions->Description, L"Enter Setup", StrLen (L"Enter Setup"))) == 0) ||
-    ((StrnCmp (BootOptions->Description, L"BootManagerMenuApp", StrLen (L"BootManagerMenuApp"))) == 0))) {
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-
 /**
   Connects Root Bridge
  **/
@@ -1383,7 +1352,5 @@ BdsAfterConsoleReadyBeforeBootOptionCallback (
 
   EfiBootManagerRefreshAllBootOption ();
 
-  if (IsNeedSortBootOption()) {
-    EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootOption);
-  }
+  EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, CompareBootOption);
 }
-- 
2.30.0.windows.2


             reply	other threads:[~2021-03-02  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02  9:03 Zhiguang Liu [this message]
2021-03-02  9:11 ` [edk2-devel] [PATCH] [edk2-platforms]Intel/BoardModulePkg: Always sort load option Ni, Ray
2021-03-02 10:46   ` Gao, Zhichao
2021-03-02 13:53     ` Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210302090342.130-1-zhiguang.liu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox