From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.7260.1620700329127449426 for ; Mon, 10 May 2021 19:32:09 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: zhiguang.liu@intel.com) IronPort-SDR: xW2lyQlBcOpNWzUMLIZ5gJmWMCcUwEgELjbnu1po3sG+1lR0+3CgVlZN5hJ83SMd9Ht/uljn72 8L2775Fk+odQ== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="220291262" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="220291262" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 19:32:08 -0700 IronPort-SDR: KV1ZHUYU6A4hQOJ0kSxK95iAqJnhXvm3qVlb0p74wg/eoHmhWJfT4MqVTRj/zjX4OouelPRYDB vy4Uos6dHHlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="470982599" Received: from fieedk002.ccr.corp.intel.com ([10.239.158.144]) by orsmga001.jf.intel.com with ESMTP; 10 May 2021 19:31:54 -0700 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Zhichao Gao , Ray Ni Subject: [Patch V3] MdeModulePkg: Retrive boot manager menu from any fv Date: Tue, 11 May 2021 10:31:49 +0800 Message-Id: <20210511023149.1201-1-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.30.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Hao A Wu Cc: Zhichao Gao Cc: Ray Ni Reviewed-by: Hao A Wu Signed-off-by: Zhiguang Liu --- 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.
=0D +Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.
=0D (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
=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