From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.ixn.mail.zen.net.uk (smarthost01b.ixn.mail.zen.net.uk [212.23.1.21]) by mx.groups.io with SMTP id smtpd.web08.4.1643405740648692528 for ; Fri, 28 Jan 2022 13:35:41 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.21, mailfrom: sean@starlabs.systems) Received: from [217.155.46.38] (helo=sean-StarBook.lan) by smarthost01b.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nDYuB-0006kh-11; Fri, 28 Jan 2022 21:35:39 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Matt DeVillier Subject: [PATCH] MdeModulePkg/BmBoot: skip secondary eMMC entries Date: Fri, 28 Jan 2022 21:35:36 +0000 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Originating-smarthost01b-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 Content-Transfer-Encoding: quoted-printable From: Matt DeVillier Internal eMMC devices often show multiple entries, so skip any after the initial entry. Signed-off-by: Matt DeVillier --- 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