From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.sbp.mail.zen.net.uk (smarthost01b.sbp.mail.zen.net.uk [212.23.1.3]) by mx.groups.io with SMTP id smtpd.web10.10929.1670231914885924319 for ; Mon, 05 Dec 2022 01:18:35 -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.3, mailfrom: sean@starlabs.systems) Received: from [51.148.147.4] (helo=starbook..) by smarthost01b.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p27cO-0004m4-Ik; Mon, 05 Dec 2022 09:18:32 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Matt DeVillier , Hao A Wu , Ray Ni , Sean Rhodes Subject: [PATCH 3/4] MdeModulePkg/BmBoot: Skip removable media if it is not present Date: Mon, 5 Dec 2022 09:18:26 +0000 Message-Id: X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Content-Transfer-Encoding: quoted-printable From: Matt DeVillier Only enumerate devices that have media present. Cc: Hao A Wu Cc: Ray Ni Reviewed-by: Sean Rhodes Signed-off-by: Matt DeVillier Change-Id: I78a0b8be3e2f33edce2d43bbdd7670e6174d0ff8 --- MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePk= g/Library/UefiBootManagerLib/BmBoot.c index 962892d38f..bde22fa659 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -2218,6 +2218,15 @@ BmEnumerateBootOptions ( continue;=0D }=0D =0D + //=0D + // Skip removable media if not present=0D + //=0D + if ((BlkIo->Media->RemovableMedia =3D=3D TRUE) &&=0D + (BlkIo->Media->MediaPresent =3D=3D FALSE))=0D + {=0D + continue;=0D + }=0D +=0D Description =3D BmGetBootDescription (Handles[Index]);=0D BootOptions =3D ReallocatePool (=0D sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) * (*BootOption= Count),=0D --=20 2.37.2