提交 47f7a9de 编写于 作者: P Peng Fan 提交者: Stefano Babic

tools: imx8image: flatten container header only when creating container

If there is no CONTAINER entry, there is no need to flatten container
header.
Signed-off-by: NPeng Fan <peng.fan@nxp.com>
上级 a9f7f1c5
......@@ -914,17 +914,19 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
exit(EXIT_FAILURE);
}
/* Note: Image offset are not contained in the image */
tmp = flatten_container_header(&imx_header, container + 1, &size,
file_padding);
/* Write image header */
if (write(ofd, tmp, size) != size) {
fprintf(stderr, "error writing image hdr\n");
exit(EXIT_FAILURE);
}
if (container >= 0) {
/* Note: Image offset are not contained in the image */
tmp = flatten_container_header(&imx_header, container + 1,
&size, file_padding);
/* Write image header */
if (write(ofd, tmp, size) != size) {
fprintf(stderr, "error writing image hdr\n");
exit(EXIT_FAILURE);
}
/* Clean-up memory used by the headers */
free(tmp);
/* Clean-up memory used by the headers */
free(tmp);
}
/*
* step through the image stack again this time copying
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册