summaryrefslogtreecommitdiff
path: root/tools/mkimage.c
diff options
context:
space:
mode:
authorAristo Chen <[email protected]>2025-06-10 07:41:18 +0000
committerTom Rini <[email protected]>2025-06-26 08:12:54 -0600
commit7a8b25a771f069819eab6134fd1c4df520ebc9ca (patch)
tree371ed35d6845ce99fb1007a3dda0bbdb4ffae815 /tools/mkimage.c
parent21705d39144a51a50c0206c74588c6e9e4018e7a (diff)
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 <[email protected]>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r--tools/mkimage.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 2954626a283..361711c53b2 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -519,8 +519,13 @@ int main(int argc, char **argv)
*/
retval = tparams->fflag_handle(&params);
- if (retval != EXIT_SUCCESS)
+ if (retval != EXIT_SUCCESS) {
+ if (retval == FDT_ERR_NOTFOUND) {
+ // Already printed error, exit cleanly
+ exit(EXIT_FAILURE);
+ }
usage("Bad parameters for FIT image type");
+ }
}
if (params.lflag || params.fflag) {