diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2015-10-23 07:26:58 +0000 |
---|---|---|
committer | niruiyu <niruiyu@Edk2> | 2015-10-23 07:26:58 +0000 |
commit | 26da0b64df29c2a7c266661a7fe0325e0444c96c (patch) | |
tree | f02a8a35c48ce5d32d749db16db5cf79d7d2b72c /MdeModulePkg/Application | |
parent | 711ef3f6243ee5487f573a8f2e5b1749a6e02c81 (diff) | |
download | edk2-platforms-26da0b64df29c2a7c266661a7fe0325e0444c96c.tar.xz |
MdeModulePkg: Update BootManagerMenuApp to not display itself
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
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r-- | MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c | 17 | ||||
-rw-r--r-- | MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c index d43c12f34a..a8d5c03674 100644 --- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c +++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu.c @@ -262,13 +262,18 @@ InitializeBootMenuData ( OUT BOOT_MENU_POPUP_DATA *BootMenuData
)
{
+ EFI_STATUS Status;
UINTN Index;
UINTN StrIndex;
+ EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
if (BootOption == NULL || BootMenuData == NULL) {
return EFI_INVALID_PARAMETER;
- }
-
+ }
+
+ Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);
+ ASSERT_EFI_ERROR (Status);
+
BootMenuData->TitleToken[0] = STRING_TOKEN (STR_BOOT_POPUP_MENU_TITLE_STRING);
BootMenuData->PtrTokens = AllocateZeroPool (BootOptionCount * sizeof (EFI_STRING_ID));
ASSERT (BootMenuData->PtrTokens != NULL);
@@ -284,6 +289,14 @@ InitializeBootMenuData ( !IsBootManagerMenu (&BootOption[Index])) {
continue;
}
+
+ //
+ // Don't display myself
+ //
+ if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {
+ continue;
+ }
+
ASSERT (BootOption[Index].Description != NULL);
BootMenuData->PtrTokens[StrIndex++] = HiiSetString (
gStringPackHandle,
diff --git a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf index b445505409..dd60ef4cd8 100644 --- a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf +++ b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf @@ -52,6 +52,7 @@ [Protocols]
gEfiBootLogoProtocolGuid ## CONSUMES
+ gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow ## PRODUCES
|