如何更改核心图像最小yocto中的init系统 [英] How to change the init system in core-image-minimal yocto
问题描述
我想基于 core-image-minimal
创建一个新目标,并且我想通过 SysV init
.我希望我的更改是永久的(不基于local.conf).我该怎么办?
I would like to create a new target based on core-image-minimal
and I would like to change the init system with systemd
over SysV init
. I would like my change to be permanent (nothing based on local.conf). How can I do this?
推荐答案
正如安德斯(Anders)在评论中指出的那样,我错了:
As Anders pointed out in the comments, i was wrong:
可用的初始化系统在local.conf中设置,但是您确实可以基于每个映像更改初始化系统.在您的情况下,您想在 core-image-minimal
中进行更改.该映像将安装 packagegroup-core-boot
,该设置会设置
The available init systems are set in the local.conf, but you can indeed change the init system on a per image basis. In your case you want to change it in core-image-minimal
. This image installs packagegroup-core-boot
which sets
VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
VIRTUAL-RUNTIME_initscripts ?= "initscripts"
您可以创建自己的 packagegroup-core-boot-systemd
,将这些变量设置为
You could create your own packagegroup-core-boot-systemd
where those variables are set to
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""
并将其安装到目标.
init系统的配置是发行功能.这意味着它不在图像配方中,而在local.conf中.
The configuration of the init system is a Distro Feature. That means it is not in the image recipe, but in the local.conf.
如果您不想将配置放入local.conf中,则可以使用其中的设置来创建自定义发行版配置.您只需在local.conf中更改的是该行
If you don't want to put the configuration in the local.conf, you could create a custom distro configuration with the settings in it. The only thing you have to change in the local.conf is the line
# DISTRO = poky
DISTRO = <custom-distro>
参考手册还在创建自己的发行版
The reference manual has also a chapter on creating your own distro
这篇关于如何更改核心图像最小yocto中的init系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!