Hi all, This series introduces a validation step in mkimage to ensure that all image names referenced under the /configurations node of a FIT source (ITS) are actually defined under the /images node.
### Motivation When using mkimage to build FIT images, it's easy to mistakenly reference nonexistent image nodes in configurations (e.g., referencing a missing `fdt` or `firmware` node). Such issues are often not caught until runtime in U-Boot. This series aims to catch these errors early during FIT image creation by validating the configuration references in mkimage itself. ### Changes in v4 - The changes in v4 are for fixing errors in CI process - In the FIT validation loop, updated image name check from: ```c if (!img_name) continue; ``` to: ```c if (!img_name || !*img_name) continue; ``` This ensures that both NULL pointers and empty strings ("") are ignored when validating image references in the /configurations node - Resolves a regression on the `phycore-am62x` platform where `mkimage` reports an error due to missing image nodes referenced via the `loadables` property (e.g., "tifsstub-hs"). This patch adds the required `tifsstub-hs`, `tifsstub-fs`, and `tifsstub-gp` image nodes in the corresponding binman description, inspired by commit 622f826bf025 ("arm: dts: phycore-am62x: Package TIFS Stub"). ### Changes in v3 - Series re-sent correctly as a single thread without code changes ### Changes in v2 - Use `fdt_stringlist_count()` and `fdt_stringlist_get()` to handle stringlist properties cleanly - Validate additional properties (`firmware`, `fpga`, `script`) - Improve error messages by including the failing configuration and property name - Refactor error propagation in `fit_handle_file()` as a separate commit - Update all affected binman test DTS files to include the missing `atf` and `uboot` image nodes - Add a new Python test case under `test/py/` to ensure mkimage correctly fails when an image is missing Best regards, Aristo Chen Aristo Chen (5): tools: mkimage: propagate error codes from fit_handle_file() tools: mkimage: validate image references in FIT configurations binman: test: Ensure all config references exist in /images node test: py: add mkimage test for undefined image references in FIT configs arm: dts: phycore-am62x: Add missing tifsstub image nodes for FIT loadables arch/arm/dts/k3-am625-phycore-som-binman.dtsi | 94 +++++++++++++++++++ test/py/tests/test_fit_mkimage_validate.py | 58 ++++++++++++ tools/binman/test/170_fit_fdt.dts | 14 +++ .../binman/test/220_fit_subentry_bintool.dts | 2 +- tools/binman/test/223_fit_fdt_oper.dts | 14 +++ tools/binman/test/284_fit_fdt_list.dts | 14 +++ tools/binman/test/333_fit_fdt_dir.dts | 14 +++ tools/binman/test/334_fit_fdt_compat.dts | 14 +++ tools/binman/test/335_fit_fdt_phase.dts | 14 +++ tools/binman/test/345_fit_fdt_name.dts | 14 +++ tools/fit_image.c | 42 ++++++++- tools/mkimage.c | 7 +- 12 files changed, 297 insertions(+), 4 deletions(-) create mode 100644 test/py/tests/test_fit_mkimage_validate.py -- 2.43.0