[Concept,00/12] bootstd: Support multiple bootflows per partition

Message ID 20260324221911.3678307-1-sjg@u-boot.org
Headers
Series bootstd: Support multiple bootflows per partition |

Message

Simon Glass March 24, 2026, 10:18 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Bootflow scanning currently assumes that each partition contributes at
most one bootflow per bootmeth. In practice, formats like extlinux can
define multiple labels in a single configuration file, each pointing
to a different kernel. Similarly, BLS installations can have multiple
.conf files in loader/entries/.

This series adds multi-entry support to the bootflow iterator,
building on the infrastructure from the prior series. A new
BOOTMETHF_MULTI flag allows a bootmeth to declare that it can produce
multiple bootflows from a single partition. The iterator tries
incrementing a sub-entry index before advancing to the next bootmeth,
with the entry passed to read_bootflow() via bflow->entry.

Both extlinux and BLS bootmeths set BOOTMETHF_MULTI. The extlinux
bootmeth uses parse_pxefile() with pxe_process_includes() to handle
include directives during scanning, caching the result in the alist
for reuse at boot time. A new pxe_boot_entry() function boots a
specific label by index. The BLS bootmeth scans loader/entries/ for
multiple .conf files.

Bootflow info displays the entry number and name (extlinux label or
BLS title) so users can distinguish entries from the same partition.


Simon Glass (12):
  extlinux: Use pxe_parse() to extract bootflow info
  bootstd: Add BOOTMETHF_MULTI for multi-entry bootmeths
  extlinux: Enable multi-entry bootflow scanning
  test: bootstd: Add test for multi-entry bootflow scanning
  bls: Enable multi-entry bootflow scanning
  pxe: Add pxe_boot_entry() to boot a specific label by index
  doc: Update bootflow docs for encryption
  bootstd: Show entry number in bootflow info
  bootstd: Show entry name in bootflow info
  bootstd: Show entry column in bootflow list
  extlinux: Process and cache parsed config during scanning
  doc: bootstd: Document multi-entry bootflow scanning

 boot/bootdev-uclass.c            |   1 +
 boot/bootflow.c                  |  33 +++++-
 boot/bootmeth_bls.c              | 117 +++++++++++++++++++--
 boot/bootmeth_extlinux.c         | 140 ++++++++++++++++++-------
 boot/ext_pxe_common.c            |  27 ++++-
 boot/pxe_utils.c                 |  40 +++++++
 cmd/bootflow.c                   |  15 ++-
 doc/board/emulation/qemu-arm.rst |   4 +-
 doc/board/emulation/qemu-x86.rst |   4 +-
 doc/board/samsung/e850-96.rst    |   6 +-
 doc/develop/bootstd/bls.rst      |   4 +
 doc/develop/bootstd/extlinux.rst |  12 ++-
 doc/develop/bootstd/overview.rst |  37 ++++---
 doc/usage/cmd/bootflow.rst       | 122 ++++++++++++---------
 doc/usage/cmd/bootstd.rst        |  14 +--
 doc/usage/cmd/history.rst        |   8 +-
 include/bootflow.h               |   9 ++
 include/bootmeth.h               |   5 +
 include/pxe_utils.h              |  14 +++
 test/boot/bootctl/bootctl.c      |   8 ++
 test/boot/bootdev.c              |  13 ++-
 test/boot/bootflow.c             | 175 +++++++++++++++++++++++++------
 test/py/img/bls.py               |  24 +++--
 test/py/img/common.py            |  11 +-
 test/py/img/ubuntu.py            |   9 +-
 25 files changed, 662 insertions(+), 190 deletions(-)