Yocto 添加自己的 Header 和 Lib 文件到 sdk
Yocto Add own Header and Lib file's to sdk
我想将 .h 和 .lib 文件添加到自己创建的 sdk 配方中。
我使用 cmake 构建我的库,使用 sdk 我可以构建它。
我的食谱名称已送达。 (我想添加服务 https://github.com/meltwater/served 作为自己的食谱)。
在我的 served_0.1.bb 文件中添加以下内容:
BBCLASSEXTEND = "native nativesdk"
RDEPENDS_${PN} += "nativesdk-served"
在 layer.conf 我添加:
TOOLCHAIN_TARGET_TASK_append = " served "
当我开始使用
创建我的 sdk 时
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'
有人有想法吗?
最佳
假设您有一个 served
的配方,它编译没有错误。
将服务的 .h
和 lib
文件添加到 sdk 的步骤是将以下行添加到 local.conf
TOOLCHAIN_TARGET_TASK_append = " served "
然后运行命令
bitbake core-image-base -c populate_sdk
您提供的菜谱中的以下行会导致错误,SDK 生成不需要这些行。请删除它们并再次尝试构建您的映像。
BBCLASSEXTEND = "native nativesdk"
RDEPENDS_${PN} += "nativesdk-served"
我想将 .h 和 .lib 文件添加到自己创建的 sdk 配方中。 我使用 cmake 构建我的库,使用 sdk 我可以构建它。 我的食谱名称已送达。 (我想添加服务 https://github.com/meltwater/served 作为自己的食谱)。 在我的 served_0.1.bb 文件中添加以下内容:
BBCLASSEXTEND = "native nativesdk"
RDEPENDS_${PN} += "nativesdk-served"
在 layer.conf 我添加:
TOOLCHAIN_TARGET_TASK_append = " served "
当我开始使用
创建我的 sdk 时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'
有人有想法吗?
最佳
假设您有一个 served
的配方,它编译没有错误。
将服务的 .h
和 lib
文件添加到 sdk 的步骤是将以下行添加到 local.conf
TOOLCHAIN_TARGET_TASK_append = " served "
然后运行命令
bitbake core-image-base -c populate_sdk
您提供的菜谱中的以下行会导致错误,SDK 生成不需要这些行。请删除它们并再次尝试构建您的映像。
BBCLASSEXTEND = "native nativesdk"
RDEPENDS_${PN} += "nativesdk-served"