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.web10.55952.1669926280082689645 for ; Thu, 01 Dec 2022 12:24:40 -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=starbook..) by smarthost01b.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1p0q6o-0005lx-6x; Thu, 01 Dec 2022 20:24:38 +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: Thu, 1 Dec 2022 20:24:32 +0000 Message-Id: X-Mailer: git-send-email 2.37.2 In-Reply-To: <0bd92ce8c58e964edacdb85a5d7c4f600aecbaa4.1669926273.git.sean@starlabs.systems> References: <0bd92ce8c58e964edacdb85a5d7c4f600aecbaa4.1669926273.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 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