When the image contains CSF data we must add CSF_LEN to the image size pointer. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- scripts/imx/imx-image.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index 20815bf..16f086a 100644 --- a/scripts/imx/imx-image.c +++ b/scripts/imx/imx-image.c @@ -210,10 +210,8 @@ static int add_header_v1(struct config_data *data, void *buf) uint32_t loadaddr = data->image_load_addr; uint32_t imagesize = data->load_size; - if (add_barebox_header) { + if (add_barebox_header) memcpy(buf, bb_header, sizeof(bb_header)); - *psize = imagesize; - } buf += offset; hdr = buf; @@ -246,6 +244,9 @@ static int add_header_v1(struct config_data *data, void *buf) imagesize += CSF_LEN; } + if (add_barebox_header) + *psize = imagesize; + *(uint32_t *)buf = imagesize; return 0; -- 2.7.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox