public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sean Rhodes" <sean@starlabs.systems>
To: devel@edk2.groups.io
Cc: Sean Rhodes <sean@starlabs.systems>,
	Matt DeVillier <matt.devillier@gmail.com>
Subject: [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries
Date: Mon, 31 Jan 2022 21:00:54 +0000	[thread overview]
Message-ID: <d379831c0a96c87795cba419c09e639db145a307.1643662841.git.sean@starlabs.systems> (raw)
In-Reply-To: <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662841.git.sean@starlabs.systems>

Internal eMMC devices often show multiple entries, so skip
any after the initial entry.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..e21ac2c510 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2175,12 +2175,14 @@ BmEnumerateBootOptions (
   EFI_BLOCK_IO_PROTOCOL         *BlkIo;
   UINTN                         Removable;
   UINTN                         Index;
+  UINTN                         EmmcCount;
   CHAR16                        *Description;
 
   ASSERT (BootOptionCount != NULL);
 
   *BootOptionCount = 0;
   BootOptions      = NULL;
+  EmmcCount        = 0;
 
   //
   // Parse removable block io followed by fixed block io
@@ -2219,6 +2221,16 @@ BmEnumerateBootOptions (
       }
 
       Description = BmGetBootDescription (Handles[Index]);
+      //
+      // Skip secondary entries for internal eMMC devices
+      //
+      if (StrCmp(Description, L"eMMC Device") == 0) {
+        EmmcCount++;
+        if (EmmcCount > 1) {
+          continue;
+        }
+      }
+
       BootOptions = ReallocatePool (
                       sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) * (*BootOptionCount),
                       sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) * (*BootOptionCount + 1),
-- 
2.32.0


       reply	other threads:[~2022-01-31 21:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662841.git.sean@starlabs.systems>
2022-01-31 21:00 ` Sean Rhodes [this message]
2022-02-07  1:47   ` 回复: [edk2-devel] [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries gaoliming
2022-02-10 21:35     ` [edk2-devel] " Sean Rhodes
2022-03-21  9:41       ` Sean Rhodes
2022-04-01  2:08         ` 回复: " gaoliming
2022-04-01  2:18           ` Ni, Ray
2022-05-17 12:19         ` Sheng Lean Tan
2022-05-17 13:58           ` 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=d379831c0a96c87795cba419c09e639db145a307.1643662841.git.sean@starlabs.systems \
    --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