Problems adding a layer in yocto - yocto

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;
}

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.

Related

Yocto build for samba recipe failed

Yocto build for samba recipe failed
I am trying to build this samba recipe file
Here
bitbake smbnetfs
Error :
smbnetfs_git.bb DEPENDS on or otherwise requires it) samba was
skipped: it has incompatible license(s): GPL-3.0+ LGPL-3.0+ ERROR:
Required build target 'smbnetfs' has no buildable providers. Missing
or unbuildable dependency chain was: ['smbnetfs', 'samba']
HOMEPAGE = "https://www.samba.org/"
SECTION = "console/network"
LICENSE = "GPL-3.0+ & LGPL-3.0+ & GPL-2.0+"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 "
SAMBA_MIRROR = "http://samba.org/samba/ftp"
MIRRORS += "\
${SAMBA_MIRROR} http://mirror.internode.on.net/pub/samba \n \
${SAMBA_MIRROR} http://www.mirrorservice.org/sites/ftp.samba.org \n \
"
SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
file://16-do-not-check-xsltproc-manpages.patch \
file://20-do-not-import-target-module-while-cross-compile.patch \
file://21-add-config-option-without-valgrind.patch \
file://0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch \
file://0006-avoid-using-colon-in-the-checking-msg.patch \
file://netdb_defines.patch \
file://glibc_only.patch \
file://iconv-4.7.0.patch \
file://dnsserver-4.7.0.patch \
file://smb_conf-4.7.0.patch \
file://volatiles.03_samba \
"
SRC_URI_append_libc-musl = " \
file://samba-pam.patch \
file://samba-4.3.9-remove-getpwent_r.patch \
"
SRC_URI[md5sum] = "0253021a45c479cec1e135b004a0177a"
SRC_URI[sha256sum] = "1eede30fc8ef6504e24602fb72b00baa0a7b73b59f16d25cb0771dc8c7c57d6e"
inherit systemd waf-samba cpan-base perlnative update-rc.d
# remove default added RDEPENDS on perl
RDEPENDS_${PN}_remove = "perl"
DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libbsd libaio libpam"
My finding: There problem in LICENSE and LIC_FILES_CHKSUM
Reason = common-licenses folder is not available in the meta-openembedded
Why folder is missing from the meta-openembedded. How to resolve it.
I have gone through almost all the site. I have tired the option to close the license as below
LICENSE = "CLOSED"
BB_STRICT_CHECKSUM = "0"
But still no luck.
I tired this suggestion as well here and here
Please suggestion

Yocto build fails due to conflict between recipes

I have two recipes, the first, adduser, is based on the useradd example in the meta-skeleton layer, and creates the directory /home/foo/, for the user foo:
SUMMARY = "Example recipe for using inherit useradd"
DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
SECTION = "examples"
PR = "r1"
LICENSE = "MIT"
S = "${WORKDIR}"
inherit useradd
# You must set USERADD_PACKAGES when you inherit useradd. This
# lists which output packages will include the user/group
# creation code.
USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "-d /home/foo -r -s /bin/bash -p 'bar' foo"
do_install () {
install -d -m 755 ${D}/usr/share/foo
install -d -m 755 ${D}/home/foo
chown -R foo ${D}/usr/share/foo
chown -R foo ${D}/home/foo
}
FILES_${PN} = "/usr/share/foo /home/foo"
# Prevents do_package failures with:
# debugsources.list: No such file or directory:
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
I then have a second recipe, which should add the directory "code" to the user's home directory, and put a file in it:
LICENSE = "CLOSED"
DEPENDS = "adduser"
FILES_${PN} += "/home/foo/code /home/foo/code/base_reading.py"
SRC_URI = "file://base_reading.py \
"
S = "${WORKDIR}"
do_install() {
install -d ${D}/home/foo/code
install -m 0755 ${S}/base_reading.py ${D}/home/foo/code/base_reading.py
chown -R foo ${D}/home/foo/code
}
This is the whole error: https://paste.ubuntu.com/p/6bfH4vf8qw but the TL;DR is:
Error: Transaction check error:
file /home/foo conflicts between attempted installs of basecode-1.0-r0.cortexa7hf_neon_vfpv4 and adduser-1.0-r1.cortexa7hf_neon_vfpv4
At first, I tried to fix this by adding the DEPENDS = "adduser", thinking that that would ensure that /home/foo exists before it tries to create /home/foo/code, but it didn't make any difference.

Root password Intel Edison

I'm trying to change the password for Intel-Edison board, using the Yocto project.
I have made a recipe for this.
#
# 'abc-' password
#
DESCRIPTION = "ROOT PASSWORD"
SECTION = "abc"
LICENSE = "MIT"
LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/MIT;md5=xyz"
PR = "r0"
SRC_URI = "file://test.txt"
PACKAGE_ARCH = "${MACHINE_ARCH}"
S = "${WORKDIR}"
inherit extrausers
EXTRA_USERS_PARAMS = "usermod -P hello root;"
do_install() {
install -d ${D}${sysconfdir}
install -m 0755 ${WORKDIR}/test.txt ${D}${sysconfdir}
}
To check if it works I added a file in my /etc/ location.
Everything is working perfectly , but my password remains 'root' . It should be 'hello'.
What I am doing wrong? Can someone tell me what should I do more?
Thank you.

how to add the binaries and other files to rootfs in yocto using .bb recipes

DESCRIPTION = "Copies hello-binaries to the image"
LICENSE = "CLOSED"
FILESEXTRAPATHS_prepend := "${THISDIR}:"
SRC_URI += "file://hello "
S = "${WORKDIR}"
do_install() {
install -d ${D}${bindir}
install -m 0777 hello ${D}${bindir}
}
#FILES_${PN} += "${bindir}"
INSANE_SKIP_${PN} = "ldflags"
INSANE_SKIP_${PN}-dev = "ldflags"
In the above recipe i commented the line FILES_ then also the hello binary is adding to the image how is it possible? I have no idea how the recipe is copying binaries to image.*
FILES_${PN} has a default value that includes among other things "${bindir}/*". So appending to the value in the recipe isn't needed.
You can see the default value in meta/conf/bitbake.conf and check what the value ends up as with bitbake -e <hellorecipe> | grep ^FILES_

Yocto:Could not inherit file classes/autotools-brokensep.bbclass

I am new to yocto project. I am getting the following error while running the bitbake command
$bitbake gemini-image
ERROR: ParseError at /home/zappy/Desktop/fyocto/meta-ivi/meta-ivi/recipes-extended/persistence-client-library/persistence-client-library_git.bb:18: Could not inherit file classes/autotools-brokensep.bbclass
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
my bblayers.conf file is
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "6"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
/home/zappy/Desktop/fyocto/poky/meta \
/home/zappy/Desktop/fyocto/poky/meta-yocto \
/home/zappy/Desktop/fyocto/poky/meta-yocto-bsp \
/home/zappy/Desktop/fyocto/meta-ivi/meta-ivi \
/home/zappy/Desktop/fyocto/meta-ti \
"
BBLAYERS_NON_REMOVABLE ?= " \
/home/zappy/Desktop/fyocto/poky/meta \
/home/zappy/Desktop/fyocto/poky/meta-yocto \
And my local.conf file is(edited lines only)
MACHINE?= ”pandaboard”
DISTRO ?= "poky-ivi-systemd"
INCOMPATIBLE_LICENSE = "GPLv3"
any one familiar with these types of errors??
please feel free to ask if any further details is needed to understand the problem
EDIT:
This is the persistence-client-library_git.bb file
SUMMARY = "GENIVI Persistence Client Library"
DESCRIPTION = "The Persistence Management is responsible to handle \
persistent data, including all data read and modified often during \
a lifetime of an infotainment system."
HOMEPAGE = "http://projects.genivi.org/persistence-client-library"
BUGTRACKER = "http://bugs.genivi.org/enter_bug.cgi?product=Persistence"
LICENSE = "MPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=6161c6840f21a000e9b52af81d2ca823"
DEPENDS = "dlt-daemon dbus libcheck persistence-common-object"
PV = "7.0+git${SRCPV}"
SRC_URI = "git://git.projects.genivi.org/persistence/persistence-client-library.git"
SRCREV = "441b3ce710ec6b7f1e6360cdf29e5c4243af9f1e"
S = "${WORKDIR}/git"
inherit pkgconfig autotools-brokensep
PARALLEL_MAKE = ""
FILES_${PN} = " \
${libdir}/*.so \
${libdir}/*.so.* \
${sysconfdir} \
"
do_install_append() {
install -d ${D}${sysconfdir}/dbus-1/system.d
install -m 0644 ${S}/config/org.genivi.persistence.admin.conf ${D}${sysconfdir}/dbus-1/system.d
}
RDEPENDS_${PN} = "node-state-manager"
Problem: It is not able to locate the autotools-brokensep.bbclass which is mentioned in your persistence-client-library_git.bb as inherit pkgconfig autotools-brokensep
Solution: Provide the path of the file in bblayers.conf where the file locates, and even check th layers.conf of which the file resides.