diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-05 16:04:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-06 10:19:00 +0200 |
commit | d3b805ad9a99933ef7d25e05b223d37c36141b37 (patch) | |
tree | b6a40f3907354a267ab0b6bd4597dee8c595f1bd /scripts | |
parent | 02f826830fe0925ef49faaecf001df52ac45726f (diff) | |
download | barebox-d3b805ad9a99933ef7d25e05b223d37c36141b37.tar.gz barebox-d3b805ad9a99933ef7d25e05b223d37c36141b37.tar.xz |
scripts: imx: imx-image: Fix image size for HABv3 images
When the image contains CSF data we must add CSF_LEN to the image
size pointer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/imx/imx-image.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index 20815bfb98..16f086af31 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; |