summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2015-05-08 11:15:05 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2015-05-08 15:56:34 +0200
commit3166a0e6d501428527415a757eed3a84bd89d7aa (patch)
treebb8a22128abde6afb272bad0f09550cf280fd97a /scripts
parent214617d942515716e4683054b5dbf54291d5e077 (diff)
downloaddt-utils-3166a0e6d501428527415a757eed3a84bd89d7aa.tar.gz
dt-utils-3166a0e6d501428527415a757eed3a84bd89d7aa.tar.xz
barebox-mark-successful-boot: add example script
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/barebox-mark-successful-boot.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/barebox-mark-successful-boot.sh b/scripts/barebox-mark-successful-boot.sh
new file mode 100644
index 0000000..952512d
--- /dev/null
+++ b/scripts/barebox-mark-successful-boot.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+DEFAULT_REMAINING_ATTEMPTS=3
+DEFAULT_PRIORITY=20
+
+system=$(sed /proc/cmdline -ne "s/.*root=ubi0:\([^ ]*\).*/\1/p")
+if [ -z "${system}" ]; then
+ echo "unable to detect system partition" >&2
+ exit 1
+fi
+
+barebox-state -n /state \
+ -s "bootstate.${system}.remaining_attempts=${DEFAULT_REMAINING_ATTEMPTS}" \
+ -s "bootstate.${system}.priority=${DEFAULT_PRIORITY}"