[PATCH] MdeModulePkg/BmBoot: skip secondary eMMC entries


Sean Rhodes
 

From: Matt DeVillier <matt.devillier@gmail.com>

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

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

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