bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-08-10 19:33:18 -06:00
parent cbb607d2d9
commit c279224ea6
7 changed files with 197 additions and 6 deletions

View file

@ -445,6 +445,22 @@ void bootflow_remove(struct bootflow *bflow)
free(bflow);
}
#if CONFIG_IS_ENABLED(BOOTSTD_FULL)
int bootflow_read_all(struct bootflow *bflow)
{
int ret;
if (bflow->state != BOOTFLOWST_READY)
return log_msg_ret("rd", -EPROTO);
ret = bootmeth_read_all(bflow->method, bflow);
if (ret)
return log_msg_ret("rd2", ret);
return 0;
}
#endif /* BOOTSTD_FULL */
int bootflow_boot(struct bootflow *bflow)
{
int ret;