From 465e65350eb1b2a0ccc5d35ab45c06f017a28ec5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Jul 2015 13:28:41 +0100 Subject: [PATCH] Improve the OneRNG installation --- src/freedombone | 16 ++++++++++------ src/freedombone-config | 5 ++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/freedombone b/src/freedombone index f05174a0..daa8d5ce 100755 --- a/src/freedombone +++ b/src/freedombone @@ -4980,17 +4980,21 @@ 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.' exit 42904 fi + + dialog --title "OneRNG Device" \ + --msgbox "Please plug in the OneRNG device" 6 40 + + # check rng-tools configuration + if ! grep -q "/dev/$ONERNG_DEVICE" /etc/default/rng-tools; then + echo "HRNGDEVICE=/dev/$ONERNG_DEVICE" >> /etc/default/rng-tools + fi + + systemctl restart rng-tools } function random_number_generator { diff --git a/src/freedombone-config b/src/freedombone-config index cddf7ca5..f9dc4d7f 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -590,7 +590,10 @@ function interactive_configuration { esac case $(cat $data) in 2) HWRNG_TYPE="beaglebone";; - 3) HWRNG_TYPE="onerng";; + 3) HWRNG_TYPE="onerng" + dialog --title "OneRNG Device" \ + --msgbox "Please ensure that the OneRNG device is disconnected. You can reconnect it later during the installation" 8 60 + ;; 255) exit 1;; esac save_configuration_file