Skip to content
Snippets Groups Projects
Commit f04d49d5 authored by Bob Mottram's avatar Bob Mottram
Browse files

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

parent 0a605635
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,9 @@ ONERNG_PACKAGE_DOWNLOAD="https://github.com/OneRNG/onerng.github.io/blob/master/
# Hash for OneRNG driver
ONERNG_PACKAGE_HASH='78f1c2f52ae573e3b398a695ece7ab9f41868252657ea269f0d5cf0bd4f2eb59'
 
# device name for OneRNG
ONERNG_DEVICE='ttyACM0'
# Whether this system is being installed within a docker container
INSTALLED_WITHIN_DOCKER="no"
 
......@@ -4793,6 +4796,12 @@ function install_onerng {
# install the 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
if [ ! -f /etc/onerng.conf ]; then
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 ' cp gpgit.pl /usr/bin' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'fi' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'exit 0' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
chmod +x /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'create_upgrade_script' >> $COMPLETION_FILE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment