diff options
| author | Martyn Welch <[email protected]> | 2024-10-09 14:15:39 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-10-15 10:24:27 -0600 |
| commit | 8ba82a91b3aa615fb6148ecfa2af4e91a28659ae (patch) | |
| tree | f30cd93609a5ca7daf7b22fde45f26bed5464bba /include/pxe_utils.h | |
| parent | d2faad3ff31f0fab0cf280c05ee333992f7a7d27 (diff) | |
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/pxe_utils.h')
| -rw-r--r-- | include/pxe_utils.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/pxe_utils.h b/include/pxe_utils.h index a408fb7f13c..68ac40b64ad 100644 --- a/include/pxe_utils.h +++ b/include/pxe_utils.h @@ -96,6 +96,8 @@ typedef int (*pxe_getfile_func)(struct pxe_context *ctx, const char *file_path, * allocated * @pxe_file_size: Size of the PXE file * @use_ipv6: TRUE : use IPv6 addressing, FALSE : use IPv4 addressing + * @use_fallback: TRUE : use "fallback" option as default, FALSE : use + * "default" option as default */ struct pxe_context { struct cmd_tbl *cmdtp; @@ -116,6 +118,7 @@ struct pxe_context { char *bootdir; ulong pxe_file_size; bool use_ipv6; + bool use_fallback; }; /** @@ -215,12 +218,17 @@ int format_mac_pxe(char *outbuf, size_t outbuf_len); * none * @use_ipv6: TRUE : use IPv6 addressing * FALSE : use IPv4 addressing + * @use_fallback: TRUE : Use "fallback" option instead of "default" should no + * other choice be selected + * FALSE : Use "default" option should no other choice be + * selected * Return: 0 if OK, -ENOMEM if out of memory, -E2BIG if bootfile is larger than * MAX_TFTP_PATH_LEN bytes */ int pxe_setup_ctx(struct pxe_context *ctx, struct cmd_tbl *cmdtp, pxe_getfile_func getfile, void *userdata, - bool allow_abs_path, const char *bootfile, bool use_ipv6); + bool allow_abs_path, const char *bootfile, bool use_ipv6, + bool use_fallback); /** * pxe_destroy_ctx() - Destroy a PXE context |
