[U-Boot] Environment structure.

Detlev Zundel dzu at denx.de
Thu Jul 30 17:29:27 CEST 2009


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


More information about the U-Boot mailing list