diff mbox series

[v2] rng-tools: Replace obsolete "wants systemd-udev-settle"

Message ID 20220804150952.2831520-1-drew@moseleynet.net
State Accepted, archived
Commit d43e283d749ddd8fd6722411d051f0e505054c6f
Headers show
Series [v2] rng-tools: Replace obsolete "wants systemd-udev-settle" | expand

Commit Message

Drew Moseley Aug. 4, 2022, 3:09 p.m. UTC
From: Drew Moseley <drew@moseleynet.net>

The systemd-udev-settle service is listed as obsolete and does in
some cases result in a significant boot time.  Replace that with a
specific wait for the random source hardware device to be loaded.

Before this change:

   Startup finished in 4.025s (kernel) + 2min 13.236s (userspace) = 2min 17.262s
   multi-user.target reached after 2min 8.153s in userspace

After this change:

   Startup finished in 3.956s (kernel) + 13.294s (userspace) = 17.250s
   multi-user.target reached after 9.522s in userspace

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

Comments

Dragos-Marian Panait Aug. 12, 2022, 12:59 p.m. UTC | #1
It seems that this change introduced a boot delay for qemux86-64 + 
systemd build.

Steps:

git clone git://git.yoctoproject.org/poky
. poky/oe-init-build-env

add to conf/local.conf:

DISTRO_FEATURES:remove = " sysvinit"
DISTRO_FEATURES:append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = ""

bitbake core-image-full-cmdline

Cause of boot delay:
[ TIME ] Timed out waiting for device /dev/hwrng.
[DEPEND] Dependency failed for Hard…e RNG Entropy Gatherer Daemon.

Regards,
Dragos

On 04.08.2022 18:09, Drew Moseley wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
>
> From: Drew Moseley <drew@moseleynet.net>
>
> The systemd-udev-settle service is listed as obsolete and does in
> some cases result in a significant boot time.  Replace that with a
> specific wait for the random source hardware device to be loaded.
>
> Before this change:
>
>     Startup finished in 4.025s (kernel) + 2min 13.236s (userspace) = 2min 17.262s
>     multi-user.target reached after 2min 8.153s in userspace
>
> After this change:
>
>     Startup finished in 3.956s (kernel) + 13.294s (userspace) = 17.250s
>     multi-user.target reached after 9.522s in userspace
>
> Signed-off-by: Drew Moseley <drew@moseleynet.net>
> ---
>   meta/recipes-support/rng-tools/rng-tools/rngd.service | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service b/meta/recipes-support/rng-tools/rng-tools/rngd.service
> index 568686e80e..0f50890dcb 100644
> --- a/meta/recipes-support/rng-tools/rng-tools/rngd.service
> +++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service
> @@ -3,7 +3,8 @@ Description=Hardware RNG Entropy Gatherer Daemon
>   DefaultDependencies=no
>   After=systemd-udev-settle.service
>   Before=sysinit.target shutdown.target
> -Wants=systemd-udev-settle.service
> +Requires=dev-hwrng.device
> +After=dev-hwrng.device
>   Conflicts=shutdown.target
>
>   [Service]
> --
> 2.37.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#168859): https://lists.openembedded.org/g/openembedded-core/message/168859
> Mute This Topic: https://lists.openembedded.org/mt/92815243/6328324
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [dragos.panait@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Drew Moseley Aug. 12, 2022, 3:20 p.m. UTC | #2
Well dang. Any other suggestions on how to resolve the original issue 
without breaking others things?


Drew

On 8/12/22 8:59 AM, Dragos-Marian Panait wrote:
> It seems that this change introduced a boot delay for qemux86-64 + 
> systemd build.
>
> Steps:
>
> git clone git://git.yoctoproject.org/poky
> . poky/oe-init-build-env
>
> add to conf/local.conf:
>
> DISTRO_FEATURES:remove = " sysvinit"
> DISTRO_FEATURES:append = " systemd"
> VIRTUAL-RUNTIME_init_manager = "systemd"
> DISTRO_FEATURES_BACKFILL_CONSIDERED = ""
>
> bitbake core-image-full-cmdline
>
> Cause of boot delay:
> [ TIME ] Timed out waiting for device /dev/hwrng.
> [DEPEND] Dependency failed for Hard…e RNG Entropy Gatherer Daemon.
>
> Regards,
> Dragos
>
> On 04.08.2022 18:09, Drew Moseley wrote:
>> [Please note: This e-mail is from an EXTERNAL e-mail address]
>>
>> From: Drew Moseley <drew@moseleynet.net>
>>
>> The systemd-udev-settle service is listed as obsolete and does in
>> some cases result in a significant boot time.  Replace that with a
>> specific wait for the random source hardware device to be loaded.
>>
>> Before this change:
>>
>>     Startup finished in 4.025s (kernel) + 2min 13.236s (userspace) = 
>> 2min 17.262s
>>     multi-user.target reached after 2min 8.153s in userspace
>>
>> After this change:
>>
>>     Startup finished in 3.956s (kernel) + 13.294s (userspace) = 17.250s
>>     multi-user.target reached after 9.522s in userspace
>>
>> Signed-off-by: Drew Moseley <drew@moseleynet.net>
>> ---
>>   meta/recipes-support/rng-tools/rng-tools/rngd.service | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service 
>> b/meta/recipes-support/rng-tools/rng-tools/rngd.service
>> index 568686e80e..0f50890dcb 100644
>> --- a/meta/recipes-support/rng-tools/rng-tools/rngd.service
>> +++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service
>> @@ -3,7 +3,8 @@ Description=Hardware RNG Entropy Gatherer Daemon
>>   DefaultDependencies=no
>>   After=systemd-udev-settle.service
>>   Before=sysinit.target shutdown.target
>> -Wants=systemd-udev-settle.service
>> +Requires=dev-hwrng.device
>> +After=dev-hwrng.device
>>   Conflicts=shutdown.target
>>
>>   [Service]
>> -- 
>> 2.37.1
>>
>>
>> 
>>
diff mbox series

Patch

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