Skip to main content
Visitor II
March 10, 2022
Solved

How to use sysvinit in Yocto

  • March 10, 2022
  • 2 replies
  • 5514 views

I want to use sysinitv instead of systemd . When I add DISTRO_FEATURES_remove = "systemd" in Distro conf ,bitbake stopped whit ERROR: /home/st/openstlinux-5.10-dunfell-mp1-21-11-17/layers/meta-openembedded/meta-initramfs/recipes-core/packagegroups/packagegroup-meta-initramfs.bb: Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (systemd) matches the entries enabled in DISTRO_FEATURES

ERROR: Failed to parse recipe: /home/st/openstlinux-5.10-dunfell-mp1-21-11-17/layers/meta-openembedded/meta-initramfs/recipes-core/packagegroups/packagegroup-meta-initramfs.bb

    This topic has been closed for replies.
    Best answer by Erwan SZYMANSKI

    Hello @Yby.1​ 

    Please, from your main source folder, go to: layers/openembedded-core/meta/conf/distro/

    In this folder you will find a file named defaultsetup.conf.

    This file contains the following line :

    INIT_MANAGER ??= "none"

    What happens here is that, if you do not define another thing instead of none, Yocto will take systemd as Init Manager by default. However you can replace this "none" by "sysvinit".

    If you do that, Yocto will include variables presents in ./include/init-manager-sysvinit.inc

    content :

    # Use sysvinit for system initialization

    DISTRO_FEATURES_append = " sysvinit"

    DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " systemd"

    VIRTUAL-RUNTIME_init_manager ??= "sysvinit"

    VIRTUAL-RUNTIME_initscripts ??= "initscripts"

    VIRTUAL-RUNTIME_login_manager ??= "busybox"

    Of course you can define these variables in you local.conf file to compile with Bitbake if you prefer. This is just another way to do it.

    Hope this information will help you.

    Regards.

    Erwan.

    2 replies

    Technical Moderator
    March 15, 2022

    Hello @Yby.1​ 

    Please, from your main source folder, go to: layers/openembedded-core/meta/conf/distro/

    In this folder you will find a file named defaultsetup.conf.

    This file contains the following line :

    INIT_MANAGER ??= "none"

    What happens here is that, if you do not define another thing instead of none, Yocto will take systemd as Init Manager by default. However you can replace this "none" by "sysvinit".

    If you do that, Yocto will include variables presents in ./include/init-manager-sysvinit.inc

    content :

    # Use sysvinit for system initialization

    DISTRO_FEATURES_append = " sysvinit"

    DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " systemd"

    VIRTUAL-RUNTIME_init_manager ??= "sysvinit"

    VIRTUAL-RUNTIME_initscripts ??= "initscripts"

    VIRTUAL-RUNTIME_login_manager ??= "busybox"

    Of course you can define these variables in you local.conf file to compile with Bitbake if you prefer. This is just another way to do it.

    Hope this information will help you.

    Regards.

    Erwan.

    Visitor II
    March 1, 2023

    Awesome!