Dear Jon,

in message <[email protected]> you 
wrote:
>
> >> > getenv("unlock"); do what you want when the environment is in EEPROM?
> >>
> >> getenv() always works that way, no matter which actual media is used
> >> for the persistent storage of the environment.
> >
> > This is not quite true. In the PPC init sequence flash_init() is called
> > before env_relocate() and thus getenv is not available in flash_init().

I see. You are right.

> > Please note that this was just a quick way for us to make things work
> > and I never considered this a fix for mainline.
> 
> What is your fix for mainline?

We cannot run env_relocate() before flash_init(), as  (with  environ-
ment  stored  in flash) we need an initialized flash memory to do so.
Consequently, we indeed have to use getenv_r() instead of getenv().


Stefan, will you pick up the original patch, please:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/56275

Hm, you might want to change "char s[4];" into "char s[256];" or
similar, though, to make buffer overflows less likely.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
I used to be indecisive, now I'm not sure.
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to