blob: 87b97e058b2e6089827226595436d5a620a8e5ea [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)
(
nice -n 19 readallfiles -q / &&
clear_failure_count
) 2>&1 | logos readall &
;;
stop)
pkillwait -x readallfiles
;;
restart|reload)
$0 stop; $0 start
;;
*)
echo "Usage: $0 {start|stop|restart}" >&2
exit 1
esac