aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-05-02 18:52:49 -0500
committerJohn Rigby <john.rigby@linaro.org>2012-12-06 13:51:49 -0700
commit0731b7baf241c2256e656e278cdf0046d060c729 (patch)
treec1151b9d6952f6c2b9a2c38560f30a17321e6e02
parent4b3efae8a83f8c79342a9362204f36b85078e29b (diff)
downloadu-boot-linaro-stable-0731b7baf241c2256e656e278cdf0046d060c729.tar.gz
pxe: fix default label handling
Changing to numeric entries broke the default label. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-rw-r--r--common/cmd_pxe.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 5d672af96..acc6a9b00 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -1280,6 +1280,7 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg)
struct menu *m;
int err;
int i = 1;
+ char *default_num = NULL;
/*
* Create a menu and add items for all the labels.
@@ -1297,14 +1298,18 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg)
menu_destroy(m);
return NULL;
}
+ if (cfg->default_label &&
+ (strcmp(label->name, cfg->default_label) == 0))
+ default_num = label->num;
+
}
/*
* After we've created items for each label in the menu, set the
* menu's default label if one was specified.
*/
- if (cfg->default_label) {
- err = menu_default_set(m, cfg->default_label);
+ if (default_num) {
+ err = menu_default_set(m, default_num);
if (err != 1) {
if (err != -ENOENT) {
menu_destroy(m);