aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Hobbs <jason.hobbs@calxeda.com>2011-09-28 19:19:35 -0500
committerJohn Rigby <john.rigby@linaro.org>2011-09-28 19:34:54 -0600
commit74750f39bd6ddb9be4ad15a4c1899e4cd4278e08 (patch)
tree9e9d8741088d09766df1e313c6e3a1c001e0aea2
parent5c8c8671b481cbd37fb8c07d3e3df609e62523b1 (diff)
downloadu-boot-linaro-74750f39bd6ddb9be4ad15a4c1899e4cd4278e08.tar.gz
pxe: make the first label the implicit default
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>
-rw-r--r--common/cmd_pxe.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 56bd21a42..1e3cbd37b 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -1276,10 +1276,21 @@ static void handle_pxe_menu(struct pxe_menu *cfg)
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);
}