tools: mkimage: Do not try to open datafile when it is skipped

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>
This commit is contained in:
Pali Rohár 2023-01-21 20:09:26 +01:00 committed by Stefan Roese
parent 2f6855a6aa
commit b07965b8a9

View file

@ -599,7 +599,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);