bootstd: Provide a command to select the bootdev order

It is sometimes useful to select or override the default bootdev order.
Add a command for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-05-01 07:37:15 -06:00
parent 80471f8ac0
commit d93f42d6e3
7 changed files with 190 additions and 0 deletions

View File

@@ -6,6 +6,8 @@
* Written by Simon Glass <sjg@chromium.org>
*/
#define LOG_CATEGORY UCLASS_BOOTSTD
#include <alist.h>
#include <blk.h>
#include <bootdev.h>
@@ -132,6 +134,22 @@ const char *const *const bootstd_get_bootdev_order(struct udevice *dev,
return std->bootdev_order;
}
void bootstd_set_bootdev_order(struct udevice *dev, const char **order_str)
{
struct bootstd_priv *std = dev_get_priv(dev);
const char **name;
free(std->bootdev_order); /* leak; convert to use alist */
std->bootdev_order = order_str;
log_debug("bootdev_order:");
if (order_str) {
for (name = order_str; *name; name++)
log_debug(" %s", *name);
}
log_debug("\n");
}
const char *const *const bootstd_get_prefixes(struct udevice *dev)
{
struct bootstd_priv *std = dev_get_priv(dev);