]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Update BootManagerMenuApp to not display itself
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 23 Oct 2015 07:26:58 +0000 (07:26 +0000)
committerniruiyu <niruiyu@Edk2>
Fri, 23 Oct 2015 07:26:58 +0000 (07:26 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18656 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c
MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf

index d43c12f34ad209f5dd2f5698f63b11e2ae07b22b..a8d5c0367495b9223f61d2127e1d78a7084f2d5c 100644 (file)
@@ -262,13 +262,18 @@ InitializeBootMenuData (
   OUT  BOOT_MENU_POPUP_DATA          *BootMenuData\r
   )\r
 {\r
+  EFI_STATUS                    Status;\r
   UINTN                         Index;\r
   UINTN                         StrIndex;\r
+  EFI_DEVICE_PATH_PROTOCOL      *ImageDevicePath;\r
       \r
   if (BootOption == NULL || BootMenuData == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
-  } \r
-  \r
+  }\r
+\r
+  Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
   BootMenuData->TitleToken[0] = STRING_TOKEN (STR_BOOT_POPUP_MENU_TITLE_STRING);\r
   BootMenuData->PtrTokens     = AllocateZeroPool (BootOptionCount * sizeof (EFI_STRING_ID));\r
   ASSERT (BootMenuData->PtrTokens != NULL);\r
@@ -284,6 +289,14 @@ InitializeBootMenuData (
         !IsBootManagerMenu (&BootOption[Index])) {      \r
       continue;\r
     }\r
+\r
+    //\r
+    // Don't display myself\r
+    //\r
+    if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {\r
+      continue;\r
+    }\r
+\r
     ASSERT (BootOption[Index].Description != NULL);\r
     BootMenuData->PtrTokens[StrIndex++] = HiiSetString (\r
                                             gStringPackHandle, \r
index b4455054096d3d9f809295f7fa2bef896fe14fcf..dd60ef4cd882effc722a2ab76004d27af0d96c53 100644 (file)
@@ -52,6 +52,7 @@
 \r
 [Protocols]\r
   gEfiBootLogoProtocolGuid                      ## CONSUMES\r
+  gEfiLoadedImageDevicePathProtocolGuid         ## CONSUMES\r
 \r
 [Pcd]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow                          ## PRODUCES\r