From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01c.sbp.mail.zen.net.uk (smarthost01c.sbp.mail.zen.net.uk [212.23.1.5]) by mx.groups.io with SMTP id smtpd.web10.4292.1670618747769124634 for ; Fri, 09 Dec 2022 12:45:48 -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.5, mailfrom: sean@starlabs.systems) Received: from [217.155.46.38] (helo=starbook..) by smarthost01c.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p3kFa-000547-EU; Fri, 09 Dec 2022 20:45:42 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Matt DeVillier , Hao A Wu , Jian J Wang , Liming Gao , Zhichao Gao , Ray Ni , Sean Rhodes Subject: [PATCH 1/3] MdeModulePkg/BmBoot: Skip removable media if it is not present Date: Fri, 9 Dec 2022 20:45:38 +0000 Message-Id: X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Originating-smarthost01c-IP: [217.155.46.38] Feedback-ID: 217.155.46.38 Content-Transfer-Encoding: quoted-printable From: Matt DeVillier Only enumerate devices that have media present. Cc: Hao A Wu Cc: Jian J Wang Cc: Liming Gao Cc: Zhichao Gao 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