Improve the OneRNG installation

This commit is contained in:
Bob Mottram 2015-07-07 13:28:41 +01:00
parent 2acb822170
commit 465e65350e
2 changed files with 14 additions and 7 deletions

View File

@ -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 {

View File

@ -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