rng-tools: disable jitter entropy generation in VMs 98/28398/1
authorScott Murray <scott.murray@konsulko.com>
Mon, 16 Jan 2023 23:14:47 +0000 (18:14 -0500)
committerScott Murray <scott.murray@konsulko.com>
Thu, 19 Jan 2023 02:03:21 +0000 (21:03 -0500)
Add a bbappend for rng-tools that disables jitter entropy generation
for virtio-all machines, as it provides little value in virtual
machines that are dependent on the host entropy anyways, and slows
their booting very significantly.

Bug-AGL: SPEC-4618

Change-Id: I51d10f95d5936a4ad89389ed5e0e4e0c16abcac6
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
recipes-support/rng-tools/files/default [new file with mode: 0644]
recipes-support/rng-tools/rng-tools_%.bbappend [new file with mode: 0644]
recipes-support/rng-tools/rng-tools_agldemo.inc [new file with mode: 0644]

diff --git a/recipes-support/rng-tools/files/default b/recipes-support/rng-tools/files/default
new file mode 100644 (file)
index 0000000..6e2f2ca
--- /dev/null
@@ -0,0 +1 @@
+EXTRA_ARGS="-r /dev/hwrng -x jitter"
diff --git a/recipes-support/rng-tools/rng-tools_%.bbappend b/recipes-support/rng-tools/rng-tools_%.bbappend
new file mode 100644 (file)
index 0000000..8ec7f75
--- /dev/null
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agldemo', 'rng-tools_agldemo.inc', '', d)}
diff --git a/recipes-support/rng-tools/rng-tools_agldemo.inc b/recipes-support/rng-tools/rng-tools_agldemo.inc
new file mode 100644 (file)
index 0000000..283c8a4
--- /dev/null
@@ -0,0 +1,7 @@
+# Pick up modified default configuration for virtual machines
+# that disables jitter entropy source, as it is not useful when
+# the VMs are effectively driven by the host RNG via virtio-rng.
+# This also helps boot speed, as otherwise the guests have rngd
+# potentially somewhat pointlessly burning a lot of CPU on boot,
+# in addition to the host's own rngd.
+FILESEXTRAPATHS:prepend:virtio-all := "${THISDIR}/files:"