public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] crc32 checksum header in bootvars section of flash
Date: Wed, 09 Jan 2008 10:00:22 +0100	[thread overview]
Message-ID: <20080109090022.4CC136F0010@nyx.denx.de> (raw)
In-Reply-To: Your message of "Tue, 08 Jan 2008 15:51:17 PST." <14702144.post@talk.nabble.com>

In message <14702144.post@talk.nabble.com> you wrote:
> 
> Can anybody tell me where in u-boot source code and how is the crc32
> checksum generated for the bootvars  

This should be trivial to find in the source code, shouldn't it?

> But the values in the bootvars section in flash do not match with the printf
> values? There is a crc32 command in the u-boot bootloader as well. Is that
> used to calculate the checksum in the bootvars section? If yes, then what
> option is it used with and can we replicate the same code in user space so
> we can edit our own files and append checksums to it at the beginning?

I think what you're trying to do is  broken  by  design.  Instead  of
trying  to  rely on internal information of U-Boot (how it stores the
environment  variables)  you  should  instead   use   the   official,
documented interfaces to do what you want to do.

Instead of crafting some  binary  blob  that  holds  the  environment
variables  in  some  undocumented  internal format, you should simply
write a text file which sontains the wanted variable settings in form
of "setenv" commands, then convert  this  text  file  into  a  script
image,  and  finally  use the U-Boot "autoscr" command to apply these
settings.

Thius way you can be sure that U-Boot will compute the correct
checksum itself.

Also, you have simple text files which are much easier to maintain
than binary blobs.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
He had quite a powerful intellect, but it  was  as  powerful  like  a
locomotive,  and  ran on rails and was therefore almost impossible to
steer.                          - Terry Pratchett, _Lords and Ladies_

      reply	other threads:[~2008-01-09  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-08 23:51 [U-Boot-Users] crc32 checksum header in bootvars section of flash u-boot user
2008-01-09  9:00 ` Wolfgang Denk [this message]

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=20080109090022.4CC136F0010@nyx.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.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