diff mbox

[U-Boot,03/14] mkimage: Require a data file when auto-fit is used

Message ID 1467305540-13607-4-git-send-email-sjg@chromium.org
State Accepted
Commit e324a92531e1dc092949b8a00745afd2328e178e
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass June 30, 2016, 4:52 p.m. UTC
When auto-fit is used, it is not valid to create a FIT without an image
file. Add a check for this to avoid a very confusing error message later
("Can't open (null): Bad address").

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/mkimage.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tom Rini July 2, 2016, 1:36 a.m. UTC | #1
On Thu, Jun 30, 2016 at 10:52:09AM -0600, Simon Glass wrote:

> When auto-fit is used, it is not valid to create a FIT without an image
> file. Add a check for this to avoid a very confusing error message later
> ("Can't open (null): Bad address").
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini July 16, 2016, 1:48 p.m. UTC | #2
On Thu, Jun 30, 2016 at 10:52:09AM -0600, Simon Glass wrote:

> When auto-fit is used, it is not valid to create a FIT without an image
> file. Add a check for this to avoid a very confusing error message later
> ("Can't open (null): Bad address").
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/tools/mkimage.c b/tools/mkimage.c
index 66d29ab..a36c031 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -276,6 +276,8 @@  static void process_args(int argc, char **argv)
 		/* For auto_its, datafile is always 'auto' */
 		if (!params.auto_its)
 			params.datafile = datafile;
+		else if (!params.datafile)
+			usage("Missing data file for auto-FIT (use -d)");
 	} else if (type != IH_TYPE_INVALID) {
 		params.type = type;
 	}