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.38842.1643662857543900094 for ; Mon, 31 Jan 2022 13:00:57 -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 1nEdnD-0005tj-HU; Mon, 31 Jan 2022 21:00:55 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Sean Rhodes , Matt DeVillier Subject: [PATCH 43/43] MdeModulePkg/BmBoot: skip secondary eMMC entries Date: Mon, 31 Jan 2022 21:00:54 +0000 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662841.git.sean@starlabs.systems> References: <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662841.git.sean@starlabs.systems> MIME-Version: 1.0 X-Originating-smarthost01b-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 Content-Transfer-Encoding: quoted-printable Internal eMMC devices often show multiple entries, so skip any after the initial entry. Signed-off-by: Matt DeVillier Signed-off-by: Sean Rhodes --- MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePk= g/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;=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,16 @@ BmEnumerateBootOptions ( }=0D =0D Description =3D BmGetBootDescription (Handles[Index]);=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