我对yocto非常陌生,我正在努力学习如何使用它。我遵循了超级手册部分第5.1.9节中的步骤。我跑了
yocto-layer create mylayer
并编辑了我的bblayers.conf文件,使其具有以下内容:
BBLAYERS = ?" \
/usr/local/src/yocto/meta \
/usr/local/src/yocto/meta-poky \
/usr/local/src/yocto/meta-yocto-bsp \
/usr/local/src/yocto/meta-mylayer \
"我运行source oe-init-build-env,然后运行bitbake core-image-sato。当构建完成后,我运行runqemu qemu86 nographics,登录后运行find / -name helloworld,因为mylayer定义了构建helloworld的配方。但是,没有找到该文件。
这个程序(helloworld)不应该包含在创建的映像中吗?我错过了哪一步?
meta-mylayer/conf/layer.conf:
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "mylayer"
BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"
BBFILE_PRIORITY_mylayer = "6"meta-mylayer/recipies-example/example/example_0.1.bb
#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#
SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://helloworld.c"
S = "${WORKDIR}"
do_compile() {
${CC} ${LDFLAGS} helloworld.c -o helloworld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}meta-mylayer/recipes-example/example/example-0.1/helloworld.c:
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello World!\n");
return 0;
}发布于 2017-10-02 23:00:59
添加一个新的层并不会将图层中的每个菜谱添加到每个图像中,它只会使这些菜谱可供构建。
使用图像配方中的IMAGE_INSTALL在映像中添加所需的包。
这在http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#usingpoky-extend-customimage的文档中有介绍。
https://stackoverflow.com/questions/46532932
复制相似问题