blob: 013228838b4115dd13bb273aade87f689fae7345 [file] [log] [blame]
#!/bin/sh
#
# Start read all files
#
clear_failure_count_bcm74 () {
local REG_FAILURE_COUNT="0x104083FC"
devmem $REG_FAILURE_COUNT 32 0
}
clear_failure_count_bcm7252 () {
local REG_FAILURE_COUNT="0xf04105fc"
devmem $REG_FAILURE_COUNT 32 0
}
clear_failure_count_arl () {
echo 0 >/proc/antirebootloop
}
clear_failure_count () {
grep -q 'system type.*BCM74' /proc/cpuinfo && clear_failure_count_bcm74
local platform=$(cat /etc/platform)
[ "$platform" = GFHD254 ] && clear_failure_count_bcm7252
[ -f /proc/antirebootloop ] && clear_failure_count_arl
}
case "$1" in
start)
(
if is-fiberjack; then
nice -n 19 readallfiles -q /fiber/config && clear_failure_count
else
nice -n 19 readallfiles -q / && clear_failure_count
fi
) 2>&1 | logos readall &
;;
stop)
pkillwait -x readallfiles
;;
restart|reload)
$0 stop; $0 start
;;
*)
echo "Usage: $0 {start|stop|restart}" >&2
exit 1
esac