mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] imx-image: Fix uninitialized add_barebox_header
@ 2021-05-26  6:58 Trent Piepho
  2021-05-27  7:11 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Trent Piepho @ 2021-05-26  6:58 UTC (permalink / raw)
  To: barebox; +Cc: Trent Piepho

From: Trent Piepho <tpiepho@gmail.com>

It's set to 1 if the -b option is used, but is neither initialized nor
set to 0 if not.  Since the barebox image building recipies only uses -b
with this tool, it wasn't noticed.

Note that ommiting -b, so as to not add a barebox header, still adds a
1024 byte header, it's just blank.  I think it would be better if it was
not added at all.  If flashing to an SD card or eMMC main block, this
header overlaps the partition table, and so needs to not be flashed.
It's not part of the imx image.  It's just padding to place the imx
image at the correct location w.r.t. the start of flash.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
---
 scripts/imx/imx-image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index 3e277e82f..b97f56189 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -770,7 +770,7 @@ int main(int argc, char *argv[])
 	int outfd;
 	int dcd_only = 0;
 	int now = 0;
-	int add_barebox_header;
+	int add_barebox_header = 0;
 	uint32_t barebox_image_size = 0;
 	struct config_data data = {
 		.image_ivt_offset = 0xffffffff,
-- 
2.26.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-27  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26  6:58 [PATCH] imx-image: Fix uninitialized add_barebox_header Trent Piepho
2021-05-27  7:11 ` Sascha Hauer
2021-05-27  8:13   ` Trent Piepho
2021-05-27  9:21     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox