public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Environment structure.
Date: Thu, 30 Jul 2009 17:29:27 +0200	[thread overview]
Message-ID: <m2my6m8a08.fsf@ohwell.denx.de> (raw)
In-Reply-To: <200907301534.28277.chernigovskiy@spb.gs.ru> (Tuma's message of "Thu, 30 Jul 2009 15:34:28 +0400")

Hi Tuma,

> Hello All!

Hiya.

> I develop some "upgrade" tool based on the U-Boot booted from SD card.
> I want to boot from SD card, and execute some simple script which is stored in 
> bootcmd environment variable:
> "echo Hello! ; mmcinit ; sleep 10 ; reset; " etc...
> So I need to generate some environment file.

Sorry, but I do not understand why you need to generate an environment
image if you only eant to run some scripts.  Can we please step back
again and talk about what you want to achieve?  Pretty likely there is a
different and cleaner solution to your problem.

> I find source from tools/env very 
> useful (I try to get variables from correct file I already have), but I can't 
> find any description of environment file (or flash partition) at all (which I 
> need to write tool for generating environment file).
> Can someone explain me the structure of the file, please.
> Something like:
> 0-4 - CRC

Well the problem is that environment can be in a different format,
depending on configuration options.  If for example you enable redundand
environments, you will have another byte after the crc signalling which
of the two copies is the active one.

> 5-... - (Environment)\0(Environment)\0... 
> ... Environment End Mark...
> and so on.
>
> Or tell me in what file should I see from U-Boot source.

A good start would be to read /include/environment.h - but only after
you are really sure that you want to generate an environment after all
:)

> And is there any difference between content of OneNAND flash 
> environment-partition and file on SD card?

I can parse the sentence syntactically, but I have no clue what you are
asking here...

Cheers
  Detlev

-- 
Math and Alcohol don't mix, so...
PLEASE DON'T DRINK AND DERIVE

[Motto of the society: Mathematicians Against Drunk Deriving]
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

  reply	other threads:[~2009-07-30 15:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 11:34 [U-Boot] Environment structure Tuma
2009-07-30 15:29 ` Detlev Zundel [this message]
2009-08-03 13:03   ` [U-Boot] BMP display Tuma
2009-08-05 14:31     ` Detlev Zundel
2009-08-06 11:48       ` Tuma
2009-08-06 15:25         ` Detlev Zundel
2009-08-13  9:26           ` Tuma
2009-08-13  9:45             ` Wolfgang Denk
     [not found]               ` <200908171305.55605.chernigovskiy@spb.gs.ru>
2009-08-17  9:33                 ` Wolfgang Denk
2009-08-17  9:38                   ` Tuma
2009-08-17  9:52                     ` Wolfgang Denk
2009-08-17 11:12                       ` Tuma
2009-08-17 11:51                         ` Wolfgang Denk
     [not found]                           ` <200908171631.17975.chernigovskiy@spb.gs.ru>
2009-08-17 12:38                             ` Wolfgang Denk
2009-08-17 13:55                               ` Tuma
2009-08-17 14:01                                 ` Tuma
2009-08-17 15:37                                 ` Premi, Sanjeev
2009-08-18  9:00                                   ` Tuma
2009-08-18 11:04                                     ` Wolfgang Denk
2009-08-17 20:31                                 ` Wolfgang Denk

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=m2my6m8a08.fsf@ohwell.denx.de \
    --to=dzu@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