[PATCH v3 00/46] pxe: Support read_all() for extlinux and PXE

Simon Glass sjg at chromium.org
Fri Dec 6 03:35:39 CET 2024


This series implements read_all() so that it is possible to read all the
files relating to a bootflow, make adjustments and then boot.

Unfortunately quite a few things stand in the way, so this series
finishes off several pending items: zboot without CONFIG_CMDLINE,
required support in pxe_utils and the differing code in the extlinux and
PXE bootmeths. There is very little new code, but quite a lot of
refactoring.

The bootm, booti and bootz commands have all been refactored previously,
so that they can operate without needing CONFIG_CMDLINE to be enabled.
At the, time, zboot was left alone, since it is x86-specific and a bit
more trouble.

However it turns out that the booti support doesn't work with compressed
booti images, so this series resolved that problem too.

This series adds a programatic API for zboot and uses the forthcoming
bootstd 'image list' to collect information from an extlinux file. It is
therefore possible to parse the file, load the resulting images and then
examine/adjust the resulting bootflow, before booting.

The addition of options to extlinux resulted in the PXE and extlinux
bootmeth having slightly different features. This is tidied up in this
series, with common functions for both. This allows the same features
(loading images as a separate step) to be provided for PXE.

Changes in v3:
- Add new patch to convert IMAGE_FORMAT into an enum
- Add new patch to add a format for the booti file
- Add new patch to support booti format in bootm
- Add new patch to support compressed booti images in bootm
- Pass through the bootfile since extlinux and PXE are different
- Pass through the bootfile since extlinux and PXE are different
- Add new patch to detect booti format properly in pxe_utils
- Pass through the bootfile since extlinux and PXE are different

Changes in v2:
- Split out strlcpy() change into new patch
- Move strlcpy() change into an earlier patch
- Fix 'initaddr' typo'
- Rebase on earlier change
- Add new patch to simplify the code reading fdtcontroladdr and fdt_addr

Simon Glass (46):
  x86: Make do_zboot_states() static
  x86: Rename zboot_run() to zboot_run_args()
  x86: Drop duplicate definition of zimage_dump()
  x86: Move x86 zboot state into struct bootm_info
  x86: Rename state to bmi
  x86: Move the bootm state for zimage into cmd/
  bootstd: Correct display of kernel version
  x86: Drop the unnecessary base_ptr argument to zboot_dump()
  boot: Use strlcpy() in label_boot()
  boot: Split pxe label_boot() into two parts
  boot: Split pxe label_run_boot() into two parts
  boot: Pass just the FDT argument to label_process_fdt()
  bootm: Allow building bootm.c without CONFIG_SYS_BOOTM_LEN
  boot: Convert IMAGE_FORMAT into an enum
  boot: arm: riscv: sandbox: Add a format for the booti file
  boot: Support booti format in bootm
  boot: Support compressed booti images in bootm
  boot: pxe: Use bootm_...() functions where possible
  pxe_utils: Simplify default fdt in label_run_boot()
  boot: pxe: Refactor label_run_boot() to avoid cmdline
  net: Keep the bootstage functions together
  net: Tidy up the comments to parse_args()
  net: Simplify parse_args()
  net: Return the load address from parse_args()
  net: Return the address and size from parse_addr_size()
  net: Return the size from parse_args()
  net: Refactor part of netboot_common() into a function
  net: Drop #ifdef in parse_args()
  net: Provide a function to run network operations
  boot: Avoid using the cmdline in bootmeth_pxe and pxe cmd
  pxe: Drop the cmdline parameter
  pxe: Record the bootflow in the PXE context
  pxe: Allow skipping the boot
  test: Update bootm test to restore silent_console
  bootmeth_extlinux: Move extlinux_info into plat
  bootmeth_extlinux: Move pxe_context into plat
  bootmeth: Refactor to put options in a common file
  bootmeth_pxe: Implement the fallback option
  bootmeth_pxe: Drop the driver-private data
  bootmeth_extlinux: Move boot code into common file
  bootstd: Update extlinux and pxe to allow boot interruption
  pxe: Collect the FDT in the bootflow
  pxe: Deal with a missing FDT in the bootflow
  boot: Detect booti format properly in pxe_utils
  pxe_utils: Refactor to separate reading from booting
  bootmeth_extlinux: Refactor extlinux to split boot

 arch/arm/lib/image.c          |   9 +-
 arch/riscv/lib/image.c        |   9 +-
 arch/sandbox/lib/bootm.c      |   5 +
 arch/x86/include/asm/zimage.h |  57 +---
 arch/x86/lib/zimage.c         | 102 ++++---
 boot/Makefile                 |   6 +-
 boot/bootm.c                  |  76 ++++-
 boot/bootmeth_cros.c          |   6 +-
 boot/bootmeth_extlinux.c      |  98 +------
 boot/bootmeth_pxe.c           |  50 ++--
 boot/ext_pxe_common.c         | 139 +++++++++
 boot/image-board.c            |  36 +--
 boot/pxe_utils.c              | 513 +++++++++++++++++++++-------------
 cmd/bootflow.c                |   8 +-
 cmd/net.c                     |  92 +++---
 cmd/pxe.c                     |  30 +-
 cmd/sysboot.c                 |   4 +-
 cmd/x86/zboot.c               |  33 ++-
 include/bootm.h               |  63 ++++-
 include/bootmeth.h            |   8 +-
 include/extlinux.h            |  60 +++-
 include/image.h               |  48 +++-
 include/net-common.h          |  30 ++
 include/pxe_utils.h           |  56 +++-
 net/net.c                     |  44 +++
 test/boot/bootflow.c          |  71 +++++
 test/boot/bootm.c             |   7 +
 27 files changed, 1127 insertions(+), 533 deletions(-)
 create mode 100644 boot/ext_pxe_common.c

-- 
2.34.1



More information about the U-Boot mailing list