boot: Add logic to enable booting from fallback option
The "fallback" extlinux config option allows us to set an alternative
default boot option for when it has been detected that the default is
failing. Implement the logic required to boot from this option when
desired.
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/pxe.c b/cmd/pxe.c
index ae02c28..982e2b1 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -138,7 +138,7 @@
int i;
if (pxe_setup_ctx(&ctx, cmdtp, do_get_tftp, NULL, false,
- env_get("bootfile"), use_ipv6))
+ env_get("bootfile"), use_ipv6, false))
return -ENOMEM;
if (IS_ENABLED(CONFIG_BOOTP_PXE_DHCP_OPTION) &&
@@ -288,7 +288,7 @@
}
if (pxe_setup_ctx(&ctx, cmdtp, do_get_tftp, NULL, false,
- env_get("bootfile"), use_ipv6)) {
+ env_get("bootfile"), use_ipv6, false)) {
printf("Out of memory\n");
return CMD_RET_FAILURE;
}
diff --git a/cmd/sysboot.c b/cmd/sysboot.c
index 0ea08fd..8a06078 100644
--- a/cmd/sysboot.c
+++ b/cmd/sysboot.c
@@ -105,7 +105,7 @@
}
if (pxe_setup_ctx(&ctx, cmdtp, sysboot_read_file, &info, true,
- filename, false)) {
+ filename, false, false)) {
printf("Out of memory\n");
return CMD_RET_FAILURE;
}