From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Tue, 14 Aug 2007 17:23:43 +0200 Subject: [U-Boot-Users] Using 'ver' env var In-Reply-To: Your message of "Tue, 14 Aug 2007 16:40:31 +0200." <1187102431.13869.7.camel@elrond.sweden.atmel.com> Message-ID: <20070814152343.3CE3F24041@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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