From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01a.ixn.mail.zen.net.uk (smarthost01a.ixn.mail.zen.net.uk [212.23.1.20]) by mx.groups.io with SMTP id smtpd.web10.8708.1671181091279522531 for ; Fri, 16 Dec 2022 00:58:11 -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.20, mailfrom: sean@starlabs.systems) Received: from [51.148.147.4] (helo=starbook..) by smarthost01a.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p66Xg-0004kW-Kx; Fri, 16 Dec 2022 08:58:08 +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, 16 Dec 2022 08:58:04 +0000 Message-Id: <7bad2974b731b7cd8323582aa89ae4ed9f10702c.1671181085.git.sean@starlabs.systems> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Originating-smarthost01a-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: 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