如何在 bitbake 的图像中启用 PACKAGECONFIG 功能?

How to enable a PACKAGECONFIG feature in an image in bitbake?

假设,我们在菜谱中有一些功能,如 examples 中所示。假设这是写在meta-somelayer/recipes-functions/functions/functions_git.bb

PACKAGECONFIG ??= "f1 f2 f3 ..."
     PACKAGECONFIG[f1] = "\
                          --with-f1, \
                          --without-f1, \
                          build-deps-for-f1, \
                          runtime-deps-for-f1, \
                          runtime-recommends-for-f1, \
                          packageconfig-conflicts-for-f1 \
                          "
     PACKAGECONFIG[f2] = "\
                         ... and so on and so on ...
                

如何在我自己的图像图层中启用功能 f1。假设我有一层 meta-mylayer.

我尝试在 meta-mylayer/recipes-myrecipes/functions/functions_%.bbappend 中创建一个 .bbappend 文件并包含 PACKAGECONFIG_append = "f1",但我想这只是为现有的 PACKAGECONFIG 功能添加了更多功能。我如何 select 我层中另一层的配方中的特征?

您需要为该食谱创建一个 bbappend 并在那里进行。

对于要包含到特定图像的功能,请在该图像的 meta- 层中的特定层次结构中添加 .bbappend 文件。例如,我会在 meta-mylayer/recipes-myrecipes/functions/functions_%.bbappend 中添加一个 .bbappend 文件。然后,在 .bbappend 中,我将包括:

IMAGE_FEATURES += f1

包含 function 配方中的 f1 PACKAGECONFIG 功能。