]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Bds: Fix menu when no boot entry are present for deletion or update
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Sep 2011 22:51:35 +0000 (22:51 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Sep 2011 22:51:35 +0000 (22:51 +0000)
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

ArmPlatformPkg/Bds/BootMenu.c

index 3796f826f39736cfb2cb00f66fe21a0a22d8610e..94be464f804dfa114e09a972b405fbbc538cf1a3 100644 (file)
@@ -227,7 +227,7 @@ BootMenuSelectBootOption (
   UINTN                         Index;\r
 \r
   // Display the list of supported boot devices\r
-  BootOptionCount = 1;\r
+  BootOptionCount = 0;\r
   for (Entry = GetFirstNode (BootOptionsList);\r
        !IsNull (BootOptionsList,Entry);\r
        Entry = GetNextNode (BootOptionsList, Entry)\r
@@ -239,7 +239,7 @@ BootMenuSelectBootOption (
       continue;\r
     }\r
 \r
-    Print (L"[%d] %s\n", BootOptionCount, BdsLoadOption->Description);\r
+    Print (L"[%d] %s\n", (BootOptionCount + 1), BdsLoadOption->Description);\r
 \r
     DEBUG_CODE_BEGIN();\r
       CHAR16*                           DevicePathTxt;\r
@@ -264,8 +264,16 @@ BootMenuSelectBootOption (
     BootOptionCount++;\r
   }\r
 \r
+  // Check if a valid boot option(s) is found\r
   if (BootOptionCount == 0) {\r
-    Print (L"No supported Boot Entry.\n");\r
+    if (StrCmp (InputStatement, DELETE_BOOT_ENTRY) == 0) {\r
+      Print (L"Nothing to remove!\n");\r
+    }else if (StrCmp (InputStatement, UPDATE_BOOT_ENTRY) == 0) {\r
+      Print (L"Couldn't find valid boot entries\n");\r
+    } else{\r
+      Print (L"No supported Boot Entry.\n");\r
+    }\r
+\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
@@ -276,8 +284,8 @@ BootMenuSelectBootOption (
     Status = GetHIInputInteger (&BootOptionSelected);\r
     if (EFI_ERROR(Status)) {\r
       return Status;\r
-    } else if ((BootOptionSelected == 0) || (BootOptionSelected >= BootOptionCount)) {\r
-      Print(L"Invalid input (max %d)\n",BootOptionCount-1);\r
+    } else if ((BootOptionSelected == 0) || (BootOptionSelected > BootOptionCount)) {\r
+      Print(L"Invalid input (max %d)\n",BootOptionCount);\r
       BootOptionSelected = 0;\r
     }\r
   }\r