mirror of https://github.com/acidanthera/audk.git
ArmPlatformPkg/Bds: Fix menu when no boot entry are present for deletion or update
When there are no boot entries to delete, the boot manager was prompting the user to select an entry to delete. This fix prints a message to let the user know that he is trying delete boot entry when there are none. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12405 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
e8e1daee63
commit
c93ab96c01
|
@ -227,7 +227,7 @@ BootMenuSelectBootOption (
|
|||
UINTN Index;
|
||||
|
||||
// Display the list of supported boot devices
|
||||
BootOptionCount = 1;
|
||||
BootOptionCount = 0;
|
||||
for (Entry = GetFirstNode (BootOptionsList);
|
||||
!IsNull (BootOptionsList,Entry);
|
||||
Entry = GetNextNode (BootOptionsList, Entry)
|
||||
|
@ -239,7 +239,7 @@ BootMenuSelectBootOption (
|
|||
continue;
|
||||
}
|
||||
|
||||
Print (L"[%d] %s\n", BootOptionCount, BdsLoadOption->Description);
|
||||
Print (L"[%d] %s\n", (BootOptionCount + 1), BdsLoadOption->Description);
|
||||
|
||||
DEBUG_CODE_BEGIN();
|
||||
CHAR16* DevicePathTxt;
|
||||
|
@ -264,8 +264,16 @@ BootMenuSelectBootOption (
|
|||
BootOptionCount++;
|
||||
}
|
||||
|
||||
// Check if a valid boot option(s) is found
|
||||
if (BootOptionCount == 0) {
|
||||
Print (L"No supported Boot Entry.\n");
|
||||
if (StrCmp (InputStatement, DELETE_BOOT_ENTRY) == 0) {
|
||||
Print (L"Nothing to remove!\n");
|
||||
}else if (StrCmp (InputStatement, UPDATE_BOOT_ENTRY) == 0) {
|
||||
Print (L"Couldn't find valid boot entries\n");
|
||||
} else{
|
||||
Print (L"No supported Boot Entry.\n");
|
||||
}
|
||||
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
@ -276,8 +284,8 @@ BootMenuSelectBootOption (
|
|||
Status = GetHIInputInteger (&BootOptionSelected);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
} else if ((BootOptionSelected == 0) || (BootOptionSelected >= BootOptionCount)) {
|
||||
Print(L"Invalid input (max %d)\n",BootOptionCount-1);
|
||||
} else if ((BootOptionSelected == 0) || (BootOptionSelected > BootOptionCount)) {
|
||||
Print(L"Invalid input (max %d)\n",BootOptionCount);
|
||||
BootOptionSelected = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue