[edk2-devel] [PATCH 1/3] MdeModulePkg/BmBoot: Skip removable media if it is not present

Ni, Ray ray.ni at intel.com
Fri Dec 16 09:03:24 UTC 2022


Reviewed-by: Ray Ni <ray.ni at intel.com>


> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Sean Rhodes
> Sent: Friday, December 16, 2022 4:58 PM
> To: devel at edk2.groups.io
> Cc: Matt DeVillier <matt.devillier at gmail.com>; Wu, Hao A <hao.a.wu at intel.com>; Wang, Jian J <jian.j.wang at intel.com>;
> Gao, Liming <gaoliming at byosoft.com.cn>; Gao, Zhichao <zhichao.gao at intel.com>; Ni, Ray <ray.ni at intel.com>; Rhodes,
> Sean <sean at starlabs.systems>
> Subject: [edk2-devel] [PATCH 1/3] MdeModulePkg/BmBoot: Skip removable media if it is not present
> 
> From: Matt DeVillier <matt.devillier at gmail.com>
> 
> Only enumerate devices that have media present.
> 
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> Cc: Zhichao Gao <zhichao.gao at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Reviewed-by: Sean Rhodes <sean at starlabs.systems>
> Signed-off-by: Matt DeVillier <matt.devillier at gmail.com>
> Change-Id: I78a0b8be3e2f33edce2d43bbdd7670e6174d0ff8
> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> b/MdeModulePkg/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;
> 
>        }
> 
> 
> 
> +      //
> 
> +      // Skip removable media if not present
> 
> +      //
> 
> +      if ((BlkIo->Media->RemovableMedia == TRUE) &&
> 
> +          (BlkIo->Media->MediaPresent == FALSE))
> 
> +      {
> 
> +        continue;
> 
> +      }
> 
> +
> 
>        Description = BmGetBootDescription (Handles[Index]);
> 
>        BootOptions = ReallocatePool (
> 
>                        sizeof (EFI_BOOT_MANAGER_LOAD_OPTION) * (*BootOptionCount),
> 
> --
> 2.37.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#97498): https://edk2.groups.io/g/devel/message/97498
> Mute This Topic: https://groups.io/mt/95706437/1712937
> Group Owner: devel+owner at edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni at intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97499): https://edk2.groups.io/g/devel/message/97499
Mute This Topic: https://groups.io/mt/95706437/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list