Check that rng-tools is configured to use the onerng device

This commit is contained in:
Bob Mottram 2015-06-27 10:07:48 +01:00
parent 0a60563576
commit f04d49d5c5
1 changed files with 10 additions and 1 deletions

View File

@ -116,6 +116,9 @@ ONERNG_PACKAGE_DOWNLOAD="https://github.com/OneRNG/onerng.github.io/blob/master/
# Hash for OneRNG driver # Hash for OneRNG driver
ONERNG_PACKAGE_HASH='78f1c2f52ae573e3b398a695ece7ab9f41868252657ea269f0d5cf0bd4f2eb59' ONERNG_PACKAGE_HASH='78f1c2f52ae573e3b398a695ece7ab9f41868252657ea269f0d5cf0bd4f2eb59'
# device name for OneRNG
ONERNG_DEVICE='ttyACM0'
# Whether this system is being installed within a docker container # Whether this system is being installed within a docker container
INSTALLED_WITHIN_DOCKER="no" INSTALLED_WITHIN_DOCKER="no"
@ -4793,6 +4796,12 @@ function install_onerng {
# install the package # install the package
dpkg -i $ONERNG_PACKAGE dpkg -i $ONERNG_PACKAGE
# check rng-tools configuration
if ! grep -q "/dev/$ONERNG_DEVICE" /etc/default/rng-tools; then
echo "HRNGDEVICE=/dev/$ONERNG_DEVICE" >> /etc/default/rng-tools
systemctl restart rng-tools
fi
# Check that the install worked # Check that the install worked
if [ ! -f /etc/onerng.conf ]; then if [ ! -f /etc/onerng.conf ]; then
echo 'OneRNG configuration file not found. The package may not have installed successfully.' echo 'OneRNG configuration file not found. The package may not have installed successfully.'
@ -8819,7 +8828,7 @@ function create_upgrade_script {
echo ' git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME echo ' git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo ' cp gpgit.pl /usr/bin' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME echo ' cp gpgit.pl /usr/bin' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'fi' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME echo 'fi' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'exit 0' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME echo 'exit 0' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
chmod +x /etc/cron.weekly/$UPGRADE_SCRIPT_NAME chmod +x /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'create_upgrade_script' >> $COMPLETION_FILE echo 'create_upgrade_script' >> $COMPLETION_FILE