1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 17:22:22 +02:00

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: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Peng Fan
2018-11-05 09:53:31 +00:00
committed by Stefano Babic
parent a9f7f1c585
commit 47f7a9def7

View File

@@ -914,9 +914,10 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (container >= 0) {
/* Note: Image offset are not contained in the image */ /* Note: Image offset are not contained in the image */
tmp = flatten_container_header(&imx_header, container + 1, &size, tmp = flatten_container_header(&imx_header, container + 1,
file_padding); &size, file_padding);
/* Write image header */ /* Write image header */
if (write(ofd, tmp, size) != size) { if (write(ofd, tmp, size) != size) {
fprintf(stderr, "error writing image hdr\n"); fprintf(stderr, "error writing image hdr\n");
@@ -925,6 +926,7 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
/* Clean-up memory used by the headers */ /* Clean-up memory used by the headers */
free(tmp); free(tmp);
}
/* /*
* step through the image stack again this time copying * step through the image stack again this time copying