Newer
Older
dt-utils / scripts / barebox-mark-successful-boot.sh
@Marc Kleine-Budde Marc Kleine-Budde on 8 May 2015 370 bytes barebox-mark-successful-boot: add example script
#!/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}"