mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <>
To: Trent Piepho <>
Subject: Re: [PATCH] imx-image: Fix uninitialized add_barebox_header
Date: Thu, 27 May 2021 09:11:05 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, May 25, 2021 at 11:58:56PM -0700, Trent Piepho wrote:
> 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.

Applied to master, thanks.

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

The idea is that you can put the imx image at the beginning of an SD/MMC
card without knowing any offsets. Yes, you'll overwrite the partition
table in that case, but once you know that you can skip/seek 512 bytes
on both the image and the card and be done. Note that with newer i.MX
SoCs like i.MX8 the offset was changed to 33k to support GPT partition
tables. With i.MX8MP they changed the offset again to 32k. I think
Having to know all these offsets is not better than the current


Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       |  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

barebox mailing list

  reply	other threads:[~2021-05-27  7:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  6:58 Trent Piepho
2021-05-27  7:11 ` Sascha Hauer [this message]
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 \ \ \ \ \
    --subject='Re: [PATCH] imx-image: Fix uninitialized add_barebox_header' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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