summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartyn Welch <[email protected]>2024-10-09 14:15:40 +0100
committerTom Rini <[email protected]>2024-10-15 10:24:27 -0600
commit3809fd35a5dbdbd62043ba0a72c3f37f58e69f9d (patch)
treeb7a3cbf6da74d598d2e8529aaf18a30ce3ccba57 /include
parent8ba82a91b3aa615fb6148ecfa2af4e91a28659ae (diff)
bootstd: Add command to enable setting of bootmeth specific properties
We have previously added logic to allow a "fallback" option to be specified in the extlinux configuration. Provide a command that allows us to set this as the preferred default option when booting. Combined with the bootcount functionality, this allows the "altbootcmd" to provide a means of falling back to a previously known good state after a failed update. For example, if "bootcmd" is set to: bootflow scan -lb We would set "altbootcmd" to: bootmeth set extlinux fallback 1; bootflow scan -lb Causing the boot process to boot from the fallback option. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Martyn Welch <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/bootmeth.h31
1 files changed, 31 insertions, 0 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