From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 719971A1E3C for ; Wed, 31 Aug 2016 01:19:19 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 31 Aug 2016 01:19:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,261,1470726000"; d="scan'208";a="1043805710" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.23]) by orsmga002.jf.intel.com with ESMTP; 31 Aug 2016 01:19:17 -0700 From: Liming Gao To: edk2-devel@lists.01.org Cc: Ruiyu Ni , Eric Dong Date: Wed, 31 Aug 2016 16:19:13 +0800 Message-Id: <1472631553-26232-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [Patch] MdeModulePkg UefiBootManagerLib: Ignore BootManagerMenuApp 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: Wed, 31 Aug 2016 08:19:19 -0000 BootManagerMenuApp boot option is handled by EfiBootManagerGetBootManagerMenu. Don't need to handle it again when parse LoadFile protocol. Cc: Ruiyu Ni Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao --- 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 ecd0ae3..f8a3988 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 BootMenuApp. its boot option will be created by BmRegisterBootManagerMenu(). + // + if (BmIsBootMenuAppFilePath (DevicePathFromHandle (Handles[Index]))) { + continue; + } Description = BmGetBootDescription (Handles[Index]); BootOptions = ReallocatePool ( @@ -2079,19 +2084,11 @@ BmEnumerateBootOptions ( ); ASSERT (BootOptions != NULL); - // - // If LoadFile includes BootMenuApp, its boot attribue will be set to APP and HIDDEN. - // - BootAttributes = LOAD_OPTION_ACTIVE; - if (BmIsBootMenuAppFilePath (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