summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-06-19 14:26:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-07-14 20:18:38 +0200
commit03ecd7086f232c21a8a8121db09d5d465e16cda1 (patch)
tree5cb6213fd0d01003b9dcacdfc965b5f06049a286 /scripts
parent53f289603d401be5852eeaba933d59606fe19f71 (diff)
downloadbarebox-03ecd7086f232c21a8a8121db09d5d465e16cda1.tar.gz
barebox-03ecd7086f232c21a8a8121db09d5d465e16cda1.tar.xz
scripts: imx-image: exit with error when barebox header conflicts with IVT
When the IVT is right at the beginning of the image it conflicts with the barebox header. Bail out with an error when this happens. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/imx/imx-image.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index edff3580dd..bbd7e95bc2 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -984,6 +984,12 @@ int main(int argc, char *argv[])
header_len - sizeof_bb_header);
xwrite(outfd, buf, header_len);
} else {
+ if (add_barebox_header &&
+ data.image_dcd_offset + data.header_gap < sizeof_bb_header) {
+ fprintf(stderr, "barebox header conflicts with IVT\n");
+ exit(1);
+ }
+
xwrite(outfd, add_barebox_header ? bb_header : buf,
sizeof_bb_header);