IMAGE_FEATURES 与 Yocto 中的 IMAGE_INSTALL

IMAGE_FEATURES vs IMAGE_INSTALL in Yocto

Yocto 中 IMAGE_INSTALL 和 IMAGE_FEATURES 有什么区别。

我已经看到在 Yocto 中启用闪屏。我们需要将以下内容写入 local.conf

IMAGE_FEATURES += "splash"

为什么我不能在这里使用 IMAGE_INSTALL

IMAGE_INSTALL += "splash"

谁能告诉我什么时候应该使用 IMAGE_FEATURES 和 IMAGE_INSTALL?

您可以将 IMAGE_FEATURES(和 EXTRA_IMAGE_FEATURES)视为包含“开关”列表的变量(功能,从预定义的 feature list,这取决于目标图像的基础 class)告诉构建系统自动附加一组给定的包,and/or 不同的包配置,到 IMAGE_INSTALL多变的。食谱可以检查(并附加)此变量中的特定功能,以便相应地更改其默认 configuration/build 过程。

因此,通过将“splash”添加到 IMAGE_FEATURES,您是在告诉构建系统添加“psplash " 包(默认情况下,您可以通过修改SPLASH变量来选择其他包来提供此功能)通过poky/meta/classes/image.bbclass中的FEATURE_PACKAGES_splash = ${SPLASH}声明为IMAGE_INSTALL

但是,您可以直接将“psplash”添加到IMAGE_INSTALL,但很有可能一些与“splash" 功能将被错误配置,因为他们不会注意到它(也许,在这种情况下这不是什么大问题......但它肯定会导致其他问题)。这就是为什么你不能(不应该)简单地添加“splash”到IMAGE_INSTALL(除了有没有名为“splash”的包; IMAGE_INSTALL 变量只保留要安装在目标映像中的软件包列表。

有关详细信息,请参阅 manual

IMAGE_FEATURES 用于为您的映像启用特殊功能,例如 root 的空密码、调试映像、特殊包、x11、splash、ssh-server...

您可以找到说明和功能列表 here

对于 splash 示例,此功能添加配方 psplash

splash: Enables showing a splash screen during boot. By default, this screen is provided by psplash, which does allow customization. If you prefer to use an alternative splash screen package, you can do so by setting the SPLASH variable to a different package name (or names) within the image recipe or at the distro configuration level.