About Yocto system

Ctrl C + Ctrl V frome the web-site ibm.com "The Yocto Project™ – is an Open Source-project, which purpose is to make the development of special Linux distributions for embedded systems and ensuring their portability across different platforms easier."

Below are the basic first steps when meeting with yocto.

The building process is described in the documentation in detail.

After installing/unpacking the distribution we have something like this folder with the following content:

$ ls -l
итого 240
drwxr-xr-x   6 dima dima   4096 дек.  16 09:16 bitbake
drwxr-xr-x  13 dima dima   4096 дек.  16 09:16 documentation
-rw-r--r--   1 dima dima  14664 дек.  16 09:16 fsl-setup-poky
-rw-r--r--   1 dima dima    545 дек.  16 09:16 LICENSE
drwxr-xr-x  21 dima dima   4096 дек.  16 09:16 meta
drwxr-xr-x  17 dima dima   4096 дек.  16 09:21 meta-fsl-networking
drwxr-xr-x  13 dima dima   4096 дек.  16 09:16 meta-fsl-ppc
drwxr-xr-x   7 dima dima   4096 дек.  16 09:21 meta-fsl-ppc-toolchain
drwxr-xr-x   4 dima dima   4096 дек.  16 09:16 meta-hob
drwxr-xr-x  16 dima dima   4096 дек.  16 09:16 meta-oe
drwxr-xr-x   6 dima dima   4096 дек.  14 17:01 meta-skeleton
drwxr-xr-x  11 dima dima   4096 дек.  16 09:21 meta-virtualization
drwxr-xr-x   6 dima dima   4096 дек.  14 17:01 meta-yocto
drwxr-xr-x   8 dima dima   4096 дек.  14 17:01 meta-yocto-bsp
-rwxr-xr-x   1 dima dima   1592 дек.  16 09:16 oe-init-build-env
-rw-r--r--   1 dima dima   2038 дек.  16 09:16 README
-rw-r--r--   1 dima dima  17436 дек.  16 09:16 README.hardware
drwxr-xr-x   9 dima dima   4096 дек.  16 09:16 scripts
drwxr-xr-x  11 dima dima 131072 марта  3 16:07 sources
drwxrwxr-x 260 dima dima   4096 дек.  18 04:41 sstate-cache

Next we need to install the missing packages using the script

$ . /scripts/host-prepare.sh

The next step is the yocto configurationfor the building under specific target.
For example:

source ./fsl-setup-poky -m p5040rdb -j14 -t14

After this command running we get the work folder, in my case it is the following folder: build_p5040rdb_release

We go to this folder and begin with the building. It can be done using bitbake. For example:

$ bitbake fsl-image-minimal

When using graphics we start the programm hob

$ hob

Using hob we can choose a target, building image, to set the number of parallel threads to speed up building time, etc.

After building of Yocto Project, we can find the images in
build_p5040ds_release/tmp/deploy/images

Cross-compiler is located somewhere here (search by mask "-linux-gcc"):
/build_p5040ds_release/tmp/sysroots

Sometimes when running bitbake or hob we can see this message:

ERROR: Only one copy of bitbake should be run against a build directory

It means that bitbake have been already started:

ps -ef|grep bitbake

compiled packages are located in
/build_p5040ds_release/tmp/work/

If we want to remove some package, we need to use bitbake as follows:

bitbake -c clean virtual/kernel
bitbake -c cleansstate pulseaudio
bitbake -c cleansstate u-boot

For configuration of the linux kernel in Yocto Project:

bitbake -c menuconfig virtual/kernel 

For building of linux kernel in Yocto Project:

$ bitbake -c compile -f virtual/kernel
$ bitbake virtual/kernel

Kernel configuration for the specific system in Yocto Project:

MACHINE=p5040ds bitbake -c menuconfig virtual/kernel

Kernel building for the specific system in Yocto Project:

$ MACHINE=p5040ds-64b bitbake -c compile -f virtual/kernel
$ MACHINE=p5040ds-64b bitbake virtual/kernel

In case if we got such a message:

ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Toolchain tunings invalid:
Multilib 'lib64' (ppc64e5500) is also the default tuning.

ERROR: Execution of event handler 'check_sanity_eventhandler' failed

we comment all the lines in the file meta/conf/sanity.conf as follows (I don't know what it means, but it works):

#BB_MIN_VERSION = "1.17.1"

#SANITY_ABIFILE = "${TMPDIR}/abi_version"

#SANITY_VERSION ?= "1"
#LOCALCONF_VERSION  ?= "1"
#LAYER_CONF_VERSION ?= "5"
#SITE_CONF_VERSION  ?= "1"

#INHERIT += "sanity"

Adding of a new package to the building target of core-image-minimal:

1. To create the building recipe and it is better to download it from the Internet, because it surely is already there. Then copy it over here as an option: poky/meta/recipes-devtools

2. To add the following line into the file poky/build/conf/local.conf:

CORE_IMAGE_EXTRA_INSTALL = "efibootmgr"

or so:

IMAGE_INSTALL_append = " lua5.1 efibootmgr"

where efibootmgr - is the name of the new package and the similar name of the building recipe in poky/meta/recipes-devtools

3. To run the building process using hob and make sure that the package have been added while building of the target core-image-minimal.

Building of separate utilities in the system of yocto is performed according to the available list of commands for each utility. The list of commands can be viewed, for example, for the utility efibootmgr:

$ bitbake -c listtasks efibootmgr

For removing the utility with the source codes from tmp/work/corei7-64-poky-linux/efibootmgr:

bitbake -c cleansstate efibootmgr

For utility building:

bitbake -c compile efibootmgr

The option "-v" displays a detailed output of information about the building process:

bitbake -v -c compile efibootmgr