This series adds a script_raw bootmeth for U-Boot script images stored at the start of a named partition, without a filesystem or a board-specific bootcmd. It supports legacy scripts and FIT scripts with embedded data. Image reads are bounded by the partition size and a configurable limit.
The raw and filesystem script bootmeths share the execution handler and script parser. For known-size FIT scripts, the parser passes the buffer size to fit_check_format() and rejects external data before verification. The existing FIT_FULL_CHECK configuration controls full structural checks. Changes since v2: - Split the series into shared FIT validation, execution-handler export, the raw bootmeth, and sandbox tests. - Drop the legacy parser bounds-check changes from this series. - Move known-size FIT validation and external-data rejection into the shared script parser, with tests for both verify settings and source. - Bind script_raw inside its C test, following bootflow_rauc(), so existing bootmeth lists and bootflow tests stay unchanged, including -G coverage. - Label each expected C error with its corresponding Python case name. - Reuse fs_helper.setup_image() with an sfdisk partition specification and generate the disk from test_ut_dm_init_bootstd(), avoiding sgdisk and a separate initialization test. - Preserve the CONFIG_SANDBOX comment and clear verify on helper failure. Validation on this revision: - Sandbox build: make O=build-sandbox -j8 - Sandbox pytest: 3 passed (bootstd image initialization, image_fit_script_bounds and bootflow_script_raw) Previous version: https://www.mail-archive.com/[email protected]/msg09207.html He Yong (4): image: Bound FIT script checks by the image size bootstd: Export the script bootflow execution handler bootstd: Add a bootmeth for scripts in raw partitions test: bootstd: Cover scripts in raw partitions on sandbox MAINTAINERS | 1 + arch/sandbox/dts/test.dts | 8 ++ boot/Kconfig | 26 +++++ boot/Makefile | 1 + boot/bootmeth_script.c | 4 +- boot/bootmeth_script_raw.c | 152 ++++++++++++++++++++++++++ boot/image-board.c | 19 +++- 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 ++ test/boot/bootflow.c | 81 ++++++++++++++ test/boot/image.c | 118 ++++++++++++++++++++ test/py/img/__init__.py | 2 + test/py/img/script_raw.py | 98 +++++++++++++++++ test/py/tests/fs_helper.py | 19 ++-- test/py/tests/test_ut.py | 3 + 18 files changed, 588 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 base-commit: 0a55b098d6f5f6bafa84fc2f18b433dd167bf729 -- 2.43.0
