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
+ EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;\r
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;\r
UINTN BootOptionCount;\r
EFI_STRING_ID Token;\r
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;\r
UINTN BootOptionCount;\r
EFI_STRING_ID Token;\r
\r
DeviceType = (UINT16) -1;\r
\r
\r
DeviceType = (UINT16) -1;\r
\r
+ Status = gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageDevicePathProtocolGuid, (VOID **) &ImageDevicePath);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
//\r
// for better user experience\r
// 1. User changes HD configuration (e.g.: unplug HDD), here we have a chance to remove the HDD boot option\r
//\r
// for better user experience\r
// 1. User changes HD configuration (e.g.: unplug HDD), here we have a chance to remove the HDD boot option\r
+ //\r
+ // Don't display myself\r
+ //\r
+ if (CompareMem (BootOption[Index].FilePath, ImageDevicePath, GetDevicePathSize (ImageDevicePath)) == 0) {\r
+ continue;\r
+ }\r
+\r
//\r
// Group the legacy boot option in the sub title created dynamically\r
//\r
//\r
// Group the legacy boot option in the sub title created dynamically\r
//\r
#include <Guid/HiiBootMaintenanceFormset.h>\r
\r
#include <Protocol/LoadFile.h>\r
#include <Guid/HiiBootMaintenanceFormset.h>\r
\r
#include <Protocol/LoadFile.h>\r
+#include <Protocol/LoadedImage.h>\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/HiiConfigRouting.h>\r
#include <Protocol/Smbios.h>\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/HiiConfigRouting.h>\r
#include <Protocol/Smbios.h>\r
gEfiPciIoProtocolGuid ## CONSUMES\r
gEfiDevicePathToTextProtocolGuid ## CONSUMES\r
gEfiBootLogoProtocolGuid ## CONSUMES\r
gEfiPciIoProtocolGuid ## CONSUMES\r
gEfiDevicePathToTextProtocolGuid ## CONSUMES\r
gEfiBootLogoProtocolGuid ## CONSUMES\r
+ gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES\r