简体   繁体   中英

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

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.

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.

Packagegroups are just bitbake recipes for all intents and purposes. 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. The local.conf option would be much faster/easier.

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]:

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.

A way to find if your bb recipe or bbappend is found is to run bitbake-layers show-recipes or bitbake-layers show-appends .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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