]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
pxe: make the first label the implicit default
authorJason Hobbs <jason.hobbs@calxeda.com>
Mon, 7 Nov 2011 03:07:15 +0000 (03:07 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 6 Dec 2011 20:21:42 +0000 (21:21 +0100)
If no default label is specified, but a situation arises where the
default label should be used, treat the first label specified as the
default label.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
Cc: Wolfgang Denk <wd@denx.de>
common/cmd_pxe.c

index 3efd7008e95fe1d74bb48e16a7969e6eec700f22..9426f5b05bc6eec210d753d4cb167308c67475e9 100644 (file)
@@ -1273,10 +1273,21 @@ static void handle_pxe_menu(struct pxe_menu *cfg)
 
        menu_destroy(m);
 
 
        menu_destroy(m);
 
-       if (err < 1)
-               return;
+       /*
+        * err == 1 means we got a choice back from menu_get_choice.
+        *
+        * err == -ENOENT if the menu was setup to select the default but no
+        * default was set. in that case, we should continue trying to boot
+        * labels that haven't been attempted yet.
+        *
+        * otherwise, the user interrupted or there was some other error and
+        * we give up.
+        */
 
 
-       label_boot(choice);
+       if (err == 1)
+               label_boot(choice);
+       else if (err != -ENOENT)
+               return;
 
        boot_unattempted_labels(cfg);
 }
 
        boot_unattempted_labels(cfg);
 }