[Patch V3] MdeModulePkg: Retrive boot manager menu from any fv


Zhiguang Liu
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3384

Currently, UefiBootManagerLib has the below assumption:
Assume the BootManagerMenuFile is in the same FV as the module links to t=
his library.
It has some limitation now, so remove the assumption.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePk=
g/Library/UefiBootManagerLib/BmBoot.c
index 6cc34d29c0..bef41ae102 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2,7 +2,7 @@
Library functions which relates with booting.=0D
=0D
Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.=0D
-Copyright (c) 2011 - 2020, Intel Corporation. All rights reserved.<BR>=0D
+Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.<BR>=0D
(C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>=0D
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
=0D
@@ -2385,7 +2385,8 @@ EfiBootManagerRefreshAllBootOption (
This function is called to get or create the boot option for the Boot Ma=
nager Menu.=0D
=0D
The Boot Manager Menu is shown after successfully booting a boot option.=
=0D
- Assume the BootManagerMenuFile is in the same FV as the module links to =
this library.=0D
+ This function will first try to search the BootManagerMenuFile is in the=
same FV as=0D
+ the module links to this library. If fails, it will search in all FVs.=0D
=0D
@param BootOption Return the boot option of the Boot Manager Menu=0D
=0D
@@ -2437,7 +2438,7 @@ BmRegisterBootManagerMenu (
=0D
if (DevicePath =3D=3D NULL) {=0D
Data =3D NULL;=0D
- Status =3D GetSectionFromFv (=0D
+ Status =3D GetSectionFromAnyFv (=0D
PcdGetPtr (PcdBootManagerMenuFile),=0D
EFI_SECTION_PE32,=0D
0,=0D
@@ -2455,7 +2456,7 @@ BmRegisterBootManagerMenu (
//=0D
// Get BootManagerMenu application's description from EFI User Interfa=
ce Section.=0D
//=0D
- Status =3D GetSectionFromFv (=0D
+ Status =3D GetSectionFromAnyFv (=0D
PcdGetPtr (PcdBootManagerMenuFile),=0D
EFI_SECTION_USER_INTERFACE,=0D
0,=0D
--=20
2.30.0.windows.2

Join devel@edk2.groups.io to automatically receive all group messages.