Eskimoalva
Eskimoalva

Reputation: 529

How disable the RNGD service from Yocto?

Background: I am running Yocto Zeus, and Linux Kernel 4.14 using SystemD. My target is an embedded i.MX6.

I have been attempting to disable the RNGD service at startup. It consumes all the cores for many seconds after bootup, and when I manually disable (via systemctl disable rngd it is actually disabled and there are no ill-effects (our software doesn't use /dev/random).

I have looked through Disable a standard systemd service in Yocto build and have tried both the package remove and deleting the link, and neither seem to work. Here are the contents of my systemd_%.bbappend file in my layer.

# To remove the package completely, add it to this space separated list.
# Not all services can be removed.
PACKAGECONFIG_remove = "timesyncd kmod rngd"

do_install_append() {
    rmdir ${D}${sysconfdir}/systemd/network
    ln -sfn /var/local/etc/systemd/network ${D}${sysconfdir}/systemd/network

    rm -f ${D}${sysconfdir}/systemd/system/multi-user.target.wants/rngd.service
}

Is there a way to delete this service? Even with both of those, I still see rngd running at boot. I am reasonably confident my changes are being included, I can see them if I run bitbake -e systemd | grep rngd:

gen-ccm-root@ubuntu:~/workdir/tools/poky/build-dev$ bitbake -e systemd | grep rngd
#     "timesyncd kmod rngd"
    rm -f /home/gen-ccm-root/workdir/tools/poky/build-dev/tmp/work/armv7at2hf-neon-poky-linux-gnueabi/systemd/1_243+AUTOINC+efb536d0cb-r0/image/etc/systemd/system/multi-user.target.wants/rngd.service

I have also confirmed that the other things in that file are actually taking effect. The network link is being properly made and I have confirmed that the timesyncd service is removed. I have confirmed that the file I am removing is the link that systemctl disable would remove:

~# systemctl disable rngd
Removed /etc/systemd/system/multi-user.target.wants/rngd.service.

Upvotes: 2

Views: 2912

Answers (3)

caco666
caco666

Reputation: 1

I am using a Variscite's iMX6 SOM with sysvinit.

The IMAGE_INSTALL_ remove option mentioned didn't work for me, as well as it didn't help removing rng-tools from MACHINE_EXTRA_RDEPENDS.

I ended up removing the 'recommendation' made by OpenSSH package by doing:

BAD_RECOMMENDATIONS = "rng-tools rng-tools-dev"

Upvotes: 0

PierreOlivier
PierreOlivier

Reputation: 1556

On Poky (Warrior branch) I have a bbappend to disable rng. The filename is rng-tools_%.bbappend and contains:

SYSTEMD_AUTO_ENABLE_rng-tools = "disable"

Upvotes: 1

Jussi Kukkonen
Jussi Kukkonen

Reputation: 14617

I don't think rngd is provided by systemd? Try removing the rng-tools package from your image instead.

I would start by ensuring that rng-tools actually is in the image currently -- you could check the image manifest file to do that. To remove rng-tools you can modify the actual image recipe so that it does not add rng-tools in the first place or you could try e.g. IMAGE_INSTALL_remove = " rng-tools" in your user configuration.

Upvotes: 0

Related Questions