Let's dive into the basic concepts of layers:
A layer, in the technical sense of the term, has some properties. They are as follows:
.bbappend
files should be joined. It means that if two layers include the same recipe (.bb
) file, the one with the higher priority is used.Furthermore, each layer is listed according to its functionality on this page:
http://layers.openembedded.org/layerindex/branch/master/layers/
At this stage, we know how the layers are distributed within the Yocto Project. Now, we will see how these layers are composed.
For this example, we will take as an example the meta-qt5
layer. This layer has a directory tree, as follows:
pjtexier@amplitude:~ $ ls -l meta-qt5/ total 28 drwxrwxr-x 2 pjtexier pjtexier 4096 avril 22 19:20 classes drwxrwxr-x 3 pjtexier pjtexier 4096 avril 22 19:20 conf -rw-rw-r-- 1 pjtexier pjtexier 1035 avril 22 19:20 COPYING.MIT drwxrwxr-x 2 pjtexier pjtexier 4096 avril 22 19:20 licenses -rw-rw-r-- 1 pjtexier pjtexier 1189 avril 22 19:20 README drwxrwxr-x 4 pjtexier pjtexier 4096 avril 22 19:20 recipes-devtools drwxrwxr-x 10 pjtexier pjtexier 4096 avril 22 19:20 recipes-qt
Inside this directory, there are two important files; they are as follows:
URI: git://github.com/openembedded/oe-core.git branch: master revision: HEAD URI: git://github.com/openembedded/meta-oe.git layers: meta-ruby branch: master revision: HEAD When building stuff like qtdeclarative, qtquick, qtwebkit, make sure thatyou have required PACKAGECONFIG options enabled in qtbase build, see qtbase.inc for detail.Send pull requests to [email protected] with '[meta-qt5]' in the subject' When sending single patches, please using something like: 'git send-email -M -1 --to openembedded- [email protected] --subject-prefix=meta-qt5][PATCH'You are encouraged to fork the mirror on github[1] to share your patches. This is preferred for patch sets consisting of more than one patch. Other services like gitorious, repo.or.cz or self hosted setups are of course accepted as well, 'git fetch <remote>' works the same on all of them. We recommend github because it is free, easy to use, has been proven to be reliable and has a really good web GUI.1. https://github.com/meta-qt5/meta-qt5/ Main layer maintainers: Martin 'JaMa' Jansa <[email protected]> Otavio Salvador <[email protected]>
The classes
folder holds .bbclass
files. Here is a sample classes
folder:
pjtexier@amplitude:~ $ ls -l classes/ total 24 -rw-rw-r-- 1 pjtexier pjtexier 1721 avril 22 19:20 cmake_qt5.bbclass -rw-rw-r-- 1 pjtexier pjtexier 2001 avril 22 19:20 populate_sdk_qt5.bbclass -rw-rw-r-- 1 pjtexier pjtexier 7633 avril 22 19:20 qmake5_base.bbclass -rw-rw-r-- 1 pjtexier pjtexier 219 avril 22 19:20 qmake5.bbclass -rw-rw-r-- 1 pjtexier pjtexier 1935 avril 22 19:20 qmake5_paths.bbclass
The conf
folder should provide configuration (.conf
) files. The layer.conf
file inside this folder contains some important variables, for example, the variable concerning the priority (BBFILE_PRIORITY
):
# Define the priority for recipes (.bb files) from this layer, # choosing carefully how this layer interacts with all of the # other layers. BBFILE_PRIORITY_qt5-layer = "7"
To verify the priority value, we can use the following command:
$: bitbake-layers show-layers
For this presentation, we will take the example of the BSP layer specific to our hardware: the meta-raspberrypi BSP layer. This directory (folder) should contain a file list similar to the following:
pjtexier@amplitude:~ $ ls -l meta-raspberrypi/ classes conf custom-licenses recipes-bsp recipes-core recipes-devtools recipes-graphics recipes-kernel recipes-multimedia COPYING.MIT README
When we use a BSP layer, there are some differences. The first is in the conf
folder. Now, we have a new folder inside this directory, which is machine
.
This folder contains some configuration files to handle our specific hardware (Raspberry Pi and Raspberry Pi 2 among others). For example, there is an important file (rpi-base.inc
) located at:
* raspberry.conf
(configuration file for Raspberry Pi)
* raspberry2.conf
(configuration file for Raspberry Pi2)
* rpi-base.inc
The rpi-base.inc
file looks like this:
include conf/machine/include/rpi-default-settings.inc include conf/machine/include/rpi-default-versions.inc include conf/machine/include/rpi-default-providers.inc SOC_FAMILY = "rpi" include conf/machine/include/soc-family.inc IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg" SERIAL_CONSOLE = "115200 ttyAMA0" XSERVER = " xserver-xorg xf86-input-evdev xf86-input-mouse xf86-input-keyboard xf86-video-fbdev " # Really supported starting from linux-raspberrypi 3.18.y only KERNEL_DEVICETREE ?= " bcm2708-rpi-b.dtb bcm2708-rpi-b-plus.dtb bcm2709-rpi-2-b.dtb ds1307-rtc-overlay.dtb hifiberry-amp-overlay.dtb hifiberry-dac-overlay.dtb hifiberry-dacplus-overlay.dtb hifiberry-digi-overlay.dtb iqaudio-dac-overlay.dtb iqaudio-dacplus-overlay.dtb lirc-rpi-overlay.dtb pcf8523-rtc-overlay.dtb pps-gpio-overlay.dtb w1-gpio-overlay.dtb w1-gpio-pullup-overlay.dtb " KERNEL_IMAGETYPE ?= "Image" MACHINE_FEATURES = "kernel26 apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio" # Raspberry Pi has no hardware clock MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc" MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" # Set Raspberrypi splash image SPLASH = "psplash-raspberrypi" IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* ${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE}"
It is in this file that we set some essential variables, including the following:
SERIAL CONSOLE
specifies the speed and device for the serial console to attach to. It is passed to the kernel as a console parameter, for example, 115200 ttyAM0.IMAGE FSTYPES
specifies the format of the root filesystem images to be created.KERNEL IMAGETYPE
specifies the type of kernel image to build (uImage or zImage).If you want to know more about the BSP layer, you can visit http://www.yoctoproject.org/docs/1.8/bsp-guide/bsp-guide.html.
52.14.221.113