Skip to content
Snippets Groups Projects
Commit de60b883 authored by Denis Pynkin's avatar Denis Pynkin Committed by Denis Pynkin
Browse files

mx6qsabrelite: add helper for read and reset boot counter


Each board may have it's own method and place to store the boot counter
related variables.
With `/etc/default/rollback_helper` file it is possible to
define board-specific functions allowing to read and correctly
reset variables.

This patch adds helper for boards using u-boot tools to access
U-Boot environment.

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
parent 11e8a640
No related branches found
No related tags found
No related merge requests found
......@@ -73,3 +73,21 @@ cat > $sysroot/etc/fw_env.config <<E_O_F
# MTD device name Device offset Env. size Flash sector size
$DEVICE $OFFSET $ENVSIZE $SECSIZE
E_O_F
cat > $sysroot/etc/default/rollback_helper <<"E_O_F"
# Helper for rollback script
# For U-Boot -- u-boot-tools must be configured in "/etc/fw_env.config"
# Return the value of requested variable.
# U-Boot bootcount mechanism is working only if "upgrade_available" is set.
get_variable(){
fw_printenv -n upgrade_available >/dev/null 2>&1 && \
fw_printenv -n "$1" 2>/dev/null || echo 0
}
# Reset the counter for U-Boot.
reset_counter(){
fw_setenv upgrade_available
fw_setenv bootcount
}
E_O_F
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment