]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg UefiBootManagerLib: Ignore BootManagerMenu from LoadFile
authorLiming Gao <liming.gao@intel.com>
Thu, 1 Sep 2016 05:41:20 +0000 (13:41 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 2 Sep 2016 07:45:55 +0000 (15:45 +0800)
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 <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c

index fe09a041cf26ff22f8e806d3ce7937106d940494..6b84b85fca8f6b07ee3b2471690ea652457bfc46 100644 (file)
@@ -1940,7 +1940,6 @@ BmEnumerateBootOptions (
   UINTN                                 Removable;\r
   UINTN                                 Index;\r
   CHAR16                                *Description;\r
-  UINT32                                BootAttributes;\r
 \r
   ASSERT (BootOptionCount != NULL);\r
 \r
@@ -2070,6 +2069,12 @@ BmEnumerateBootOptions (
          &Handles\r
          );\r
   for (Index = 0; Index < HandleCount; Index++) {\r
+    //\r
+    // Ignore BootManagerMenu. its boot option will be created by EfiBootManagerGetBootManagerMenu().\r
+    //\r
+    if (BmIsBootManagerMenuFilePath (DevicePathFromHandle (Handles[Index]))) {\r
+      continue;\r
+    }\r
 \r
     Description = BmGetBootDescription (Handles[Index]);\r
     BootOptions = ReallocatePool (\r
@@ -2079,19 +2084,11 @@ BmEnumerateBootOptions (
                     );\r
     ASSERT (BootOptions != NULL);\r
 \r
-    //\r
-    // If LoadFile includes BootManagerMenu, its boot attribue will be set to APP and HIDDEN.\r
-    //\r
-    BootAttributes = LOAD_OPTION_ACTIVE;\r
-    if (BmIsBootManagerMenuFilePath (DevicePathFromHandle (Handles[Index]))) {\r
-      BootAttributes = LOAD_OPTION_CATEGORY_APP | LOAD_OPTION_ACTIVE | LOAD_OPTION_HIDDEN;\r
-    }\r
-\r
     Status = EfiBootManagerInitializeLoadOption (\r
                &BootOptions[(*BootOptionCount)++],\r
                LoadOptionNumberUnassigned,\r
                LoadOptionTypeBoot,\r
-               BootAttributes,\r
+               LOAD_OPTION_ACTIVE,\r
                Description,\r
                DevicePathFromHandle (Handles[Index]),\r
                NULL,\r