简体   繁体   English

如何使用 packagegroup 将外部食谱集成到 yocto 图像中?

[英]How to integrate external recipes into yocto image using packagegroup?

I am using a yocto distribution from STM: https://wiki.st.com/stm32mpu-ecosystem-v1/wiki/STM32MP1_Distribution_Package我正在使用来自 STM 的 yocto 发行版: https://wiki.st.com/stm32mpu-ecosystem-v1/wiki/STM32MP1_Distribution_Package

The directory structure is as below目录结构如下

 openstlinux-20-02-19 OpenSTLinux distribution ├── layers │ ├── meta-openembedded Collection of layers for the OpenEmbedded-Core universe (OpenEmbedded standard) │ ├── meta-qt5 QT5 layer for OpenEmbedded (standard) │ ├── meta-st │ │ ├── meta-st-openstlinux STMicroelectronics layer that contains the frameworks and images settings for the OpenSTLinux distribution │ │ ├── meta-st-stm32mp STMicroelectronics layer that contains the description of the BSP for the STM32 MPU devices │ │ │ ├── recipes-bsp │ │ │ │ ├── alsa Recipes for ALSA control configuration │ │ │ │ ├── drivers Recipes for Vivante GCNANO GPU kernel drivers │ │ │ │ ├── trusted-firmware-a Recipes for TF-A │ │ │ │ └── u-boot Recipes for U-Boot │ │ │ ├── recipes-extended │ │ │ │ ├── linux-examples Recipes for Linux examples for STM32 MPU devices │ │ │ │ ├── m4coredump Recipes for script to manage coredump of cortexM4 │ │ │ │ └── m4projects Recipes for firmware examples for Cortex M4 │ │ │ ├── recipes-graphics │ │ │ │ ├── gcnano-userland Recipes for Vivante libraries OpenGL ES, OpenVG and EGL (multi backend) │ │ │ │ └── [...] │ │ │ ├── recipes-kernel │ │ │ │ ├── linux Recipes for Linux kernel │ │ │ │ └── linux-firmware Recipes for Linux firmwares (example, Bluetooth firmware) │ │ │ ├── recipes-security │ │ │ │ └── optee Recipes for OPTEE │ │ │ ├── recipes-st │ │ │ │ └── images Recipes for the bootfs and userfs partitions binaries │ │ │ └── [...] │ │ ├── meta-st-stm32mp-addons STMicroelectronics layer that helps managing the STM32CubeMX integration │ │ └── scripts │ │ ├── envsetup.sh Environment setup script for Distribution Package │ │ └── [...] │ ├── meta-timesys Timesys layer for OpenEmbedded (standard) │ └── openembedded-core Core metadata for current versions of OpenEmbedded (standard)

I have cloned a layer from openembeddedlayers and added it into bblayers layers file in the build directory... Now, what i would like to do is to make a packagegroup.bb file and add the recipes from that layers and all the other layers into that packagegroup file so that it get added into my image when i bitbake the image.我已经从 openembeddedlayers 克隆了一个图层并将其添加到构建目录中的 bblayers 图层文件中......现在,我想做的是制作一个 packagegroup.bb 文件并将该图层和所有其他图层的配方添加到该包组文件,以便在我对图像进行 bitbake 时将其添加到我的图像中。

My packagegroup file look like this我的包组文件看起来像这样

 SUMMARY = "packagegroup containing packages client"LICENSE = "MIT" inherit packagegroup RDEPENDS_${PN} = "\ nano \ tmux \ python3-pyserial \ python3-paho-mqtt \ python3-pymodbus \ sqlite3 \ python-pysqlite \ python3-sqlite3 \ "
Now, where should i put this file and also where should i add it in my project? 现在,我应该把这个文件放在哪里,我应该把它添加到我的项目中的哪里? i am quite new in yocto and not able to understand this. 我对 yocto 很陌生,无法理解这一点。

Packagegroups are just bitbake recipes for all intents and purposes.包组只是用于所有意图和目的的 bitbake 食谱。 Therefore, you can simply create a new directory relative to your image directory, and put it there.因此,您可以简单地创建一个相对于您的图像目录的新目录,并将其放在那里。 Historically, I've done this从历史上看,我做过这个

<path to>/recipes-images/images
<path to>/recipes-images/packagegroups

Then just put your packagegroup file in the packagegroups directory.然后只需将您的包组文件放在包组目录中。 As long as your layers and meta directory are configured correctly, they will be found.只要您的图层和元目录配置正确,它们就会被找到。

EDIT I should mention you can also just put a packagegroup file in the same directory as your images as well.编辑我应该提到你也可以将一个包组文件放在与你的图像相同的目录中。 If you only have one or two, this may make sense.如果你只有一两个,这可能是有道理的。

You don't have your own meta layer, which means you either skip packagegroups and add each recipe to your local.conf, or create your own meta layer.您没有自己的元层,这意味着您要么跳过包组并将每个配方添加到 local.conf,要么创建自己的元层。 The local.conf option would be much faster/easier. local.conf 选项会更快/更容易。

All the possible locations for recipes (or bbappend) are specified by the BBFILES variables found in conf/layer.conf of the layer you want your recipes in. See in meta-openembedded/meta-oe/conf/layer.conf[1]:配方(或 bbappend)的所有可能位置由您希望配方所在层的conf/layer.conf中的BBFILES变量指定。参见 meta-openembedded/meta-oe/conf/layer.conf[1] :

BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"

This means that any file ending by.bb or.bbappend in any subdirectory of any directory whose name is starting with recipes- will be found.这意味着在名称以recipes-开头的任何目录的任何子目录中以 .bb 或 .bbappend 结尾的任何文件都将被找到。

A way to find if your bb recipe or bbappend is found is to run bitbake-layers show-recipes or bitbake-layers show-appends .查找是否找到您的 bb recipe 或 bbappend 的一种方法是运行bitbake-layers show-recipesbitbake-layers show-appends

[1] http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/conf/layer.conf#n15 [1] http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/conf/layer.conf#n15

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM