From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: zhichao.gao@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Wed, 17 Jul 2019 00:56:27 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2019 00:56:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,273,1559545200"; d="scan'208";a="187509110" Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 17 Jul 2019 00:56:16 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Bret Barkelew , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner Subject: [PATCH 3/4] MdeModulePkg: Use pcd to control if BootManager in BootOrder Date: Wed, 17 Jul 2019 15:50:07 +0800 Message-Id: <20190717075008.22716-4-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190717075008.22716-1-zhichao.gao@intel.com> References: <20190717075008.22716-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bret Barkelew REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1979 Use pcd PcdBootManagerInBootOrder to control whether BootManager is in BootOrder. Also add EFI_UNSUPPORTED to indicate the BootManager is not in the BootOrder. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- .../Library/UefiBootManagerLib/BmBoot.c | 20 +++++++++++++------ .../UefiBootManagerLib/UefiBootManagerLib.inf | 1 + 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 952033fc82..611acb91e2 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -2320,11 +2320,13 @@ EfiBootManagerRefreshAllBootOption ( @param BootOption Return the boot option of the Boot Manager Menu - @retval EFI_SUCCESS Successfully register the Boot Manager Menu. - @retval EFI_NOT_FOUND The Boot Manager Menu cannot be found. - @retval others Return status of gRT->SetVariable (). BootOption still points - to the Boot Manager Menu even the Status is not EFI_SUCCESS - and EFI_NOT_FOUND. + @retval EFI_SUCCESS Successfully register the Boot Manager Menu. + @retval EFI_NOT_FOUND The Boot Manager Menu cannot be found. + @retval EFI_UNSUPPORTED The Boot Manager Menu isn't register to Boot Order because of + PcdBootManagerInBootOrder. + @retval others Return status of gRT->SetVariable (). BootOption still points + to the Boot Manager Menu even the Status is not EFI_SUCCESS + and EFI_NOT_FOUND. **/ EFI_STATUS BmRegisterBootManagerMenu ( @@ -2436,7 +2438,13 @@ BmRegisterBootManagerMenu ( EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount); ); - return EfiBootManagerAddLoadOptionVariable (BootOption, 0); + if (PcdGetBool (PcdBootManagerInBootOrder)) { + Status = EfiBootManagerAddLoadOptionVariable (BootOption, 0); + } else { + Status = EFI_UNSUPPORTED; + } + + return Status; } /** diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf index ed6b4679eb..cfc01f57c6 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf @@ -116,3 +116,4 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerInBootOrder ## CONSUMES -- 2.21.0.windows.1