public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] Bootcount improvements
Date: Tue, 26 Mar 2013 18:10:17 +0100	[thread overview]
Message-ID: <20130326171017.426462014CD@gemini.denx.de> (raw)
In-Reply-To: <1822628084.945501.1364317027872.JavaMail.root@openwide.fr>

Dear Alexandre,

In message <1822628084.945501.1364317027872.JavaMail.root@openwide.fr> you wrote:
>
> 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.

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
There is wisdom in turning as often as possible from the familiar  to
the  unfamiliar: it keeps the mind nimble, it kills prejudice, and it
fosters humor.                                     - George Santayana

  reply	other threads:[~2013-03-26 17:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2055038254.798610.1363956733033.JavaMail.root@openwide.fr>
2013-03-22 12:56 ` [U-Boot] [RFC] Bootcount improvements Alexandre Dilly
2013-03-22 16:25   ` Otavio Salvador
2013-03-23  9:49   ` Stefano Babic
2013-03-26 16:57     ` Alexandre Dilly
2013-03-26 17:10       ` Wolfgang Denk [this message]
2013-04-02 13:17         ` Alexandre Dilly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130326171017.426462014CD@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox