diff mbox series

[RFC,u-boot-mvebu,48/59] tools: mkimage: Do not try to open datafile when it is skipped

Message ID 20230221201925.9644-49-pali@kernel.org
State Accepted
Commit b07965b8a9a9887a37f41254d6155f8fc38ad006
Delegated to: Stefan Roese
Headers show
Series arm: mvebu: Various fixes | expand

Commit Message

Pali Rohár Feb. 21, 2023, 8:19 p.m. UTC
When mkimage was instructed to skip datafile via option -s then do not try
to validate or open datafile as it does not have to exist or to be
specified via -d option.

This change allows to use -s option for skipping datafile when -d option
for datafile was not specified.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 tools/mkimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/mkimage.c b/tools/mkimage.c
index c53768f8d8de..19c139f402c9 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -567,7 +567,7 @@  int main(int argc, char **argv)
 		exit (retval);
 	}
 
-	if ((params.type != IH_TYPE_MULTI) && (params.type != IH_TYPE_SCRIPT)) {
+	if (!params.skipcpy && params.type != IH_TYPE_MULTI && params.type != IH_TYPE_SCRIPT) {
 		if (!params.datafile) {
 			fprintf(stderr, "%s: Option -d with image data file was not specified\n",
 				params.cmdname);