提交 6ae6e160 编写于 作者: P Philippe De Swert 提交者: Tom Rini

mkimage : Fix generating multi and script images

Seems 92a655c3 broke creating multi and script type images.
Since the file1:file2:file3 string does not get split up,
it fails on trying to open an non-existing file.

mkimage -A arm -O linux -T multi -C none -d zImage:splash.bmp:device.dtb uimage
tools/mkimage: Can't open zImage:splash.bmp:device.dtb: No such file or directory

Since the sizes of the different parts seem to get added in the actual
routine that handles multi and script type images, we can probably skip the
bit of the code that causes the failure for that type of images.
Signed-off-by: NPhilippe De Swert <philippedeswert@gmail.com>
上级 e9acb9ea
......@@ -311,21 +311,26 @@ NXTARG: ;
exit (retval);
}
if (!params.type == IH_TYPE_MULTI ||
!params.type == IH_TYPE_SCRIPT) {
dfd = open(params.datafile, O_RDONLY | O_BINARY);
if (dfd < 0) {
fprintf(stderr, "%s: Can't open %s: %s\n",
params.cmdname, params.datafile, strerror(errno));
params.cmdname, params.datafile,
strerror(errno));
exit(EXIT_FAILURE);
}
if (fstat(dfd, &sbuf) < 0) {
fprintf(stderr, "%s: Can't stat %s: %s\n",
params.cmdname, params.datafile, strerror(errno));
params.cmdname, params.datafile,
strerror(errno));
exit(EXIT_FAILURE);
}
params.file_size = sbuf.st_size + tparams->header_size;
close(dfd);
}
/*
* In case there an header with a variable
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册