summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-12-03 13:17:21 -0600
committerJoe Hershberger <joe.hershberger@ni.com>2013-06-24 19:07:34 -0500
commite6b6ccf203922059a07c6dde1d3198d8abf0ab27 (patch)
tree399a6bdad01600db056a19ff84d2f4121ea86ec1
parentda620222f89162af2b43f868f1d6184533166104 (diff)
downloadu-boot-imx-e6b6ccf203922059a07c6dde1d3198d8abf0ab27.zip
u-boot-imx-e6b6ccf203922059a07c6dde1d3198d8abf0ab27.tar.gz
u-boot-imx-e6b6ccf203922059a07c6dde1d3198d8abf0ab27.tar.bz2
pxe: try bootz if bootm fails to find a valid image
Standard pxelinux servers will typically use a zImage rather than u-boot image format, so fallback to bootz if bootm fails. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-rw-r--r--common/cmd_pxe.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 5e3505c..4e2811e 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -579,6 +579,7 @@ static int label_localboot(struct pxe_label *label)
static int label_boot(struct pxe_label *label)
{
char *bootm_argv[] = { "bootm", NULL, NULL, NULL, NULL };
+ char initrd_str[22];
int bootm_argc = 3;
label_print(label);
@@ -604,7 +605,10 @@ static int label_boot(struct pxe_label *label)
return 1;
}
- bootm_argv[2] = getenv("ramdisk_addr_r");
+ bootm_argv[2] = initrd_str;
+ strcpy(bootm_argv[2], getenv("ramdisk_addr_r"));
+ strcat(bootm_argv[2], ":");
+ strcat(bootm_argv[2], getenv("filesize"));
} else {
bootm_argv[2] = "-";
}
@@ -649,6 +653,11 @@ static int label_boot(struct pxe_label *label)
bootm_argc = 4;
do_bootm(NULL, 0, bootm_argc, bootm_argv);
+
+#ifdef CONFIG_CMD_BOOTZ
+ /* Try booting a zImage if do_bootm returns */
+ do_bootz(NULL, 0, bootm_argc, bootm_argv);
+#endif
return 1;
}