Hi Claudius,

On 19.08.2022 12:36, Claudius Heine wrote:
[Please note: This e-mail is from an EXTERNAL e-mail address]

Hi Dew.

On 2022-08-15 20:25, drew.moseley@gmail.com wrote:
From: Drew Moseley <drew@moseleynet.net>

The previous change to remove the dependency on systemd-udev-settle
caused boot delays at least on qemu. It seems that change required
a hwrng device but that's not necessarily available on all platforms.

This changes the "Requires" to a "WantedBy" as modeled after the
version of this file on Ubuntu 20.04.

Signed-off-by: Drew Moseley <drew@moseleynet.net>
---
  meta/recipes-support/rng-tools/rng-tools/rng-tools.service | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/recipes-support/rng-tools/rng-tools/rng-tools.service b/meta/recipes-support/rng-tools/rng-tools/rng-tools.service
index 0f50890dcb..b013d95932 100644
--- a/meta/recipes-support/rng-tools/rng-tools/rng-tools.service
+++ b/meta/recipes-support/rng-tools/rng-tools/rng-tools.service
@@ -3,8 +3,6 @@ Description=Hardware RNG Entropy Gatherer Daemon
  DefaultDependencies=no
  After=systemd-udev-settle.service
  Before=sysinit.target shutdown.target
-Requires=dev-hwrng.device
-After=dev-hwrng.device
  Conflicts=shutdown.target

  [Service]
@@ -32,3 +30,4 @@ SystemCallFilter=@system-service

  [Install]
  WantedBy=sysinit.target
+WantedBy=dev-hwrng.device

This looses the order. Have you tried just replacing `Requires` with
`Wants`. So something like this:


```

Before=sysinit.target shutdown.target
Wants=dev-hwrng.device
After=dev-hwrng.device
Conflicts=shutdown.target

```

If that still would cause the long waiting time on qemu?

I haven't investigated the qemu issue, but maybe qemu just doesn't
provide a hardware random source? If it doesn't provide a hardware
random source, then installing rng-tools on there might also not make sense.
Alternatively maybe just adding a start timeout might solve it?
regards,
Claudius


I've tested the patch on a NUC7, results are the same as with qemu:
- increased boot time
- timeout for rng-tools.service
[ TIME ] Timed out waiting for device /dev/hwrng.
[DEPEND] Dependency failed for Hard…e RNG Entropy Gatherer Daemon.

Regards,
Dragos