[U-Boot-Users] Using 'ver' env var

Wolfgang Denk
2007-08-14T15:23:43Z

In message <1187102431.13869.7.camel@elrond.sweden.atmel.com> you wrote:
>
> Ideally this should be in a script "reboot_cmd" which
> gets executed at every reboot before anything else
> is executed.

I really don't understand why you make all this so complicated.

I think we agree that all that needs to be done is running a single
"saveenv" command once after installation of a new U-Boot image (which
is supposed to never to happen in the field anyway).

So deine yoiur "bootcmd" to include something like a "run once"
command, and define "once" as a "harmless" operation, like this:

=> setenv once version

Then, when you update U-Boot (under Linux), also change the definition
of "once", equivalent to this:

=> setenv once "saveenv;setenv once version"

The next time U-Boot boots it will run this variable, will save the
environment and then reset the variable to the effective no-op
command.

Voila...

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: wd at denx.de
"I believe the use of noise to make music will increase until we
reach a music produced through the aid of electrical instruments
which will make available for musical purposes any and all sounds
that can be heard." - composer John Cage, 1937