MdeModulePkg UefiBootManagerLib: Ignore BootManagerMenu from LoadFile
BootManagerMenu boot option is handled by EfiBootManagerGetBootManagerMenu. Don't need to handle it again when parse LoadFile protocol. In V2, use "BootManagerMenu" instead of "BootMenuApp". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
This commit is contained in:
parent
7c69fbf20d
commit
8953d69a5c
@ -1940,7 +1940,6 @@ BmEnumerateBootOptions (
|
|||||||
UINTN Removable;
|
UINTN Removable;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
CHAR16 *Description;
|
CHAR16 *Description;
|
||||||
UINT32 BootAttributes;
|
|
||||||
|
|
||||||
ASSERT (BootOptionCount != NULL);
|
ASSERT (BootOptionCount != NULL);
|
||||||
|
|
||||||
@ -2070,6 +2069,12 @@ BmEnumerateBootOptions (
|
|||||||
&Handles
|
&Handles
|
||||||
);
|
);
|
||||||
for (Index = 0; Index < HandleCount; Index++) {
|
for (Index = 0; Index < HandleCount; Index++) {
|
||||||
|
//
|
||||||
|
// Ignore BootManagerMenu. its boot option will be created by EfiBootManagerGetBootManagerMenu().
|
||||||
|
//
|
||||||
|
if (BmIsBootManagerMenuFilePath (DevicePathFromHandle (Handles[Index]))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Description = BmGetBootDescription (Handles[Index]);
|
Description = BmGetBootDescription (Handles[Index]);
|
||||||
BootOptions = ReallocatePool (
|
BootOptions = ReallocatePool (
|
||||||
@ -2079,19 +2084,11 @@ BmEnumerateBootOptions (
|
|||||||
);
|
);
|
||||||
ASSERT (BootOptions != NULL);
|
ASSERT (BootOptions != NULL);
|
||||||
|
|
||||||
//
|
|
||||||
// If LoadFile includes BootManagerMenu, its boot attribue will be set to APP and HIDDEN.
|
|
||||||
//
|
|
||||||
BootAttributes = LOAD_OPTION_ACTIVE;
|
|
||||||
if (BmIsBootManagerMenuFilePath (DevicePathFromHandle (Handles[Index]))) {
|
|
||||||
BootAttributes = LOAD_OPTION_CATEGORY_APP | LOAD_OPTION_ACTIVE | LOAD_OPTION_HIDDEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = EfiBootManagerInitializeLoadOption (
|
Status = EfiBootManagerInitializeLoadOption (
|
||||||
&BootOptions[(*BootOptionCount)++],
|
&BootOptions[(*BootOptionCount)++],
|
||||||
LoadOptionNumberUnassigned,
|
LoadOptionNumberUnassigned,
|
||||||
LoadOptionTypeBoot,
|
LoadOptionTypeBoot,
|
||||||
BootAttributes,
|
LOAD_OPTION_ACTIVE,
|
||||||
Description,
|
Description,
|
||||||
DevicePathFromHandle (Handles[Index]),
|
DevicePathFromHandle (Handles[Index]),
|
||||||
NULL,
|
NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user