How to add pciutils package in yocto AGL? - yocto

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.

Related

Remove netdata package from Yocto

I'm trying to get rid of netdata from my Yocto environment. So I added it to the IMAGE_INSTALL_remove variable inside my <image>.bb file:
IMAGE_INSTALL_remove = "netdata"
I also added it to conf/bblayers.conf file:
DISTRO_FEATURES_remove = "netdata"
Then I removed the output directory (rm -rf tmp-glibc) and the buildhistory/.../netdata directory and I bitbaked my image again.
Unfortunately the package is still compiled and goes into the output folder.
Yocto is hard to learn, and I'm still learning it, so I'm not a Yocto expert, and might even be wrong. But I hope I can help you.
I think that you don't have to modify your bblayers.conf by adding
DISTRO_FEATURES_remove = "netdata"
Are you sure that the netdata package is not needed by any other packages? For example, if inside recipe-a.bb you have:
RDEPENDS += "recipe-b"
Then recipe-b is automatically included in the result image.
My advice is: check the netdata dependencies with
bitbake -g <packagename-or-imagename> -u taskexp
Because maybe this is needed from some other package, and you have to remove the other package too in order to see netdata removed.
If the package is always there, as a last resort you can also try to clean the entire image with:
bitbake -c cleanall <imagename>
And then rebuild it with:
bitbake <imagename>
Source: https://www.openembedded.org/wiki/Inspect_DEPENDS

core-image-minimal has bluetooth

I am trying to build core-image-minimal receipe for iMx7 (Yocto project), the image gets successfully built but it has bluetooth, caam and lot of other stuff. How can I remove these from including in the minimal-image?
core-image-minimal should only have things required for just booting nothing else, somehow other packages are getting added. I didnt add anything in my local.config file.
MACHINE = "imx7dsabresd"
bluetooth and wifi are enabled here:
imx7dsabresd.conf
You can add the following to your local.conf to remove bluetooth:
MACHINE_FEATURES_remove = "bluetooth"
CAAM is enabled in the kernel config here:
defconfig
To change the kernel configuration you can either provide a new defconfig or use a configuration fragment. The following steps describe how to create a config fragment.
Run the following command and deselect the bluetooth related config options:
bitbake -c menuconfig virtual/kernel
Run the following command to generate fragment.cfg in ${WORKDIR}
bitbake -c diffconfig virtual/kernel
At this point if you do not have your own layer, create one by following this guide:
Creating Your Own Layer
Create the directory for the .bbappend and the configuration fragment:
mkdir -p ${PATH_TO_YOUR_LAYER}/recipes-kernel/linux/linux-fslc-imx/linux-fslc-imx/
Move fragment.cfg from ${WORKDIR} to ${PATH_TO_YOUR_LAYER}/recipes-kernel/linux/linux-fslc-imx/linux-fslc-imx/
Create a ${PATH_TO_YOUR_LAYER}/recipes-kernel/linux/linux-fslc-imx_%.bbappend (assuming linux-fslc-imx is the correct kernel recipe for this board) and place the following in it:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://fragment.cfg"
Additionally, you may find the Creating Configuration Fragments section of the manual helpful.
For more information about bbappends see:
mega-manual
You do not mention which machine you are building for, but I suspect it has bluetooth enabled in the MACHINE_FEATURES. I also didn't look at the bb file for core-image-minimal closely, so could be something else.

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 enable a package in yocto?

I am new to yocto and I was using openWRT earlier. I want to enable dropbear with the core-image-minimal. How to do this?
I have dropbear bb file in sources/poky/meta/recipies-core/dropbear and sources/poky/meta/recipes-core/packagegroups.
I tried appending the packagegroup-core-ssh-dropbear.bb to the IMAGE_INSTALL in sources/poky/meta/recepies-core/image/core-image-minimal.bb and this throws error Nothing provides dropbear.
How to enable this?. Don't we have a menuconfig or equivalent to enable a package/recipe?
Simply add the following
IMAGE_INSTALL_append = "dropbear"
to your image recipe

Building gstreamer using 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.