[U-Boot] where *precisely* is u-boot's environment stored?
Robert P. J. Day
rpjday at crashcourse.ca
Wed Jul 6 12:12:28 CEST 2016
On Wed, 6 Jul 2016, Måns Rullgård wrote:
> "Robert P. J. Day" <rpjday at crashcourse.ca> writes:
> > p.s. how does the default environment get to the CONFIG_ENV_ADDR
> > defined in the board header file? is that done automatically when
> > u-boot starts to run and notices that there is no valid
> > environment info at that address, and therefore copies it for you?
>
> If the stored environment is invalid (e.g. uninitialised), the
> built-in default is used. Nothing is written until you issue a
> saveenv command. This saves a copy of the live environment to the
> configured location.
ah, that's the final bit of the puzzle i was looking for ... the
first time a "saveenv" is done is when the configured location is
examined and, if uninitialized, the env is copied there and is used
from then on.
and it would appear that the location of the "current" environment
is stored in "gd->env_addr", does that sound about right?
i'm still going to write this up somewhere for future reference.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
More information about the U-Boot
mailing list