From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BC6D21A1E6C for ; Wed, 31 Aug 2016 23:05:19 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 31 Aug 2016 23:05:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,265,1470726000"; d="scan'208";a="873957940" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.23]) by orsmga003.jf.intel.com with ESMTP; 31 Aug 2016 23:05:18 -0700 From: Liming Gao To: edk2-devel@lists.01.org Date: Thu, 1 Sep 2016 14:05:09 +0800 Message-Id: <1472709909-32536-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [PATCH v2] MdeModulePkg UefiBootManagerLib: Ignore BootManagerMenu from LoadFile X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 06:05:19 -0000 BootManagerMenu boot option is handled by EfiBootManagerGetBootManagerMenu. Don't need to handle it again when parse LoadFile protocol. In V2, use "BootManagerMenu" instead of "BootMenuApp". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao Reviewed-by: Ruiyu Ni --- MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index fe09a04..6b84b85 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -1940,7 +1940,6 @@ BmEnumerateBootOptions ( UINTN Removable; UINTN Index; CHAR16 *Description; - UINT32 BootAttributes; ASSERT (BootOptionCount != NULL); @@ -2070,6 +2069,12 @@ BmEnumerateBootOptions ( &Handles ); for (Index = 0; Index < HandleCount; Index++) { + // + // Ignore BootManagerMenu. its boot option will be created by EfiBootManagerGetBootManagerMenu(). + // + if (BmIsBootManagerMenuFilePath (DevicePathFromHandle (Handles[Index]))) { + continue; + } Description = BmGetBootDescription (Handles[Index]); BootOptions = ReallocatePool ( @@ -2079,19 +2084,11 @@ BmEnumerateBootOptions ( ); ASSERT (BootOptions != NULL); - // - // If LoadFile includes BootManagerMenu, its boot attribue will be set to APP and HIDDEN. - // - BootAttributes = LOAD_OPTION_ACTIVE; - if (BmIsBootManagerMenuFilePath (DevicePathFromHandle (Handles[Index]))) { - BootAttributes = LOAD_OPTION_CATEGORY_APP | LOAD_OPTION_ACTIVE | LOAD_OPTION_HIDDEN; - } - Status = EfiBootManagerInitializeLoadOption ( &BootOptions[(*BootOptionCount)++], LoadOptionNumberUnassigned, LoadOptionTypeBoot, - BootAttributes, + LOAD_OPTION_ACTIVE, Description, DevicePathFromHandle (Handles[Index]), NULL, -- 2.8.0.windows.1