summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 22:51:35 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-22 22:51:35 +0000
commitc93ab96c015f878b9e20e7b524a566f49bab907b (patch)
tree224bd0effe78f27cdbaeb0af883d5ff5318000b5 /ArmPlatformPkg
parente8e1daee63e0f74c66523c23e18ff9ac700d438a (diff)
downloadedk2-platforms-c93ab96c015f878b9e20e7b524a566f49bab907b.tar.xz
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
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/Bds/BootMenu.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c
index 3796f826f3..94be464f80 100644
--- a/ArmPlatformPkg/Bds/BootMenu.c
+++ b/ArmPlatformPkg/Bds/BootMenu.c
@@ -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;
}
}