How to use the Yocto Project to develop Embedded Linux
What is the Yocto Project™
The Yocto Project™ is an open source collaboration project that provides templates, tools and methods to help you create custom Linux-based systems for embedded products regardless of the hardware architecture. Taken directly from the Yocto Project website:
Yocto Project™ it's not an embedded Linux distribution – it creates a custom one for you
The Yocto Project™ is an umbrella project covering a fairly wide swath of embedded Linux technologies an distributions. For example, the Angstrom Distribution is declared as a Yocto Project Participant
Much of this How-To is extracted from different sources. If you would like to read some of the original articles or resources, please visit them and thank the authors:
- The Yocto project website ( http://www.yoctoproject.org )
- The Yocto project documentation ( http://www.yoctoproject.org/documentation )
- The Openembedded website ( http://www.openembedded.org/ )
Why use the Yocto Project™
Because it's a complete embedded Linux development environment with tools, metadata, and documentation - everything you need. The free tools are easy to get started with, powerful to work with (including emulation environments, debuggers, an Application Toolkit Generator, etc.) and they allow projects to be carried forward over time without causing you to lose optimizations and investments made during the project’s prototype phase. The Yocto Project fosters community adoption of this open source technology allowing its users to focus on their specific product features and development
How to build Poky custom Poky Linux distribution
Yocto will be built on a host machine targeting and igep board. It will use Poky software to generate the custom linux distribuion Linux distribution. Before starting with yocto, you need to set up the host machine.
Yocto is expecting the host system to have preinstalled packages. Depending on the type of development, the host system will need more or less packages. On Ubuntu / Debian here is a table depending on the type of development.
|If you don't know what type of development it suits better to your needs we recommend you to start with Essential type|
|Type of Development||Description||Package List|
|Essential||For building images on a headless system||gawk wget git-core diffstat unzip texinfo gcc-multilib \|
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping
|Graphical + Eclipse Plugins||For building images on a graphical host and if using Eclipse IDE||libsdl1.2-dev xterm|
|Documentation||For building the Yocto Project documentation manuals||make xsltproc docbook-utils fop dblatex xmlto|
|OpenEmbedded Self Test||Packages needed if you are going to run oe-selftest||python-git|
If your build system has the oss4-dev package installed, you might experience QEMU build failures due to the package installing its own custom /usr/include/linux/soundcard.h on the Debian system. If you run into this situation, either of the following solutions exist:
sudo apt-get build-dep qemu
sudo apt-get remove oss4-dev
Yocto Project Setup
In order to create a custom linux distribution; we will download the yocto project.
git clone <a href="git://git.yoctoproject.org/poky" rel="nofollow">git://git.yoctoproject.org/poky</a>
Enter poky folder.
Switch to pyro branch.
git checkout pyro
Download meta-openembedded layer and switch to pyro branch.
git clone https://github.com/openembedded/meta-openembedded.git -b pyro
Download meta-qt5 layer and switch to pyro branch.
git clone https://github.com/qt/qt5.git -b pyro
Download meta-isee layer and switch to pyro branch.
git clone firstname.lastname@example.org:poky-yocto/meta-isee.git -b pyro
Source the environment using:
You should be now inside poky/build folder.
Add all the layers into build/conf/bblayers.conf.
BBLAYERS ?= " \
from poky/build folder Create your own custom Linux distribution with the following command.
bitbake igep-minimal-image MACHINE=machine-name
The following table provides you the information about the comercial names of igep product and the MACHINE= machine-name you need to select when creating the Linux distribution using Yocto.
As an example using this command
bitbake igep-minimal-image MACHINE=igep0034
Produces a minimal rootfs, u-boot, Kernel image and DTB for ISEE AM335x products.
Types of custom Poky Linux Distributions
Meta-isee is the layer that provides you the support to build your own custom poky linux distribution. In fact it provides you a set of predefined images that will build some components, like focusing on building the minimal set of components required to boot an igep board or building more complicated distributions with X capabilites or even build an image with a Sato or LXDE Desktop.
The following table explains the types of images, the description and the aproximated size to give you a hint of what you are building.
|Image Name||Description||Aproximated Size|
|igep-mrskeltal-image||Only the bare minimum required for a board to boot. This means you will only find poky minimal set of rootfs and kernel modules.|
|igep-minimal-image||The minimum required for a board to boot plus set of configured tools and utilities aplications to provide user easy access to board capabilities.|
|igep-basic-image||Based on igep-minimal-image plus Qt5 framework (demos included), Gstreamer1.0, and Pulseaudio.|
|igep-basicX-image||Based on igep-minimal-image plus X environment.|
|igep-full-image||Based on igep-basic-image and igep-basicX-image. Provides Qt5 framework (demos included), Gstreamer1.0, Pulseaudio, and X environment.|
|igep-sato-image||Based on igep-full-image plus a Sato Desktop.|
|igep-lxde-image||Based on igep-full-image plus LXDE Desktop|
|igep-custom-image||An empty template image based on igep-mrskeltal-image for users to add anything required to fill their needs||20MB to X MB|
Not all images are compatibles with all the igep machine product. Here is the compatibility chart to guide you what you can/can't build depending on your igep board.
|IGEP PRODUCT||Image Key Name|