Commit a0c49c77 authored by Bartlomiej Grzeskowiak's avatar Bartlomiej Grzeskowiak Committed by Sukru Senli

Feature #2675 Reset boot counter after successfull boot

parent 4d27db85
#!/bin/sh /etc/rc.common
. /lib/ramips.sh
START=99
start() {
. /lib/functions.sh
local board=$(ramips_board_name)
case $(board_name) in
alfa-network,ac1200rm|\
alfa-network,awusfree1|\
alfa-network,quad-e4g|\
alfa-network,r36m-e4g|\
alfa-network,tube-e4g)
[ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\
echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s -
;;
sk-wb8)
fw_setenv bootcount 0
;;
esac
ub_vol=$(fw_printenv -n root_vol)
cur_vol=$(for opt in $(cat /proc/cmdline) ;do case $opt in root=*) echo $opt ;;esac ;done | cut -f 2 -d:)
if [ "$ub_vol" == "$cur_vol" ]
then
fw_setenv boot_cnt_primary 0
else
fw_setenv boot_cnt_alt 0
fi
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment