aboutsummaryrefslogtreecommitdiff
path: root/include/image.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-01-17 08:55:40 -0500
committerTom Rini <trini@konsulko.com>2023-01-17 08:55:40 -0500
commit5b958dea5c678dbdb2aeb6ac3c0c8cc8dfea065c (patch)
tree172424111d1a39640cf5245eefd080fae3b5fb27 /include/image.h
parent6d03688e75041a7bae4d33815de28da781c37dd6 (diff)
parentb5c8fea7b830c0304051237ad1501431a958b0e6 (diff)
Merge branch '2022-01-16-bootstd-updates'
To quote the author: So far standard boot lacks a boot menu, although it is possible to create a rudimentary one using the existing 'bootmenu' command. Even then, this text-based menu offer only basic functionality and does not take full advantage of the displays which are common on many devices. This series provides a 'bootflow menu' command which allows the user to select from the available bootflows. An attempt is made to show the name of the available operating systems, by reading more information into the bootflow. A logo can be read also, where supported, so that this can be presented to the user when an option is highlighted. Full use is made of TrueType fonts, if enabled. For cases where only a serial console is available, it falls back to a simple text-based menu. All of this is implementing using a new 'expo' construct, a collection of scenes (like menu screens) which can be navigated by the user to view information and select options. This is fairly general and should be able to cope with a wider array of use cases, with less hacking of the menu code, such as is currently needed for CMD_BOOTEFI_BOOTMGR. Of course it would be possible to enhance the existing menu rather than creating a new setup. Instead it seems better to make the existing menu use expo, if code space permits. It avoids the event-loop problem and should be more extensible, given its loosely coupled components and use of IDs instead of pointers. Further motivation is provided in the documentation. For now the CLI keypress-decoding code is split out to be used by the new menu. The key codes defined by menu.h are reused also. This is of course just a starting point. Some ideas for future work are included in the documentation.
Diffstat (limited to 'include/image.h')
-rw-r--r--include/image.h30
1 files changed, 12 insertions, 18 deletions
diff --git a/include/image.h b/include/image.h
index bed75ce1b3..7717a4c13d 100644
--- a/include/image.h
+++ b/include/image.h
@@ -710,24 +710,18 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
enum fit_load_op load_op, ulong *datap, ulong *lenp);
/**
- * image_source_script() - Execute a script
- * @addr: Address of script
- * @fit_uname: FIT subimage name
- * @confname: FIT config name. The subimage is chosen based on FIT_SCRIPT_PROP.
- *
- * Executes a U-Boot script at a particular address in memory. The script should
- * have a header (FIT or legacy) with the script type (IH_TYPE_SCRIPT).
- *
- * If @fit_uname is the empty string, then the default image is used. If
- * @confname is the empty string, the default config is used. If @confname and
- * @fit_uname are both non-%NULL, then @confname is ignored. If @confname and
- * @fit_uname are both %NULL, then first the default config is tried, and then
- * the default image.
- *
- * Return: result code (enum command_ret_t)
- */
-int image_source_script(ulong addr, const char *fit_uname,
- const char *confname);
+ * image_locate_script() - Locate the raw script in an image
+ *
+ * @buf: Address of image
+ * @size: Size of image in bytes
+ * @fit_uname: Node name of FIT image to read
+ * @confname: Node name of FIT config to read
+ * @datap: Returns pointer to raw script on success
+ * @lenp: Returns size of raw script on success
+ * @return 0 if OK, non-zero on error
+ */
+int image_locate_script(void *buf, int size, const char *fit_uname,
+ const char *confname, char **datap, uint *lenp);
/**
* fit_get_node_from_config() - Look up an image a FIT by type