[U-Boot] [RFC] Bootcount improvements

Alexandre Dilly alexandre.dilly at openwide.fr
Tue Apr 2 15:17:07 CEST 2013


Hi,

> Dear Alexandre,
> 
> >
> > In fact I would like to keep the bootcount value after a shutdown
> > to handle update failures. Some embedded systems have only network
> > access for administration and if you install an updated system with
> > a
> > misconfiguration of the network interface, you can't access anymore
> > to the machine and you can't reset it. So the only way to reset the
> > device is to unplug and replug but bootcount value is reset... So
> > you
> > can't switch back to a safe system...
> 
> You can define your own mechanism to do something like that, but
> please do not misuse the bootcount for something it was never meant
> for.   The bootcount is defined to count the number of boots after
> power on; i. e. when you power on a board, the boot counter must by
> definition start with the value zero.
> 
> > > If you move the bootcount into a non-volatile memory, you add a
> > > history
> > > to the process and breaks this assumption.
> > 
> > That's why I suggest to use an environment variable (and may be a
> > configuration option) to enable/disable this features.
> 
> It should be easy and straightforward to implement such a feature by
> defining a new environment variable.  All this can be done using
> standard scripting, i. e. you do not need any code changes and thus
> no
> new config options.

Thanks a lot for your answers! I will investigate in depth scripting capabilities of u-boot. I hope I will success to make a generic script with existing utilities for the purpose I've described before.

Best regards,
Alexandre Dilly


More information about the U-Boot mailing list