Merge patch series to add a "fallback" keyword to extlinux.conf parsing

This series from Martyn Welch <martyn.welch@collabora.com> adds the
ability to have a "fallback" option in extlinux.conf parsing, which can
be in turn used in A/B style update mechanisms.

Link: https://lore.kernel.org/u-boot/20241009131548.929439-1-martyn.welch@collabora.com/
This commit is contained in:
Tom Rini
2024-10-15 09:18:04 -06:00
13 changed files with 291 additions and 12 deletions

View File

@@ -146,6 +146,22 @@ struct bootmeth_ops {
* something changes, other -ve on other error
*/
int (*boot)(struct udevice *dev, struct bootflow *bflow);
/**
* set_property() - set the bootmeth property
*
* This allows the setting of boot method specific properties to enable
* automated finer grain control of the boot process
*
* @name: String containing the name of the relevant boot method
* @property: String containing the name of the property to set
* @value: String containing the value to be set for the specified
* property
* Return: 0 if OK, -ENODEV if an unknown bootmeth or property is
* provided, -ENOENT if there are no bootmeth devices
*/
int (*set_property)(struct udevice *dev, const char *property,
const char *value);
};
#define bootmeth_get_ops(dev) ((struct bootmeth_ops *)(dev)->driver->ops)
@@ -290,6 +306,21 @@ int bootmeth_setup_iter_order(struct bootflow_iter *iter, bool include_global);
*/
int bootmeth_set_order(const char *order_str);
/**
* bootmeth_set_property() - Set the bootmeth property
*
* This allows the setting of boot method specific properties to enable
* automated finer grain control of the boot process
*
* @name: String containing the name of the relevant boot method
* @property: String containing the name of the property to set
* @value: String containing the value to be set for the specified property
* Return: 0 if OK, -ENODEV if an unknown bootmeth or property is provided,
* -ENOENT if there are no bootmeth devices
*/
int bootmeth_set_property(const char *name, const char *property,
const char *value);
/**
* bootmeth_setup_fs() - Set up read to read a file
*

View File

@@ -62,6 +62,7 @@ struct pxe_label {
*
* title - the name of the menu as given by a 'menu title' line.
* default_label - the name of the default label, if any.
* fallback_label - the name of the fallback label, if any.
* bmp - the bmp file name which is displayed in background
* timeout - time in tenths of a second to wait for a user key-press before
* booting the default label.
@@ -73,6 +74,7 @@ struct pxe_label {
struct pxe_menu {
char *title;
char *default_label;
char *fallback_label;
char *bmp;
int timeout;
int prompt;
@@ -94,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;
@@ -114,6 +118,7 @@ struct pxe_context {
char *bootdir;
ulong pxe_file_size;
bool use_ipv6;
bool use_fallback;
};
/**
@@ -213,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