[PATCH] scripts: imx: imx-image: Fix image size for HABv3 images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux