|
@@ -110,6 +110,12 @@ KERNEL_VERSION="v3.15.10-bone8"
|
110
|
110
|
# This can be empty, "beaglebone" or "onerng"
|
111
|
111
|
HWRNG_TYPE=
|
112
|
112
|
|
|
113
|
+# Download location for OneRNG driver
|
|
114
|
+ONERNG_PACKAGE="onerng_3.3-1_all.deb"
|
|
115
|
+ONERNG_PACKAGE_DOWNLOAD="https://github.com/OneRNG/onerng.github.io/blob/master/sw/$ONERNG_PACKAGE?raw=true"
|
|
116
|
+# Hash for OneRNG driver
|
|
117
|
+ONERNG_PACKAGE_HASH='a9801993ffef1cc19778f5613f1837aca4212a0d299d75bd524134f865774928'
|
|
118
|
+
|
113
|
119
|
# Whether this system is being installed within a docker container
|
114
|
120
|
INSTALLED_WITHIN_DOCKER="no"
|
115
|
121
|
|
|
@@ -4731,7 +4737,41 @@ function enable_zram {
|
4731
|
4737
|
}
|
4732
|
4738
|
|
4733
|
4739
|
function install_onerng {
|
4734
|
|
- # TODO
|
|
4740
|
+ apt-get -y install rng-tools at python-gnupg
|
|
4741
|
+
|
|
4742
|
+ # Move to the installation directory
|
|
4743
|
+ if [ ! -d $INSTALL_DIR ]; then
|
|
4744
|
+ mkdir $INSTALL_DIR
|
|
4745
|
+ fi
|
|
4746
|
+ cd $INSTALL_DIR
|
|
4747
|
+
|
|
4748
|
+ # Download the package
|
|
4749
|
+ if [ ! -f $ONERNG_PACKAGE ]; then
|
|
4750
|
+ wget $ONERNG_PACKAGE_DOWNLOAD
|
|
4751
|
+ fi
|
|
4752
|
+ if [ ! -f $ONERNG_PACKAGE ]; then
|
|
4753
|
+ echo "OneRNG package could not be downloaded"
|
|
4754
|
+ exit 59249
|
|
4755
|
+ fi
|
|
4756
|
+
|
|
4757
|
+ # Check the hash
|
|
4758
|
+ hash=$(sha256sum $ONERNG_PACKAGE)
|
|
4759
|
+ if [[ $hash != $ONERNG_PACKAGE_HASH ]]; then
|
|
4760
|
+ echo "OneRNG package: $ONERNG_PACKAGE"
|
|
4761
|
+ echo "Hash does not match. This could indicate that the package has been tampered with."
|
|
4762
|
+ echo "OneRNG expected package hash: $ONERNG_PACKAGE_HASH"
|
|
4763
|
+ echo "OneRNG actual hash: $hash"
|
|
4764
|
+ exit 25934
|
|
4765
|
+ fi
|
|
4766
|
+
|
|
4767
|
+ # install the package
|
|
4768
|
+ dpkg -i $ONERNG_PACKAGE
|
|
4769
|
+
|
|
4770
|
+ # Check that the install worked
|
|
4771
|
+ if [ ! -f /etc/onerng.conf ]; then
|
|
4772
|
+ echo 'OneRNG configuration file not found. The package may not have installed successfully.'
|
|
4773
|
+ exit 42904
|
|
4774
|
+ fi
|
4735
|
4775
|
}
|
4736
|
4776
|
|
4737
|
4777
|
function random_number_generator {
|