tools: mkimage: validate image references in FIT configurations
authorAristo Chen <jj251510319013@gmail.com>
Tue, 10 Jun 2025 07:41:18 +0000 (07:41 +0000)
committerTom Rini <trini@konsulko.com>
Thu, 26 Jun 2025 14:12:54 +0000 (08:12 -0600)
commit7a8b25a771f069819eab6134fd1c4df520ebc9ca
tree371ed35d6845ce99fb1007a3dda0bbdb4ffae815
parent21705d39144a51a50c0206c74588c6e9e4018e7a
tools: mkimage: validate image references in FIT configurations

When parsing a FIT image source (ITS), mkimage does not currently check
whether the image names referenced in the /configurations section (e.g.
"kernel", "fdt", "ramdisk", "loadables") actually exist in the /images
node.

This patch introduces a validation step during FIT import that iterates
over each configuration and verifies that all referenced image names are
defined under /images. If a missing image is detected, an appropriate
error is reported and mkimage exits with FDT_ERR_NOTFOUND.

This ensures that configuration integrity is validated at build time.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
tools/fit_image.c
tools/mkimage.c