]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Retrieve boot manager menu from any fv
authorZhiguang Liu <zhiguang.liu@intel.com>
Mon, 26 Apr 2021 08:25:39 +0000 (16:25 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 18 May 2021 13:52:06 +0000 (13:52 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3384

Currently, UefiBootManagerLib has the below assumption:
  Assume the BootManagerMenuFile is in the same FV as the module links to this 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>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c

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