I am trying to compile this GitHub project I found and add the resulting shared library to my SDK.
The project uses CMake. My recipe can download, and build this project. The resulting binary files work as expected, the given .so files contain what I need. When trying to add the .so files to my image I get the errors
ERROR: dbcppp-1.0+gitrAUTOINC+917c925638-r0 do_package_qa: QA Issue: -dev package dbcppp-dev contains non-symlink .so '/usr/lib/libdbcppp.so'
-dev package dbcppp-dev contains non-symlink .so '/usr/lib/libxmlmm.so' [dev-elf]
ERROR: dbcppp-1.0+gitrAUTOINC+917c925638-r0 do_package_qa: QA Issue: dbcppp rdepends on dbcppp-dev [dev-deps]
ERROR: dbcppp-1.0+gitrAUTOINC+917c925638-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: Logfile of failure stored in: /home/michael/Documents/MAIN_Application/build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/dbcppp/1.0+gitrAUTOINC+917c925638-r0/temp/log.do_package_qa.10943
ERROR: Task (/home/michael/Documents/MAIN_Application/MAIN_layers/meta-MAINapplication/recipes-core/dbcppp/dbcppp_0.0.bb:do_package_qa) failed with exit code '1'
My recipe is as follows:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "gitsm://github.com/xR3b0rn/dbcppp.git;protocol=https;branch=master"
PV = "1.0+gitr${SRCPV}"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"
inherit pkgconfig cmake
INSANE_SKIP:${PN} = "ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so"
FILES_SOLIBSDEV = ""
do_install() {
install -d ${D}${bindir}
install -m 0755 ${B}/bin/dbcppp ${D}${bindir}
install -d ${D}${libdir}
install -m 0755 ${B}/src/libdbcppp/libdbcppp.so ${D}${libdir}
install -m 0755 ${B}/libxmlmm.so ${D}${libdir}
install -m 0755 ${B}/third-party/libxml2/libxml2.so.2.9.10 ${D}${libdir}
}
FILES_${PN} += "${libdir}/*"
FILES_${PN}-dev = "${libdir}/* ${includedir}"
I have been searching for a while but I cannot find a solution. What do I need to do for this to work?
Edit 1: I updated my bb file to the following. This works but it does not place the necessary header files into my SDK.
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "gitsm://github.com/xR3b0rn/dbcppp.git;protocol=https;branch=master"
PV = "1.0+gitr${SRCPV}"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"
inherit cmake
INSANE_SKIP:${PN} = "ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so"
FILES_SOLIBSDEV = ""
do_install() {
install -d ${D}${bindir}
install -m 0755 ${B}/bin/dbcppp ${D}${bindir}
install -d ${D}${libdir}
install -m 0755 ${B}/src/libdbcppp/libdbcppp.so ${D}${libdir}
install -m 0755 ${B}/libxmlmm.so ${D}${libdir}
install -m 0755 ${B}/third-party/libxml2/libxml2.so ${D}${libdir}
}
FILES_${PN} += "${libdir}/*.so"
FILES_${PN}-dev = "${includedir}"
The dbcppp Cmake file already has an install target that installs everything automatically, so you do not need do_install.
Try the following recipe:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "gitsm://github.com/xR3b0rn/dbcppp.git;protocol=https;branch=master"
PV = "1.0+gitr${SRCPV}"
SRCREV = "${AUTOREV}"
S = "${WORKDIR}/git"
inherit cmake
FILES_${PN} += "/usr/lib/xml2Conf.sh /usr/lib/lib*.so.*"
SOLIBS = ".so"
FILES_SOLIBSDEV = ""
INSANE_SKIP_${PN} += "dev-so"
The non-versioned shared libraries .so topic is difficult in Yocto, that's why skipping the QA shared library issue is the way to go here if you have no control on the source project's files/libraries.
The above recipe splits into multiple packages:
dbcppp (If you want just the dbcppp binary (.so files are shipped for the binary to run)
dbcppp-dev (If you want the header files and the shared libraries)
dbcppp-doc (If you want the man and html pages)
Related
I tried to build my custom recipe for the project which contains programs for sensors. All the task and library making is taken care of by CMakeLists.txt it also has python dependencies. I added all the required dependencies within my recipe and tried to build it using the "bitbake soofierecp" command execution got successful. Whereas while attempting to install it with the local.conf using "IMAGE_INSTALL += soofierecp" it is giving an error as listed below:
Error is:
ERROR: soofie-img-1.0-r0 do_rootfs: Could not invoke dnf. Command '/home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/rootfs/etc/yum.repos.d --installroot=/home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/rootfs --setopt=logdir=/home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/temp --repofrompath=oe-repo,/home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/oe-rootfs-repo --nogpgcheck install i2c-tools packagegroup-base-extended packagegroup-core-boot packagegroup-core-ssh-dropbear psplash python3 python3-dev python3-pip python3-requests run-postinsts soofierecp usbutils locale-base-en-us locale-base-en-gb' returned 1:
DNF version: 4.12.0
cachedir: /home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/oe-rootfs-repo
User-Agent: falling back to 'libdnf': could not detect OS or basearch
repo: using cache for: oe-repo
oe-repo: using metadata from Thu 26 May 2022 05:31:19 AM UTC.
Last metadata expiration check: 0:00:01 ago on Thu 26 May 2022 05:31:20 AM UTC.
No match for argument: soofierecp
Error: Unable to find a match: soofierecp
ERROR: Logfile of failure stored in: /home/anvation/nitish/source/build/tmp/work/qemux86_64-poky-linux/soofie-img/1.0-r0/temp/log.do_rootfs.1379711
ERROR: Task (/home/anvation/nitish/workspace/meta-soofie/recipes-example/images/soofie-img.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4873 tasks of which 4872 didn't need to be rerun and 1 failed. "added the meta-layer in bblayer.conf file"
Recipe is:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
S = "${WORKDIR}"
PR = "r0"
DEPENDS = "openssl python3-six-native python3-pytest-runner-native"
SRC_URI = "\
file://src/ \
file://third_party/pybind11/ \
file://third_party/CLI11/ \
file://third_party/c-periphery/ \
file://CMakeLists.txt \
"
do_configure() {
cmake ../
}
RDEPENDS_${PN} = "python-requests python-six"
inherit pkgconfig cmake python3native
EXTRA_OEMAKE = ""
ALLOW_EMPTY_${PN}="1"
FILES_${PN} = "${bindir}/*"
DEPENDS += "udev"
Please help me to reach for the solution
I really appreciate any help you can provide.
I got the above code working with the suggestion and help
Thank you so much
The updated recipe is:
'
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
S = "${WORKDIR}"
PR = "r0"
SRC_URI = "\
file://src/ \
file://third_party/pybind11/ \
file://third_party/CLI11/ \
file://third_party/c-periphery/ \
file://CMakeLists.txt \
"
inherit cmake pkgconfig python3native
DEPENDS += "openssl python3-six-native python3-pytest-runner-native"
EXTRA_OECMAKE = ""
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/build/datagen ${D}${bindir}
}
DEPENDS += "udev"
FILES_${PN} += "${D}${bindir}/"
ALLOW_EMPTY_${PN} = "1"
'
Description
I want to install a service into my image, but it is failing with following errors
ERROR: mypackage-git-r0 do_package: Didn't find service unit 'mypackage.service', specified in SYSTEMD_SERVICE_mypackage.
ERROR: Logfile of failure stored in: <build-location>/poky/build/tmp/work/cortexa53-poky-linux/mypackage/git-r0/temp/log.do_package.7924
ERROR: Task (<layer-location>/meta-mypackage-oe/recipes-mypackage/mypackage/mypackage_git.bb:do_package) failed with exit code '1'
Recipe
Python sources are cloned from git, now I want to create a service to run at boot. Here is the recipe
SUMMARY = " "
DESCRIPTION = " "
HOMEPAGE = " todo "
LICENSE = "CLOSED"
SRC_URI += "<URL>"
SRC_URI += "file://mypackage.service"
SRCREV = "<srcrev>"
S = "${WORKDIR}/git"
inherit setuptools3 systemd
RDEPENDS_${PN} = " \
${PYTHON_PN}-pyserial \
${PYTHON_PN}-pyusb \
${PYTHON_PN}-terminal \
"
SYSTEMD_PACKAGES = "${PN}"
do_install_append () {
install -d ${D}${system_unitdir}
install -m 0755 ${WORKDIR}/mypackage.service ${D}{system_unitdir}
}
SYSTEMD_SERVICE_${PN} = "mypackage.service"
FILES_${PN} += "${system_unitdir}/mypackage.service"
Recipe structure
recipes-mypackage/mypackage/
├── mypackage
│ └── mypackage.service
└── mypackage_git.bb
1 directory, 2 files
Service file
NOTE: mypackage has feature to run as daemon using -d option
[Unit]
Description=mypackage service
[Service]
Type=simple
ExecStart=/usr/bin/mypackage -d
[Install]
WantedBy=multi-user.target
Build configurations
Image recipe inherits core-image-base and contains
IMAGE_FEATURES += "package-management"
PACKAGE_CLASSES ?= "rpm deb package_deb"
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager += "systemd"
inherit extrausers
local.conf contents
MACHINE = "raspberrypi3-64"
ENABLE_UART = "1"
RPI_USE_U_BOOT = "1"
GPU_FREQ = "250"
I might have messed up a lot of things in the recipe, so need some pointer to clean up the recipe as well as resolve the issue.
Thanks.
Replace system_unitdir by systemd_system_unitdir.
SYSTEMD_PACKAGES already contains ${PN} so you can ignore it, same for FILES_${PN} += "${systemd_system_unitdir}/mypackage.service" as if systemd.bbclass finds your unit, it'll be added to the appropriate FILES_ automatically.
c.f. https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/systemd.bbclass#n4
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/systemd.bbclass#n109
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/systemd.bbclass#n148
And for completeness, thanks to #Jussi Kukkonen for the comment, missing $ sign before {systemd_system_unitdir}.
I'm trying to add lmdb to my yocto build. This is my recipe:
LIC_FILES_CHKSUM = "file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972"
SRC_URI = " \
https://github.com/LMDB/lmdb/archive/LMDB_${PV}.tar.gz \
"
SRC_URI[md5sum] = "0de89730b8f3f5711c2b3a4ba517b648"
SRC_URI[sha256sum] = "49d7b40949f2ced9bc8b23ea6a89e75471a1c9126537a8b268c318a00b84322b"
BBFILE_PRIORITY = "8"
inherit autotools-brokensep
S = "${WORKDIR}/lmdb-LMDB_${PV}/libraries/liblmdb"
do_install() {
install -d ${D}${bindir}
install -d ${D}${libdir}
install -d ${D}${includedir}
install -d ${D}${mandir}
sed -i 's:\$(prefix)/man:${mandir}:' Makefile
oe_runmake DESTDIR=${D} prefix=${prefix} manprefix=${mandir} install
}
It compiles fine but I get an error during do_package task:
ERROR: objcopy failed with exit code 256 (cmd was 'aarch64-poky-linux-objcopy' --only-keep-debug '/media/build/tmp/work/aarch64-poky-linux/lmdb/0.9.16-r0/package/usr/bin/mdb_copy' '/media/build/tmp/work/aarch64-poky-linux/lmdb/0.9.16-r0/package/usr/bin/.debug/mdb_copy'): aarch64-poky-linux-objcopy: Unable to recognise the format of the input file `/media/build/tmp/work/aarch64-poky-linux/lmdb/0.9.16-r0/package/usr/bin/mdb_copy'
I tried including INHIBIT_PACKAGE_STRIP = "1" in my bb file. But it throws other errors:
ERROR: runstrip: ''aarch64-poky-linux-strip' --remove-section=.comment --remove-section=.note --strip-unneeded '/media/build/tmp/work/aarch64-poky-linux/lmdb/0.9.16-r0/sysroot-destdir/usr/lib/liblmdb.so'' strip command failed with 1 (aarch64-poky-linux-strip: Unable to recognise the format of the input file `/media/build/tmp/work/aarch64-poky-linux/lmdb/0.9.16-r0/sysroot-destdir/usr/lib/liblmdb.so'
)
ERROR: QA Issue: Architecture did not match (183 to 62) on work/aarch64-poky-linux/lmdb/0.9.16-r0/packages-split/lmdb-dev/usr/lib/liblmdb.so [arch]
WARNING: QA Issue: /usr/lib/liblmdb.so_lmdb-dev contained in package lmdb-dev requires libpthread.so.0(GLIBC_2.3.2)(64bit), but no providers found in its RDEPENDS [file-rdeps]
ERROR: QA Issue: Architecture did not match (183 to 62) on work/aarch64-poky-linux/lmdb/0.9.16-r0/packages-split/lmdb/usr/bin/mdb_dump [arch]
I'm on poky 2.0.2.
The github link doesnt exist.
However you can skip qa packaging with
do_package_qa[noexec] = "1"
I want to replace the default vsftpd.conf file with my own file!
My bitbake file looks following:
bbexample_1.0.bb
DESCRIPTION = "Configuration and extra files for TX28"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
S = "${WORKDIR}"
SRC_URI += " \
file://ld.so.conf \
file://nginx/nginx.conf \
file://init.d/myscript.sh"
inherit allarch
do_install () {
install -d ${D}${sysconfdir}
install -d ${D}${sysconfdir}/nginx
install -d ${D}${sysconfdir}/init.d
rm -f ${D}${sysconfdir}/ld.so.conf
install -m 0755 ${WORKDIR}/ld.so.conf ${D}${sysconfdir}
install -m 0755 ${WORKDIR}/nginx/nginx.conf ${D}${sysconfdir}/nginx/
install -m 0755 ${WORKDIR}/init.d/myscript.sh ${D}${sysconfdir}/init.d/
}
bbexample_1.0.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
SRC_URI += " \
file://vsftpd.conf"
do_install_append () {
install -m 0755 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}
}
But, the file could not be replaced!
What is wrong?
What you need to do is to use a bbappend in your own layer,
vsftpd recipe is located in meta-openembedded/meta-networking/recipes-daemons
Thus you need to create a file called vstfpd_%.bbappend (% makes it valid for every version)
This file must be located in <your-layer>/meta-networking/recipes-daemons. You also need to put your custom vsftpd.conf in <your-layer>/meta-networking/recipes-daemons/vsftpd folder
Its content should be:
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
do_install_append(){
install -m 644 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}
}
Example from meta-openembedded here
you should add to your recipe:
FILES_${PN} += " file you installed"
I am using latest poky-am335x to build simple helloworld application. With some workaround I can able to compile the application. I am doing lot of trails to install binaries but build is throwing error.
error log :
DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
DEBUG: Executing shell function do_install
NOTE: make -j 4 DESTDIR=/home/pis1kor/workspace/poky-am335x/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/helloworld-1.0-r0/image install
make: *** No rule to make target `install'. Stop.
ERROR: oe_runmake failed
ERROR: Function failed: do_install (see /home/pis1kor/workspace/poky-am335x/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/helloworld-1.0-r0/temp/log.do_install.29583 for further information)
Bitbake file :
DESCRIPTION = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
PR = "r0"
SRC_URI = "file://helloworld.tar"
do_compile () {
make -C ${WORKDIR}/helloworld all
}
do_install() {
oe_runmake install DESTDIR=${D}
}
#do_install() {
# oe_runmake install DESTDIR=${D}
# make -C ${WORKDIR}/helloworld/ install
# oe_runmake 'DESTDIR=${D}' install
# cp -f ${WORKDIR}/helloworld/helloworld ${WORKDIR}/image
# oe_runmake install ${WORKDIR}/helloworld
# make -C ${WORKDIR}/helloworld install
# install -d ${D}${bindir}/ ZZ
#}
inherit autotools gettext
Makefile :
IDIR = ./include
CC = arm-arago-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 --sysroot=/home/pis1kor/workspace/poky-am335x/build/tmp/sysroots/am335x-evm
CFLAGS = -I$(IDIR)
LIBS = -lm
FILES = ./src/helloworld.c
OUT_EXE = helloworld
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
all: $(FILES)
$(CC) -o $(OUT_EXE) $(FILES) $(CFLAGS) $(LIBS)
install:
$(INSTALL_DATA) -C helloworld ../image
# sudo cp ./helloworld ../image/
clean:
rm -f *.o helloworld
The commented lines are kept like that because just to mansion all the trails I tried with.
The basic differences are the below.
S = "${WORKDIR}/helloworld/"
EXTRA_OEMAKE = 'all -C ${S}'
"EXTRA_OEMAKE" is the key macro which I didn't used before.
I have changed the bitbake file helloworld.bb file like below.
DESCRIPTION = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
PR = "r0"
S = "${WORKDIR}/helloworld/"
EXTRA_OEMAKE = 'all -C ${S}'
SRC_URI = "file://helloworld.tar"
inherit autotools gettext