Change (and remove unused) init system on a per-image basis #yocto #bitbake #systemd #sysvinit


Hi all,

I would like to change the init system (systemd / SysVinit) on a per-image basis.
Therefore I added both "systemd" and "sysvinit" to my DISTRO_FEATURES.

I set this inside my to make sure that systemd is available as a distro feature:


Now I want to prevent the "unused" init system (in this case sysvinit) from being added to the rootfs.
Therefore I tried something like this inside my distro.conf:

DISTRO_FEATURES_BACKFILL_CONSIDERED = "${@bb.utils.contains('REQUIRED_DISTRO_FEATURES', 'systemd', 'sysvinit', '', d)}"

As expected, this leads into the following. So far so good:

$ bitbake image-systemd -e | grep DISTRO_FEATURES_BACKFILL_CONSIDERED=

But the final rootfs still contains sysvinit scripts (/etc/init.d/*)

Now the strange thing:
If I instead do this inside my distro.conf, /etc/init.d is not being created, exactly as I wanted:


So I don't really understand why this solution doesn't work.
Any help would be appreciated.

Thanks and Regards,

Join { to automatically receive all group messages.