summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-10-15 09:18:04 -0600
committerTom Rini <[email protected]>2024-10-15 11:38:44 -0600
commit4378732d5658accd07d2fb245417262a23f578ce (patch)
tree06b50e26d4b1582fb4c00393e83b4ede06537fa6 /include
parent4f777c2ef20ad294af1d3447baf7dfffb7514ab3 (diff)
parent87980311fbb64369c29d8725fc8fb4fb35ae2f3c (diff)
Merge patch series to add a "fallback" keyword to extlinux.conf parsing
This series from Martyn Welch <[email protected]> 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/[email protected]/
Diffstat (limited to 'include')
-rw-r--r--include/bootmeth.h31
-rw-r--r--include/pxe_utils.h12
2 files changed, 42 insertions, 1 deletions
diff --git a/include/bootmeth.h b/include/bootmeth.h
index 4d8ca48efd4..a08ebf005ad 100644
--- a/include/bootmeth.h
+++ b/include/bootmeth.h
@@ -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)
@@ -291,6 +307,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
*
* We must redo the setup before each filesystem operation. This function
diff --git a/include/pxe_utils.h b/include/pxe_utils.h
index 9f195930487..68ac40b64ad 100644
--- a/include/pxe_utils.h
+++ b/include/pxe_utils.h
@@ -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