Building gstreamer using Yocto - yocto

I am trying to build gstreamer for IMX53 Evk board.
I downloaded Yocto from http://freescale.github.io/#download and run the following commands.
#MACHINE=imx53qsb
#source setup-environment build
#bitbake core-image-minimal
It built the u-boot, kernel and filesystem. The file system doesn't have gstreamer. I want to built gstreamer also.
As per my understanding there two approaches to built gstreamer now.
Approach 1. Modify the distro.conf file to build gstreamer also. I
am not sure how to add gstreamer entries in the distro.conf. The
distribution is poky distribution.
Approach 2. Add IMAGE_INSTALL_append with gstreamer entries. My
doubht here is what names we have to add in the IMAGE_INSTALL_append.
I could see the following bb files related to gstreamer. Can you please help what strings I have to add in IMAGE_INSTALL_append in local.conf.
./meta-fsl-arm/recipes-multimedia/gstreamer/gst-fsl-plugin_4.0.3.bb
./meta-fsl-arm/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.3.bb
./meta-fsl-arm/recipes-multimedia/gstreamer/gstreamer1.0-plugins-imx_0.11.1.bb
./poky/meta/recipes-multimedia/gstreamer/gst-plugins-good_0.10.31.bb
./poky/meta/recipes-multimedia/gstreamer/gst-meta-base_0.10.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb
./poky/meta/recipes-multimedia/gstreamer/gst-fluendo-mp3_0.10.31.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.4.5.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer_0.10.36.bb
./poky/meta/recipes-multimedia/gstreamer/gst-openmax_0.10.1.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb
./poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly_0.10.19.bb
./poky/meta/recipes-multimedia/gstreamer/gst-ffmpeg_0.10.13.bb
./poky/meta/recipes-multimedia/gstreamer/gst-player_git.bb
./poky/meta/recipes-multimedia/gstreamer/gst-plugins-base_0.10.36.bb
./poky/meta/recipes-multimedia/gstreamer/gst-plugins-gl_0.10.3.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.4.5.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.4.5.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.4.5.bb
./poky/meta/recipes-multimedia/gstreamer/gst-plugins-bad_0.10.23.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.4.5.bb
./poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb
./poky/meta/recipes-multimedia/gstreamer/gst-fluendo-mpegdemux_0.10.85.bb
./poky/meta/recipes-connectivity/bluez/gst-plugin-bluetooth_4.101.bb
./meta-fsl-demos/recipes-fsl/packagegroups/packagegroup-fsl-gstreamer.bb
./meta-fsl-demos/recipes-fsl/packagegroups/packagegroup-fsl-gstreamer-full.bb
./meta-fsl-demos/recipes-multimedia/packagegroups/packagegroup-fslc-gstreamer1.0-full.bb
./meta-fsl-demos/recipes-multimedia/packagegroups/packagegroup-fslc-gstreamer1.0-commercial.bb
./meta-fsl-demos/recipes-multimedia/packagegroups/packagegroup-fslc-gstreamer1.0.bb
./meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst-rtsp_0.10.8.bb
./meta-openembedded/meta-multimedia/recipes-multimedia/nonworking/gstreamer/gst123_0.3.1.bb

You may add just
IMAGE_INSTALL_append += "gstreamer"
Long answer is that you should add the package name that usually stored in PN recipe variable. You may read about PN variable here. Package names may also be managed with PACKAGES variable.

You either use
IMAGE_INSTALL_append = " gstreamer"
or
IMAGE_INSTALL += " gstreamer"
They do the same things but IMAGE_INSTALL_append is best when using with this variable.
The space in front of gstreamer is important because.
let's say IMAGE_INSTALL is a string: "opkg qtbase"
and if we do not add a space in front.
IMAGE_INSTALL will be like this: "opkg qtbasegstreamer" which will cause error.

Advice is correct on getting package name. First find recipe. bitbake-layers is useful for this. Then check that PN and PACKAGES variables are not set, if they are things get tricky. For gstreamer they are not
If you're new to Yocto, I'd go with adding package in local.conf. Entry in should be be IMAGE_INSTALL_append += " gstreamer". The space before gstreamer is important.

Related

Regarding bitbake recipie

What changes should make to enable dlt-system.
In build folder dlt-system application is not generating.
Manually by using command: cmake -D with dlt-system=ON it will generate but I need to generate while building please look at recipie image
Your recipe supports dlt-system via PACKAGECONFIG.
In order to activate that flags in the compilation process, you just need to add dlt-system to PACKAGECONFIG in .bb or .bbappend file to the recipe:
PACKAGECONFIG_append = " dlt-system"
If you want to add it from local.conf:
PACKAGECONFIG_pn-name_append = " dlt-system"
Just change name with your recipe name.
This will add -DWITH_DLT_SYSTEM=ON to EXTRA_OECMAKE which is used in do_configure of the cmake class.

How to install tar.gz package to Yocto by adding new layer?

I new to Yocto so there are probably some mistakes and misunderstanding that I've had, I appreciate if you can help.
So, I want to add a new package (tar file) to my custom image.
I have followed steps and steps in manual and some online instructions. While running: "bitbake mylayer", the layer is built fine but I got this error while building the image, here is the log file:
DEBUG: Executing python function rootfs_deb_bad_recommendations
DEBUG: Python function rootfs_deb_bad_recommendations finished
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: ['depmodwrapper-cross', 'apt-native', 'dpkg-native', 'pseudo-native', 'update-rc.d-native', 'prelink-native', 'makedevs-native', 'ldconfig-native', 'opkg-util$
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing python function do_rootfs
NOTE: ###### Generate rootfs #######
NOTE: Installing the following packages: apt busybox copy-uefiimg-to-sda coreutils dpkg e2fsprogs-resize2fs libfontconfig1 libfreetype6 libglib-2.0-0 gptfdisk libjemalloc2 kernel-module-axi-dma-sensor ku$
ERROR: Unable to install packages.
Reading package lists...
Building dependency tree...
Reading state information...
Package mypackage is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mylayer' has no installation candidate
DEBUG: Python function do_rootfs finished
ERROR: Function failed: do_rootfs
And here is mylayer.bb:
SUMMARY = ""
LICENSE = "CLOSE"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://mypackage.tar"
Also, I have included the package in conf/local.conf:
IMAGE_INSTALL_append += " mylayer"
So beside trying to figure out how to solve this problem, I also have some questions:
I have read some example of .bb, and they mentioned about LIC_FILES_CHKSUM. The mypackage.tar.gz is a package to install a platform for the device and I don't know much about the source code, so I don't know if it is necessary to include the license? Or how to know that this package need license to install?
In some answer I found online, there is one saying that I need to include PACKAGE_CLASSES ?= "package_deb" (they want to install the .deb file), so probably in my case I will need PACKAGE_CLASSES ?= "package.tar" right? I have tried to change variable, but it still not successful.
The mypackage.tar includes some deb files. If I could not install mypackage.tar, can I instead install these .deb files? Can I put it all in mylayer.bb?
Thank you in advanced, I have tried to study much documents as I could but I get so confused and there is huge amount of information to digest.
First, before answering your questions
Let me mention some best practices advice for you:
Rename the recipe to some significant name related to you compressed package.
Naming the recipe to mylayer confuses Yocto users, because there is the term layer also.
Regarding you recipe:
There is no need for FILESEXTRAPATHS because the recipe path is added automatically to Yocto paths.
FILESEXTRAPATHS it is required for .bbappend files.
You need to override the do_install task function, it does nothing by default.
do_install is the first essential task to make sure that your sources are included in the final image.
Beside that, when specifying a compressed source file into SRC_URI, yocto automatically decompresses it.
This is mentioned here.
So, here what your recipe should look like:
SUMMARY = ""
LICENSE = "CLOSED"
# Prevent Yocto from decompressing the file
SRC_URI = "file://mypackage.tar;unpack=0"
do_install(){
# Create the opt folder into the final image, ${D} is ${WORKDIR}/image
install -d ${D}/opt
# Copy the compressed file there; You can change permissions as you want
install -m 0755 ${WORKDIR}/mypackage.tar ${D}/opt
}
# Very important to specify what you installed in (do_install)
FILES_${PN} = "/opt/*"
Now, when you run IMAGE_INSTALL_append += " mylayer" your file will be installed.
Regarding your questions:
You mentioned that your compressed file contains .deb files, I assume that no license checksum is needed. Also, I understand that you may wanted to point to SRC_URI[md5sum] or other checksums for the full package. That is also not needed for local files, it is used to check for the integrity of online sources.
PACKAGE_CLASSES as mentioned here, is used by the system to know in what type the data should be packaged. By the data I mean the data that you installed with do_install. That data get packaged for according to your PACKAGE_CLASSES variable, for example, to deb file. And that is used, along side with all other recipes packages, to build the final rootfs.
Yes, if you are installing the tar file into the image and then unpack it to install all deb files, for example, with dpkg. You can use the bin_package class to do that, now the recipe must be changed for that reason:
Decompress the tar file and provide the deb files in the local files folder.
Add all deb files to SRC_URI
Inherit the bin_package class
Specify the files to be packaged.
Your recipe should look like this:
SUMMARY = ""
LICENSE = "CLOSED"
SRC_URI = "file://deb_file1.deb \
file://deb_file2.deb"
# No need to `do_install` , it is invoked by the (bin_package) class
FILES_${PN} = ""
Important:
About FILES_${PN}, you need to add all what the deb installed into the image folder
Example, if your deb file installs this:
/usr/bin/hello
/etc/hello.cfg
Specify them:
FILES_${PN} = "/usr/bin/*"
FILES_${PN} += "/etc/*"
Use * so if other deb files install files into the same folder as others it will include all.

How to add pciutils package in yocto AGL?

I have built Yocto AGL(6.0.0) image for RCar-salvator-xs board and flashed its hyperflash memory.
Now, I want to perform PCIe related investigation, for that I want to use lspci command.
But, After ligging in as a root in flashed AGL image and executing lspci command it gives command not found.
How can I include pciutils in AGL source code and build it to use lspci command.
I am new to Yocto and AGL.
Any help will be much appreciated.
You can add
IMAGE_INSTALL += "pciutils"
or
IMAGE_INSTALL_append = "pciutils"
in conf/local.conf or in your image recipe.

Building a yocto image for RPi3

Recently I started with yocto-project to build images for raspberry-pi.
I cloned poky and meta-raspberrypi under a directory named as yocto_project on my ubuntu host. Initiated the build using source oe-init-build-env rpi-build.
The first image I created the rpi-basic-image which was a successful attempt.
Upon booting RPi with the image I got a CLI based interface, but the problem is few commands are missing. Came to know by-default all the packages didn't get combine with image, we need to add it manually for example systemd.
If I run bitbake-layers show-recipes I get long list of all the recipes available for RPi. So I added the text IMAGE_INSTALL_append = " systemd" after reading some documents online to append systemd. After this when I bitbake rpi-basic-image got error as ERROR: Nothing RPOVIDES 'systemd' (but /path_to/rpi-basic-image.bb RDEPENDS on or otherwise requires it)
ERROR: systemd was skipped: 'systemd' not in DISTRO_FEATURES
ERROR: Required build target 'rpi-basic-image' has no buildable providers
Don't have clue, why I get this error. How to resolve it. Also do I have to manually add those packages/recipes using build/local.conf to get all the commands.
Need a good explanation/guidance .
From Selecting an Initialization Manager - Yocto Development Manual:
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
You can set those variables in your local.conf.

How to include irdadump into Yocto (Poky) irda-utils 0.9.18 package

Please excuse my lack of knowledge and incorrect use of terminology. I
am looking to include irdadump in my build image within Yocto.
I modified the
/poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb file to
include irdadump in the list of targets to be built.
INITSCRIPT_NAME = "irattach"
INITSCRIPT_PARAMS = "defaults 20"
TARGETS ??= "irattach irdaping irdadump"
do_compile () {
for t in ${TARGETS}; do
oe_runmake -C $t
done
}
However the bitbake process fails which comes down to the dependency of
pkg-config and glib 2.0 required for idradump.
I did a quick search online and noticed that there was a separate .bb
file for irdadump:
http://cgit.openembedded.org/openembedded/plain/recipes/irda-utils/
I tried to replicate this however was still faced with compiling issues.
Could anyone give me a helping hand on including irdadump to my
irda-utils package?
Thank you
To add irda-utils to your build image, just add IMAGE_INSTALL_append in your conf/local.conf file.Next time when you will run Bitbake,it will include irda-utlis package in your build image.
IMAGE_INSTALL_append = " irda-utils"