我有一个 C 文件二进制文件作为自定义层添加到 yocto 并在 qemu 中运行。我已经使用创建图层bitbake-layers create-layer meta-custLayer
并使用bitbake-layers add-layer meta-custLayer
. meta-custLayer 的文件树如下:
example_0.1.bb文件具有以下内容:
SUMMARY = "bitbake-layers recipe"
DESCRIPTION = "Recipe created by bitbake-layers"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://threading.c"
S = "${WORKDIR}"
TARGET_CC_ARCH += "${LDFLAGS}"
do_compile(){
$(CC) threading.c -o threads -lpthreads
}
do_install(){
install -d ${D}${bindir}
install -m 0755 threads
${D}${bindir}s
}
执行命令时bitbake example
,输出如下:
ERROR: example-0.1-r0 do_compile: Execution of '/home/sajil/edm_yocto/sources/poky/build/tmp/work/core2-64-poky-linux/example/0.1-r0/temp/run.do_compile.1806553' failed with exit code 127:
/home/sajil/edm_yocto/sources/poky/build/tmp/work/core2-64-poky-linux/example/0.1-r0/temp/run.do_compile.1806553: 99: CC: not found
/home/sajil/edm_yocto/sources/poky/build/tmp/work/core2-64-poky-linux/example/0.1-r0/temp/run.do_compile.1806553: 99: threading.c: not found
WARNING: exit code 127 from a shell command.
执行时bitbake core-image-minimal
,终端显示线程不可构建并遇到错误:
ERROR: Nothing RPROVIDES 'threads' (but /home/sajil/edm_yocto/sources/poky/meta/recipes-core/images/core-image-minimal.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'threads' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['threads']
ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'threads']
我检查了自定义层目录的路径,是正确的。我对我面临的错误一无所知。
现在我的任务是在 QEMU 上运行 C 文件(将其添加为层)。我无法为此构建图像。
我将不胜感激一些帮助和见解!