mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Benoît Burnichon" <Benoit.Burnichon@airtag.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: crc32 command
Date: Fri, 13 May 2011 19:22:52 +0200	[thread overview]
Message-ID: <20110513172252.GZ30963@pengutronix.de> (raw)
In-Reply-To: <04EB6ACBB90C8844892BE0B9828F13C8018734BA036D@SRVSBS.airtag.local>

Hi Benoit,

On Fri, May 13, 2011 at 05:54:00PM +0200, Benoît Burnichon wrote:
> Hi all,
> 
> I want to verify the version downloaded by tftp before installing it.
> 
> I have the file on my workstation:
> 
> $ cksum /var/lib/tftpboot/uImage-pcm038 
> 2156276197 2317276 /var/lib/tftpboot/uImage-pcm038
> 
> Under my barebox, I then try to verify the file:
> 
> barebox:/ crc32
> Usage: crc32 [OPTION] [AREA]
> Calculate a crc32 checksum of a memory area
> Options:
>   -f <file>   Use file instead of memory
>   -v <crc>    Verfify
> 
> barebox:/ crc32 -f uImage-pcm038 -v 2156276197 0+2317276
> CRC32 for uImage-pcm038 0x00000000 ... 0x00235bdb ==> 0xd484eccb != 0x808629e5 ** ERROR **
> barebox:/ crc32 -f uImage-pcm038                        
> CRC32 for uImage-pcm038 0x00000000 ... 0x00235bdb ==> 0xd484eccb
> 
> 
> I have barebox-2010.11.0
> 
> 
> How can I use crc32 to verify the files I transfer?

The algorithms differ, so cksum is not usable here. Got curious myself
and looked around in the net. the zip tool is usable for this:

zip test.zip barebox.bin; unzip -lv test.zip

Ok, this sucks, but there is also a standalone program (haven't tested
this). See here:

http://docwiki.gumstix.org/index.php/Calculating_32_bit_CRCs

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 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:[~2011-05-13 17:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 15:54 Benoît Burnichon
2011-05-13 17:22 ` Sascha Hauer [this message]
2011-05-14  7:09   ` Peter Korsgaard
2011-05-14 17:16     ` Sascha Hauer
2011-05-14 21:50       ` Peter Korsgaard
2011-05-15  8:50         ` Alexey Galakhov

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=20110513172252.GZ30963@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=Benoit.Burnichon@airtag.com \
    --cc=barebox@lists.infradead.org \
    /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