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:
oliviermartin 2011-09-22 22:51:35 +00:00
parent e8e1daee63
commit c93ab96c01
1 changed files with 13 additions and 5 deletions

View File

@ -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;
}
}