From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 27 Jul 2016 17:10:13 +0200 Subject: [U-Boot] a few questions about saving bootcount in the environment In-Reply-To: References: <20160725045721.1EB96100539@atlas.denx.de> <20160725135754.GN14698@bill-the-cat> <57964BB2.70702@denx.de> <57979D03.8010800@denx.de> Message-ID: <5798CED5.6080401@gmx.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Robert, Am 27.07.2016 um 14:03 schrieb Robert P. J. Day: > On Tue, 26 Jul 2016, Heiko Schocher wrote: > > ... snip ... > >>> it appears that, no matter what, the environment *is* updated >>> every single time because of this line in the bootdelay_process() >>> routine: >>> >>> setenv_ulong("bootcount", bootcount); >>> >>> why? it seems, from the above, that no matter what boot counter >> >> Yes, the bootcount variable gets set here ... but the environment >> gets not written... >> >>> mechanism you use, the environment will be updated because of that >>> line. >> >> The Environment gets written when saveenv() gets called ... or? > > ... snip ... > > yes, i already apologized to wolfgang for being so clueless, i > didn't see the difference between "setenv" and "saveenv". anyway, i'm > still writing a wiki page on this that i can use for future embedded > linux classes, so ... onward. no problem, I saw your response to wolfgang to late ... bye, Heiko -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany