sdkyoctobitbakeyocto-recipe

Yocto Add own Header and Lib file's to sdk


I want to add .h and .lib files to my own created recipe to the SDK. I use CMake to build my lib's, with the SDK I can build it. My recipe name is served. (I want to add the served https://github.com/meltwater/served as my own recipe). in my served_0.1.bb file I added the following:

BBCLASSEXTEND = "native nativesdk" 
RDEPENDS_${PN} += "nativesdk-served"

in the layer.conf I added:

TOOLCHAIN_TARGET_TASK_append = " served "

When I start to create my SDK with

bitbake core-image-base -c populate_sdk

ERROR: core-image-base-1.0-r0 do_populate_sdk: Could not invoke dnf. Command '/home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/sdk/image/opt/poky/3.2.4/sysroots/cortexa72-poky-linux/etc/dnf/dnf.conf --setopt=reposdir=/home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/sdk/image/opt/poky/3.2.4/sysroots/cortexa72-poky-linux/etc/yum.repos.d --installroot=/home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/sdk/image/opt/poky/3.2.4/sysroots/cortexa72-poky-linux --setopt=logdir=/home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/temp --repofrompath=oe-repo,/home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/oe-sdk-repo --nogpgcheck install packagegroup-base-extended packagegroup-core-boot packagegroup-core-standalone-sdk-target psplash-raspberrypi run-postinsts served target-sdk-provides-dummy' returned 1: DNF version: 4.2.23 cachedir: /home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/sdk/image/opt/poky/3.2.4/sysroots/cortexa72-poky-linux/var/cache/dnf Added oe-repo repo from /home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/oe-sdk-repo User-Agent: falling back to 'libdnf': could not detect OS or basearch repo: using cache for: oe-repo oe-repo: using metadata from Sun 06 Jun 2021 03:50:26 PM UTC. Last metadata expiration check: 0:00:01 ago on Sun 06 Jun 2021 03:50:26 PM UTC. --> Starting dependency resolution --> Finished dependency resolution Error: Problem: conflicting requests

  • nothing provides nativesdk-served needed by served-1.0+git0+2eb36b83fa-r0.cortexa72 (try to add '--skip-broken' to skip uninstallable packages)

ERROR: Logfile of failure stored in: /home/yocto/videoMon/build/tmp/work/raspberrypi4_64-poky-linux/core-image-base/1.0-r0/temp/log.do_populate_sdk.27092 ERROR: Task (/home/yocto/videoMon/meta/recipes-core/images/core-image-base.bb:do_populate_sdk) failed with exit code '1'

Have anyone has an an idea?

Bests


Solution

  • Assuming that you have a recipe for served which compiles without errors.

    The step to add served .h and lib files to sdk is to add below line to local.conf

    TOOLCHAIN_TARGET_TASK_append = " served "
    

    And then run command

    bitbake core-image-base -c populate_sdk
    

    The lines below in your served recipe are causing errors and are not needed for SDK generation. Please remove them and try building your image again.

    BBCLASSEXTEND = "native nativesdk" 
    RDEPENDS_${PN} += "nativesdk-served"