diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2015-10-23 07:28:18 +0000 |
---|---|---|
committer | niruiyu <niruiyu@Edk2> | 2015-10-23 07:28:18 +0000 |
commit | d4bf294e0ed2a6cdc1e128df512df1d5e56cfc4d (patch) | |
tree | 3e7ef364f78453ca3732d8e9fd2c1fca546e80a1 /MdeModulePkg/Application | |
parent | 26da0b64df29c2a7c266661a7fe0325e0444c96c (diff) | |
download | edk2-platforms-d4bf294e0ed2a6cdc1e128df512df1d5e56cfc4d.tar.xz |
MdeModulePkg: Update UiApp 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@18657 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r-- | MdeModulePkg/Application/UiApp/BootMngr/BootManager.c | 12 | ||||
-rw-r--r-- | MdeModulePkg/Application/UiApp/Ui.h | 1 | ||||
-rw-r--r-- | MdeModulePkg/Application/UiApp/UiApp.inf | 1 |
3 files changed, 14 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) (
diff --git a/MdeModulePkg/Application/UiApp/Ui.h b/MdeModulePkg/Application/UiApp/Ui.h index 413266d815..8159878007 100644 --- a/MdeModulePkg/Application/UiApp/Ui.h +++ b/MdeModulePkg/Application/UiApp/Ui.h @@ -30,6 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Guid/HiiBootMaintenanceFormset.h>
#include <Protocol/LoadFile.h>
+#include <Protocol/LoadedImage.h>
#include <Protocol/DevicePath.h>
#include <Protocol/HiiConfigRouting.h>
#include <Protocol/Smbios.h>
diff --git a/MdeModulePkg/Application/UiApp/UiApp.inf b/MdeModulePkg/Application/UiApp/UiApp.inf index 36d292e676..9553c7bab5 100644 --- a/MdeModulePkg/Application/UiApp/UiApp.inf +++ b/MdeModulePkg/Application/UiApp/UiApp.inf @@ -123,6 +123,7 @@ gEfiPciIoProtocolGuid ## CONSUMES
gEfiDevicePathToTextProtocolGuid ## CONSUMES
gEfiBootLogoProtocolGuid ## CONSUMES
+ gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES
[FeaturePcd]
|