mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Yunus Bas <y.bas@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] images: Add automatic image crc generation for imd
Date: Mon, 7 Dec 2020 10:28:40 +0100	[thread overview]
Message-ID: <20201207092840.GH3977@pengutronix.de> (raw)
In-Reply-To: <20201204100421.2385465-1-y.bas@phytec.de>

Hi Yunus,

On Fri, Dec 04, 2020 at 11:04:21AM +0100, Yunus Bas wrote:
> Since commit 9d12256bfcc6, the barebox IMD-header has an additional
> register space for CRC32 checksum. This is an important feature, since
> it allows us to verify the barebox image after flashing to the hardware.
> 
> This patch adds an optional feature for automatically generating the CRC32
> checksum and writing it into IMD-section for all generated image-files.
> Additionally, the file 'barebox-imd-crc', containing the list of IMD
> outputs including the CRC32-value, will be generated under the images
> directory.

It's not that easy unfortunately. Generating CRC IMD tags doesn't work
for many image types. For example the i.MX28 images are all encrypted,
so the bareboximd command won't find any valid tags in the binary. The
signed i.MX6 HAB images could be added a CRC to, but doing that would
invalidate the signature.
I'm afraid it's not possible to add a IMD crc to all images, we must
carefully select the images we can actually do that.

Having said that, generating the crcs automatically would be really
great and I have also thought about that. See the following series as
a starting point. It's not complete though, because it generates the
crcs also in HAB signed images.

Sascha

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

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

  reply	other threads:[~2020-12-07  9:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 10:04 Yunus Bas
2020-12-07  9:28 ` Sascha Hauer [this message]
2020-12-07  9:29   ` [PATCH 1/3] imd command: specify outfile for crc tag generation Sascha Hauer
2020-12-07  9:29     ` [PATCH 2/3] kbuild: Add command to generate the crc for the IMD crc tag Sascha Hauer
2020-12-07  9:29     ` [PATCH 3/3] images: i.MX: fill in crc in IMD crc tags Sascha Hauer
2020-12-08  8:09   ` [PATCH] images: Add automatic image crc generation for imd Yunus Bas

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20201207092840.GH3977@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=y.bas@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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