Reputation: 2158
I am very new to yocto and am trying to learn how to use it. I followed the steps in the mega-manual section section 5.1.9. I ran
yocto-layer create mylayer
and edited my bblayers.conf file to have this:
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 \
"
I ran source oe-init-build-env
and then bitbake core-image-sato
. When the build finished, I ran runqemu qemu86 nographics
and after logging in, ran find / -name helloworld
since mylayer defines a recipe for building helloworld. However, the file was not found.
Shouldn't this program (helloworld) be included in the image created? What step(s) am I missing here?
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;
}
Upvotes: 2
Views: 5032
Reputation: 4063
Adding a new layer doesn't add every recipe in the layer to every image, it just makes those recipes available to build.
Add the packages that you want in the image using IMAGE_INSTALL in the image recipe.
This is covered in the documentation at http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#usingpoky-extend-customimage.
Upvotes: 2