bootcount_ext: Add flag to enable/disable bootcount
authorFrédéric Danis <frederic.danis@collabora.com>
Tue, 17 Mar 2020 16:59:09 +0000 (17:59 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 24 Apr 2020 14:10:00 +0000 (10:10 -0400)
commitdf928f8549ab4470b45bdf3ca2a1b45c9ffd4317
tree58fda0e7dd1d9591f2bd415aed652a9833bd526f
parent080019b86c997a9b7e13bc7b8f476fbf9a0e5f3c
bootcount_ext: Add flag to enable/disable bootcount

After a successful upgrade, multiple problem during boot sequence may
trigger the altbootcmd process.
This patch adds a version and an upgrade_available entries to the
bootcount file to enable/disable the bootcount check.
When failing to read the bootcount file it will consider that bootcount is
enabled, acting as previously, and update the file accordingly.

The bootcount file is only saved when `upgrade_available` is true, this
allows to save writes to the filesystem.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
doc/README.bootcount [new file with mode: 0644]
drivers/bootcount/bootcount_ext.c