[Concept,00/32] boot: pxe: Refactor into separate load/setup phases

Message ID 20260109231151.4056804-1-sjg@u-boot.org
Headers
Series boot: pxe: Refactor into separate load/setup phases |

Message

Simon Glass Jan. 9, 2026, 11:11 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

This series refactors the PXE/extlinux boot path to separate
file-loading from boot-setup. This is working toward a clean
three-phase API: parse, load, boot.

The refactoring makes the code more modular and testable, and allows
callers to inspect loaded files before committing to boot.

It builds on the previous series which added tests. This one adds
a few more tests but mostly focuses on reorganising the code without
changing behaviour.

Key changes:

- Split pxe_load_label() into load and setup phases, allowing flexible
  use by callers that need to load files without immediate boot setup

- Improve FDT overlay handling: convert from string to alist, load to
  sequential addresses, and split loading from applying overlays

- Move all file loading (kernel, initrd, FDT, overlays) into
  pxe_load_files() for better organisation

- Add test for FIT images with embedded FDT (documents a pre-existing
  limitation where conf_fdt_str is NULL in this case)

- Add comprehensive tests for the new APIs and overlay loading

- Various cleanups: use IS_ENABLED(), use global working_fdt, export
  set_working_fdt_addr_quiet()


Simon Glass (32):
  test: pxe: Preserve filesystem images when persist is enabled
  sandbox: bootz: Fix incorrect pointer passed to unmap_sysmem()
  test: pxe: Add helper to check menu output lines
  test: pxe: Test devicetree alias keywords
  boot: pxe: Add separate APIs for label selection and file loading
  boot: pxe: Update tests to use the new API
  test: pxe: Add a test for missing fdtoverlay_addr_r
  test: pxe: Add test for FIT images with embedded FDT
  boot: pxe: Add a flag to suppress file-retrieval messages
  boot: pxe: Print 'say' message when label is booted
  boot: pxe: Rename destroy_pxe_menu() to pxe_menu_uninit()
  boot: pxe: Add pxe_menu_init() function
  boot: pxe: Defer processing of include files
  boot: pxe: Extract pxe_load_files() from pxe_load_label()
  boot: pxe: Split filename handling from label_process_fdt()
  boot: pxe: Add FDT pointer to context for kaslrseed
  boot: pxe: Move FIT handling from label_process_fdt() to caller
  boot: pxe: Move fdt_addr_r check to caller of label_load_fdt()
  boot: pxe: Use early return in label_load_fdt()
  boot: pxe: Use ctx->fdt in label_boot_fdtoverlay()
  boot: pxe: Move label_get_fdt_path() call to pxe_load_label()
  boot: pxe: Load FDT files in pxe_load_files()
  boot: pxe: Use IS_ENABLED() for CONFIG_OF_LIBFDT_OVERLAY
  boot: pxe: Drop fdtoverlay_addr_r check in label_boot_fdtoverlay()
  boot: pxe: Convert fdtoverlays from string to alist
  boot: pxe: Load overlays to sequential addresses
  boot: pxe: Split overlay loading and applying into two passes
  boot: pxe: Split label_boot_fdtoverlay() into load and apply functions
  boot: pxe: Move overlay loading to pxe_load_files()
  boot: pxe: Add test for FDT overlay loading
  boot: pxe: Split pxe_load_label() into load and setup phases
  boot: pxe: Extract boot preparation into separate function

 arch/sandbox/lib/bootm.c         |   2 +-
 boot/pxe_parse.c                 |  98 ++--
 boot/pxe_utils.c                 | 859 +++++++++++++++++++------------
 include/pxe_utils.h              | 152 +++++-
 test/boot/pxe.c                  | 559 ++++++++++++++++----
 test/py/tests/test_pxe_parser.py | 107 +++-
 6 files changed, 1300 insertions(+), 477 deletions(-)