瀏覽代碼

Don't install havege on VMs

Bob Mottram 7 年之前
父節點
當前提交
79dcd6ac15
共有 3 個文件被更改,包括 18 次插入5 次删除
  1. 5
    1
      src/freedombone-image-customise
  2. 5
    1
      src/freedombone-utils-rng
  3. 8
    3
      src/freedombone-utils-setup

+ 5
- 1
src/freedombone-image-customise 查看文件

@@ -1410,7 +1410,11 @@ rm $rootdir/usr/sbin/policy-rc.d
1410 1410
 # Set up HRNG for systems known to have one
1411 1411
 # Otherwise install haveged
1412 1412
 if [[ "$MACHINE" != "beaglebone"* ]]; then
1413
-    chroot $rootdir apt-get -yq install haveged
1413
+    # With some VMs, the hardware cycles counter is emulated and deterministic,
1414
+    # and thus predictible, so havege should not be used
1415
+    if [[ "$MACHINE" != "qemu"* ]]; then
1416
+        chroot $rootdir apt-get -yq install haveged
1417
+    fi
1414 1418
 else
1415 1419
     chroot $rootdir apt-get -yq install rng-tools
1416 1420
     sed -i 's|#HRNGDEVICE=/dev/hwrng|HRNGDEVICE=/dev/hwrng|g' $rootdir/etc/default/rng-tools

+ 5
- 1
src/freedombone-utils-rng 查看文件

@@ -157,7 +157,11 @@ function random_number_generator {
157 157
             install_onerng
158 158
             ;;
159 159
         *)
160
-            apt-get -yq install haveged
160
+            # With some VMs, the hardware cycles counter is emulated and deterministic,
161
+            # and thus predictible, so havege should not be used
162
+            if [[ "$ARCHITECTURE" != "qemu"* ]]; then
163
+                apt-get -yq install haveged
164
+            fi
161 165
             ;;
162 166
     esac
163 167
 

+ 8
- 3
src/freedombone-utils-setup 查看文件

@@ -230,9 +230,14 @@ function initial_setup {
230 230
     apt-get -yq install avahi-discover avahi-autoipd iptables dnsutils net-tools
231 231
     apt-get -yq install network-manager iputils-ping libnss-mdns libnss-myhostname
232 232
     apt-get -yq install libnss-gw-name nano man ntp locales locales-all debconf
233
-    apt-get -yq install wireless-tools wpasupplicant usbutils zsh
234
-    apt-get -yq install pinentry-curses eatmydata iotop bc hostapd haveged
235
-    apt-get -yq install cpulimit screen
233
+    apt-get -yq install wireless-tools wpasupplicant usbutils zsh cpulimit screen
234
+    apt-get -yq install pinentry-curses eatmydata iotop bc hostapd
235
+
236
+    # With some VMs, the hardware cycles counter is emulated and deterministic,
237
+    # and thus predictible, so havege should not be used
238
+    if [[ $ARCHITECTURE != 'qemu'* ]]; then
239
+        apt-get -yq install haveged
240
+    fi
236 241
 
237 242
     if [[ $ARCHITECTURE == 'qemu'* || $ARCHITECTURE == 'amd64' || $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'i686' || $ARCHITECTURE == 'i386' ]]; then
238 243
         apt-get -yq install grub2 lvm2 initramfs-tools