From: Jordan Hand <jordanhand22@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1] fdt: Fix mkimage list to try every header type
Date: Tue, 9 Apr 2019 10:36:09 -0700 [thread overview]
Message-ID: <20190409173609.18388-1-jorhand@microsoft.com> (raw)
Signed-off-by: Jordan Hand <jorhand@microsoft.com>
---
Image type is not supplied to `mkimage -l`. For this reason, we cannot
use imagetool_verify_print_header_by_type. Instead, this patch uses
imagetool_verify_print_header to look through all header types to find
one where image validation succeeds.
This patch fixes failures in test/image/test-imagetools.sh
tools/mkimage.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 2899adff81..d1e1a6743d 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -403,14 +403,21 @@ int main(int argc, char **argv)
exit (EXIT_FAILURE);
}
- /*
- * scan through mkimage registry for all supported image types
- * and verify the input image file header for match
- * Print the image information for matched image type
- * Returns the error code if not matched
- */
- retval = imagetool_verify_print_header_by_type(ptr, &sbuf,
- tparams, ¶ms);
+ if (params.fflag) {
+ /*
+ * Verifies the header format based on the expected header for image
+ * type in tparams
+ */
+ retval = imagetool_verify_print_header_by_type(ptr, &sbuf,
+ tparams, ¶ms);
+ } else {
+ /**
+ * When listing the image, we are not given the image type. Simply check all
+ * image types to find one that matches our header
+ */
+ retval = imagetool_verify_print_header(ptr, &sbuf,
+ tparams, ¶ms);
+ }
(void) munmap((void *)ptr, sbuf.st_size);
(void) close (ifd);
--
2.17.1
next reply other threads:[~2019-04-09 17:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-09 17:36 Jordan Hand [this message]
2019-04-09 20:54 ` [U-Boot] [U-Boot, v1] fdt: Fix mkimage list to try every header type Vagrant Cascadian
2019-04-10 8:52 ` [U-Boot] [PATCH " Alex Kiernan
2019-04-10 16:28 ` Jordan Hand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190409173609.18388-1-jorhand@microsoft.com \
--to=jordanhand22@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox