summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Application/UiApp/BootMngr/BootManager.c')
-rw-r--r--MdeModulePkg/Application/UiApp/BootMngr/BootManager.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c b/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
index 986413c19b..4390deef24 100644
--- a/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
+++ b/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c
@@ -219,7 +219,9 @@ EnumerateBootOptions (
VOID
)
{
+ EFI_STATUS Status;
UINTN Index;
+ EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
UINTN BootOptionCount;
EFI_STRING_ID Token;
@@ -240,6 +242,9 @@ EnumerateBootOptions (
DeviceType = (UINT16) -1;
+ Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);
+ ASSERT_EFI_ERROR (Status);
+
//
// for better user experience
// 1. User changes HD configuration (e.g.: unplug HDD), here we have a chance to remove the HDD boot option
@@ -290,6 +295,13 @@ EnumerateBootOptions (
}
//
+ // Don't display myself
+ //
+ if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {
+ continue;
+ }
+
+ //
// Group the legacy boot option in the sub title created dynamically
//
IsLegacyOption = (BOOLEAN) (