mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <>
Cc: Trent Piepho <>
Subject: [PATCH] imx-image: Fix uninitialized add_barebox_header
Date: Tue, 25 May 2021 23:58:56 -0700	[thread overview]
Message-ID: <> (raw)

From: Trent Piepho <>

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 <>
 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,

barebox mailing list

             reply	other threads:[~2021-05-26  7:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  6:58 Trent Piepho [this message]
2021-05-27  7:11 ` Sascha Hauer
2021-05-27  8:13   ` Trent Piepho
2021-05-27  9:21     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox