]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mkimage: Add a few more messages for FIT failures
authorSimon Glass <sjg@chromium.org>
Wed, 21 Dec 2022 23:08:23 +0000 (16:08 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 18 Jan 2023 18:49:13 +0000 (11:49 -0700)
Add messages to make it clearer which part of the FIT creation is failing.
This can happen when an invalid 'algo' property is provided in the .its
file.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/fit_image.c
tools/image-host.c

index 923a9755b70993dfa6756b2464dbdf8a889fcad7..8a18b1b0ba9446f04d6f17a0ae5cfcadfa008b5e 100644 (file)
@@ -36,8 +36,10 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc,
 
        tfd = mmap_fdt(params->cmdname, tmpfile, size_inc, &ptr, &sbuf, true,
                       false);
-       if (tfd < 0)
+       if (tfd < 0) {
+               fprintf(stderr, "Cannot map FDT file '%s'\n", tmpfile);
                return -EIO;
+       }
 
        if (params->keydest) {
                struct stat dest_sbuf;
index 4e0512be6340f47bc9fdb701dcb619da48f436ec..4a24dee8153c0514f18dcafad4b15c913c919e8d 100644 (file)
@@ -1292,8 +1292,12 @@ int fit_add_verification_data(const char *keydir, const char *keyfile,
                ret = fit_image_add_verification_data(keydir, keyfile, keydest,
                                fit, noffset, comment, require_keys, engine_id,
                                cmdname, algo_name);
-               if (ret)
+               if (ret) {
+                       printf("Can't add verification data for node '%s' (%s)\n",
+                              fdt_get_name(fit, noffset, NULL),
+                              fdt_strerror(ret));
                        return ret;
+               }
        }
 
        /* If there are no keys, we can't sign configurations */