[U-Boot] a few questions about saving bootcount in the environment

Wolfgang Denk wd at denx.de
Mon Jul 25 20:37:41 CEST 2016


Dear Robert,

In message <alpine.LFD.2.20.1607251355090.3253 at localhost.localdomain> you wrote:
> 
>   i'm sure i'm asking the obvious, but if every boot to user space is
> successful, bootcount will have a value of zero each time, yes? so if
> user space code checks it and it's zero, then, you're done, no need to
> write.

As Heiko already explained, the update of the boot counter (= read
from env, increment, rewrite environment to persistent storage) is
done in U-Boot, and without "upgrade_available" it would happen on
each and every boot of the system.

The boot counter is implemented in U-Boot - only the resetting is done
in user space (and requires another write).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
Generally speaking, there are other ways to accomplish whatever it is
that you think you need ...                               - Doug Gwyn


More information about the U-Boot mailing list