UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor matejk
Visitor
730 Views
Registered: ‎10-26-2018

How to add multiple packages from a bb recipe to rootfs

Hi,

I am building an application (IIO) from sources in a project with SDK 2018.2

The recipe creates multiple packages:

PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-python"

Only the default package (libiio) is added to the rootfs. I'd like to add libiio-iiod to rootfs also.

I tried to use IMAGE_INSTALL and IMAGE_INSTALL_append in the bitbake recipe but it did not work.

What needs to be added in the bb recipe file to add additional package to rootfs image?

Thanks in advance.

0 Kudos
4 Replies
Moderator
Moderator
703 Views
Registered: ‎04-24-2017

Re: How to add multiple packages from a bb recipe to rootfs

Hi @matejk,

Can you post your recipe file.

Take a look on libdrm recipe(tests, kms) http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-graphics/drm/libdrm_2.4.83.bb?h=rocko#n34 

When you enable it should look like this.

DESCRIPTION = "PETALINUX image definition for Xilinx boards"
LICENSE = "MIT"

require recipes-core/images/petalinux-image-common.inc 

inherit extrausers
IMAGE_LINGUAS = " "

IMAGE_INSTALL = "\
		kernel-modules \
		mtd-utils \
		canutils \
		openssh-sftp-server \
		pciutils \
		run-postinsts \
		udev-extraconf \
		packagegroup-core-boot \
		packagegroup-core-ssh-dropbear \
		tcf-agent \
		bridge-utils \
		hellopm \
		libdrm \
		libdrm-tests \
		libdrm-kms \
		packagegroup-petalinux-audio \
		packagegroup-petalinux-gstreamer \
		packagegroup-petalinux-matchbox \
		packagegroup-petalinux-v4lutils \
		packagegroup-petalinux-x11 \
		gst-stream-app \
		gst-vcu-decode \
		gstreamer-vcu-examples \
		"
EXTRA_USERS_PARAMS = "usermod -P root root;"
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Visitor matejk
Visitor
676 Views
Registered: ‎10-26-2018

Re: How to add multiple packages from a bb recipe to rootfs

Hi @sandeepg,

I took the bb file from openembedded and modified it a bit.

#
# Modelled from: https://github.com/openembedded/meta-openembedded/blob/master/meta-oe/recipes-support/libiio/libiio_git.bb
#

SUMMARY = "Analog Devices Industrial IO library"
HOMEPAGE = "https://wiki.analog.com/resources/tools-software/linux-software/libiio"
SECTION = "PETALINUX/apps"
LICENSE = "LGPLv2.1+"
LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7c13b3376cea0ce68d2d2da0a1b3a72c"

# 0.16
#SRCREV = "e868971c7fc3a1829abda893075e3fd3d034e08e"

# 0.10
SRCREV = "11b871b4f5fb1b9e9029fae1a7fd3734efb441b0"

SRC_URI = "git://github.com/analogdevicesinc/libiio.git"

S = "${WORKDIR}/git"

#inherit cmake gitpkgv systemd update-rc.d
inherit cmake gitpkgv update-rc.d

PV = "0.16-git${SRCPV}"
PKGV = "0.16-git${GITPKGV}"

DEPENDS = " \
    flex-native bison-native libaio \
    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
"

EXTRA_OECMAKE = " \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DUDEV_RULES_INSTALL_DIR=${nonarch_base_libdir}/udev/rules.d \
    -DWITH_IIOD=ON \
    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DWITH_SYSTEMD=ON', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '-DWITH_SYSVINIT=ON', '', d)} \
"

PACKAGECONFIG ??= "USB_BACKEND NETWORK_BACKEND PYTHON_BINDINGS"

PACKAGECONFIG[USB_BACKEND] = "-DWITH_USB_BACKEND=ON,-DWITH_USB_BACKEND=OFF,libusb1,libxml2"
PACKAGECONFIG[NETWORK_BACKEND] = "-DWITH_NETWORK_BACKEND=ON,-DWITH_NETWORK_BACKEND=OFF,libxml2"
PACKAGECONFIG[PYTHON_BINDINGS] = ",,python"

PACKAGES =+ "${PN}-iiod ${PN}-tests ${PN}-python"

FILES_${PN}-iiod = " \
    ${sbindir}/iiod \
    ${systemd_system_unitdir}/iiod.service \
    ${sysconfdir}/init.d/iiod \
"
FILES_${PN}-tests = "${bindir}"
FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"

#SYSTEMD_PACKAGES = "${PN}-iiod"
#SYSTEMD_SERVICE_${PN}-iiod = "iiod.service"

INITSCRIPT_PACKAGES = "${PN}-iiod"
INITSCRIPT_NAME_${PN}-iiod = "iiod"

IMAGE_INSTALL_append = " libiio libiio-iiod"

Package libiio-iiod does not get packaged into the rootfs, only libiio (shared libraries) is packed.

0 Kudos
Visitor matejk
Visitor
637 Views
Registered: ‎10-26-2018

Re: How to add multiple packages from a bb recipe to rootfs

Hi @sandeepg,

The generated bb file for packaging is project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb:

DESCRIPTION = "PETALINUX image definition for Xilinx boards"
LICENSE = "MIT"

require recipes-core/images/petalinux-image-common.inc 

inherit extrausers
IMAGE_LINGUAS = " "

IMAGE_INSTALL = "\
                kernel-modules \
                mtd-utils \
                mtd-utils-jffs2 \
                canutils \
                openssh-sftp-server \
                pciutils \
                run-postinsts \
                udev-extraconf \
                packagegroup-core-boot \
                packagegroup-core-ssh-dropbear \
                tcf-agent \
                bridge-utils \
                hellopm \
                packagegroup-petalinux-lmsensors \
                libiio \
                "
EXTRA_USERS_PARAMS = "usermod -P root root;"

libiio-iiod is not on the list.

libiio.bb from my previous post is in project-spec/meta-user/recipes-apps/libiio/libiio.bb.

I upgraded to 2018.3 in the meantime.

There must be something that I still don't know about packaging custom apps that create multiple packages. Am I supposed to add the packages on the list in petalinux-user-image.bb manually using a editor?

0 Kudos
Visitor matejk
Visitor
631 Views
Registered: ‎10-26-2018

Re: How to add multiple packages from a bb recipe to rootfs

I managed to add the package to the image the following way:

  • libiio is added as an app to the project (see above)
  • package libiio-iiod is defined in the bb
  • project-spec/meta-user/recipes-core/images/petalinux-image.bbappend is edited and the following line is added IMAGE_INSTALL_append = " libiio-iiod"
  • petalinux-config -c rootfs now shows libiio.iiod in user packages and I selected it
  • petalinux-build creates an image with all packages that I need.

Is this the right way to do it?

I'd rather not put libiio recipe into the installation of the SDK, because it will not be available to my colleagues then when they check out the project.

0 Kudos