[PATCH v3 00/19] bootstd: Support recording images

Simon Glass sjg at chromium.org
Mon Nov 4 18:50:51 CET 2024


This series provides a way to keep track of the images used in bootstd,
including the type of each image.

At present this is sort-of handled by struct bootflow but in quite an
ad-hoc way. The structure has become quite large and is hard to query.
Future work will be able to reduce its size.

Ultimately the 'bootflow info' command may change to also show images as
a list, but that is left for later, as this series is already fairly
long. So for now, just introduce the concept and adjust bootstd to use
it, with a simple command to list the images.

This series includes various alist enhancements, to make use of this new
data structure a little easier.

Changes in v3:
- Add a helper in bootflow
- Add a new patch supporting ad-hoc bootflows
- Add new patch to export bootdev_get_from_blk()
- Add new patch to record loaded files in an ad-hoc bootflow
- Update bootstd_add_bootflow() to return the element number
- Use the helper function

Changes in v2:
- Add an image type extension in bootflow.h
- Change the tag to bootmeth_efi
- Drop patches already applied
- Drop patches which add new image types
- Update to use a new image-type enum in bootflow.h
- Use the word 'feature' instead of 'hack'

Simon Glass (19):
  bootstd: Move bootflow-adding to bootstd
  bootstd: Move bootflow-clearing to bootstd
  bootstd: Add a function to get bootstd only if available
  bootstd: Drop the bootdev-specific list of bootflows
  bootstd: Move the bootflow list into an alist
  bootstd: Maintain a list of images
  bootstd: Update bootmeth_alloc_file() to record images
  boot: pxe: Drop the duplicate comment on get_pxe_file()
  bootmeth_efi: Simplify reading files by using the common function
  bootmeth: Update the read_file() method to include a type
  bootmeth_efi: Check the filename-allocation in the network path
  boot: Update extlinux pxe_getfile_func() to include type
  boot: Update pxe bootmeth to record images
  Update bootmeth_alloc_other() to record images
  bootstd: Update cros bootmeth to record images
  bootstd: Add a simple command to list images
  bootstd: Export bootdev_get_from_blk()
  bootstd: Add the concept of an ad-hoc bootflow
  fs: Record loaded files in an ad-hoc bootflow

 boot/bootdev-uclass.c            |  78 ++++++-------------
 boot/bootflow.c                  |  77 +++++++++++++++----
 boot/bootmeth-uclass.c           |  29 +++++--
 boot/bootmeth_android.c          |   3 +-
 boot/bootmeth_cros.c             |  17 ++++-
 boot/bootmeth_efi.c              |  16 ++--
 boot/bootmeth_efi_mgr.c          |   3 +-
 boot/bootmeth_extlinux.c         |   7 +-
 boot/bootmeth_pxe.c              |  10 ++-
 boot/bootmeth_qfw.c              |   3 +-
 boot/bootmeth_sandbox.c          |   3 +-
 boot/bootmeth_script.c           |   7 +-
 boot/bootstd-uclass.c            | 104 +++++++++++++++++++++++--
 boot/pxe_utils.c                 |  36 ++++-----
 boot/vbe_simple.c                |   5 +-
 cmd/Kconfig                      |   9 +++
 cmd/Makefile                     |   1 +
 cmd/bootdev.c                    |   2 +-
 cmd/bootflow.c                   |  11 +--
 cmd/bootstd.c                    |  65 ++++++++++++++++
 cmd/pxe.c                        |   2 +-
 cmd/sysboot.c                    |   6 +-
 doc/develop/bootstd/overview.rst |  24 +++++-
 doc/usage/cmd/bootstd.rst        |  79 +++++++++++++++++++
 doc/usage/index.rst              |   1 +
 fs/fs.c                          |  15 ++++
 include/bootdev.h                |  36 +++------
 include/bootflow.h               |  88 ++++++++++++++++++---
 include/bootmeth.h               |  22 ++++--
 include/bootstd.h                |  69 ++++++++++++++++-
 include/pxe_utils.h              |  14 +++-
 test/boot/bootflow.c             | 126 +++++++++++++++++++++++++++++++
 test/py/tests/test_ut.py         |   3 +-
 33 files changed, 788 insertions(+), 183 deletions(-)
 create mode 100644 cmd/bootstd.c
 create mode 100644 doc/usage/cmd/bootstd.rst

-- 
2.34.1



More information about the U-Boot mailing list