blob: 85eb3c1f3d22ece2e8df3d5b83113053db29bd4e [file] [log] [blame]
#!/bin/sh /etc/rc.common
START=98
STOP=1
USE_PROCD=1
OUTFILE="/root/jent_raw_noise_restart"
STATE="/root/jent_state"
TESTS=1000
DIR=$(dirname $OUTFILE)
start_service() {
if [ ! -d "$DIR" ]
then
mkdir -p $DIR
fi
if [ ! -f "$STATE" ]
then
echo 0 > $STATE
fi
testruns=$(cat $STATE)
echo $((testruns+1)) > $STATE
if [ $testruns -ge $TESTS ]; then
echo "end jitter test"
uname -a > /root/platform.txt &&
cat /proc/cpuinfo >> /root/platform.txt &&
echo "" >> /root/platform.txt &&
cat /proc/cpuinfo >> /root/platform.txt &&
echo "" >> /root/platform.txt &&
echo "lspci" >> /root/platform.txt &&
lspci -vvv >> /root/platform.txt
tar cvf /jent.tar /root/
exit 0
fi
testruns=$((testruns+1))
( ( /usr/bin/getrawentropy -f /sys/kernel/debug/jitterentropy/noise -s 1001 > $OUTFILE.$testruns.data ) )
sync
reboot -f
}
reload_service() {
echo 0 > $STATE
start_service
}