This series adds a bootmeth for U-Boot script images stored directly in a named partition, without a filesystem. It first adds bounds checks to the shared legacy script parser, so the existing script bootmeth and source command benefit from the same protection.
The raw bootmeth supports legacy scripts and FIT scripts with embedded data. It bounds reads by the partition size and a configurable limit, validates the FIT structure, and rejects external data. A separate bootmeth keeps raw-partition scanning independently selectable from filesystem script lookup while sharing verification and execution. Changes since v1: - Split the shared legacy parser bounds checks into patch 1. - Name the parser regression test image_legacy_script_bounds to make its legacy-only coverage explicit. - Keep genimg_get_format() and check the known header size before probing. - Remove duplicate legacy parsing and redundant raw image checks. - Move the raw FIT minimum-size check into the FIT branch. - Add log_msg_ret() diagnostics to raw bootmeth rejection paths. - Fix the documentation title and explain the self-contained FIT policy. - Enable CONFIG_BOOTMETH_SCRIPT_RAW in sandbox_defconfig. - Replace the Python execution tests with C bootflow tests and a generated GPT image in test/py/img/script_raw.py; require sgdisk for image setup. - Update existing bootflow/bootmeth tests for the additional method and preserve BOOTFLOWIF_SKIP_GLOBAL coverage in the iterator test. Validation: - Sandbox build and 40 selected bootflow, bootmeth, image-bounds and image setup tests passed. Both patches passed checkpatch without findings. - Strict HTML documentation build passed without warnings. - v2 was also successfully tested on LCKFB Taishan Pi RK3566 using lckfb-tspi-rk3566_defconfig with CONFIG_BOOTMETH_SCRIPT_RAW enabled. He Yong (2): image: Bound legacy script parsing by the image size bootstd: Add a bootmeth for scripts in raw partitions MAINTAINERS | 1 + arch/sandbox/dts/test.dts | 12 ++ boot/Kconfig | 26 ++++ boot/Makefile | 1 + boot/bootmeth_script.c | 4 +- boot/bootmeth_script_raw.c | 183 ++++++++++++++++++++++++++ boot/image-board.c | 30 ++++- configs/sandbox_defconfig | 1 + doc/develop/bootstd/index.rst | 1 + doc/develop/bootstd/script_raw.rst | 51 +++++++ doc/device-tree-bindings/bootmeth.txt | 1 + include/bootmeth.h | 12 ++ include/image.h | 3 +- test/boot/bootflow.c | 84 +++++++++++- test/boot/bootmeth.c | 31 ++++- test/boot/image.c | 77 +++++++++++ test/py/img/__init__.py | 2 + test/py/img/script_raw.py | 107 +++++++++++++++ test/py/tests/test_ut.py | 9 ++ 19 files changed, 626 insertions(+), 10 deletions(-) create mode 100644 boot/bootmeth_script_raw.c create mode 100644 doc/develop/bootstd/script_raw.rst create mode 100644 test/py/img/__init__.py create mode 100644 test/py/img/script_raw.py
