Ver código fonte

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

Bob Mottram 10 anos atrás
pai
commit
f04d49d5c5
1 arquivos alterados com 10 adições e 1 exclusões
  1. 10
    1
      src/freedombone

+ 10
- 1
src/freedombone Ver arquivo

116
 # Hash for OneRNG driver
116
 # Hash for OneRNG driver
117
 ONERNG_PACKAGE_HASH='78f1c2f52ae573e3b398a695ece7ab9f41868252657ea269f0d5cf0bd4f2eb59'
117
 ONERNG_PACKAGE_HASH='78f1c2f52ae573e3b398a695ece7ab9f41868252657ea269f0d5cf0bd4f2eb59'
118
 
118
 
119
+# device name for OneRNG
120
+ONERNG_DEVICE='ttyACM0'
121
+
119
 # Whether this system is being installed within a docker container
122
 # Whether this system is being installed within a docker container
120
 INSTALLED_WITHIN_DOCKER="no"
123
 INSTALLED_WITHIN_DOCKER="no"
121
 
124
 
4793
   # install the package
4796
   # install the package
4794
   dpkg -i $ONERNG_PACKAGE
4797
   dpkg -i $ONERNG_PACKAGE
4795
 
4798
 
4799
+  # check rng-tools configuration
4800
+  if ! grep -q "/dev/$ONERNG_DEVICE" /etc/default/rng-tools; then
4801
+      echo "HRNGDEVICE=/dev/$ONERNG_DEVICE" >> /etc/default/rng-tools
4802
+      systemctl restart rng-tools
4803
+  fi
4804
+
4796
   # Check that the install worked
4805
   # Check that the install worked
4797
   if [ ! -f /etc/onerng.conf ]; then
4806
   if [ ! -f /etc/onerng.conf ]; then
4798
       echo 'OneRNG configuration file not found. The package may not have installed successfully.'
4807
       echo 'OneRNG configuration file not found. The package may not have installed successfully.'
8819
   echo '    git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8828
   echo '    git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8820
   echo '    cp gpgit.pl /usr/bin' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8829
   echo '    cp gpgit.pl /usr/bin' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8821
   echo 'fi' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8830
   echo 'fi' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8822
-  
8831
+
8823
   echo 'exit 0' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8832
   echo 'exit 0' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8824
   chmod +x /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8833
   chmod +x /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
8825
   echo 'create_upgrade_script' >> $COMPLETION_FILE
8834
   echo 'create_upgrade_script' >> $COMPLETION_FILE