Difference between revisions of "How to use the Yocto Project to develop Embedded Linux"

From IGEP - ISEE Wiki

Jump to: navigation, search
Line 33: Line 33:
  
 
{{Message/Information Message|title=TITLE|message=If you don't know what type of development  it suits better to your needs we recommend you to start with Essential type }}
 
{{Message/Information Message|title=TITLE|message=If you don't know what type of development  it suits better to your needs we recommend you to start with Essential type }}
 +
  
  
Line 90: Line 91:
 
from poky/build folder Create your own custom Linux distribution with the following command.
 
from poky/build folder Create your own custom Linux distribution with the following command.
  
  bitbake igep-minimal-image MACHINE=machine-name
+
  MACHINE=machine-name DISTRO=distro-name bitbake igep-minimal-image
 
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.
 
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.
  
 
{| class="contenttable sortable"
 
{| class="contenttable sortable"
|-
+
|- style="height: 22px;"
!|Commercial Name
+
! style="height: 22px;"|Commercial Name
!|machine-name
+
! style="height: 22px;"|machine-name
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"| 
||igep0002
+
| style="height: 22px;"|igep0002
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"| 
||igep0010
+
| style="height: 22px;"|igep0010
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEPv2
||igep0020
+
| style="height: 22px;"|igep0020
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP COM MODULE
||igep0030
+
| style="height: 22px;"|igep0030
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP COM AQUILA AM335x
||igep0033
+
| style="height: 22px;"|igep0033
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC AM335x
||igep0034
+
| style="height: 22px;"|igep0034
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC AM3352
||igep0035
+
| style="height: 22px;"|igep0035
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEPx6
||igep0036
+
| style="height: 22px;"|igep0036
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC (Marvell PXA212)
||igep0040
+
| style="height: 22px;"|igep0040
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC (Zynq)
||igep0045
+
| style="height: 22px;"|igep0045
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC i.MX6 (Solo)
||igep0046sx
+
| style="height: 22px;"|igep0046sx
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC i.MX6 (Dual Lite)
||igep0046dl
+
| style="height: 22px;"|igep0046dl
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC i.MX6 (Quad)
||igep0046q
+
| style="height: 22px;"|igep0046q
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEPv5
||igep0050
+
| style="height: 22px;"|igep0050
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEPv5 SMARC
||igep0055
+
| style="height: 22px;"|igep0055
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"| 
||igep0057
+
| style="height: 22px;"|igep0057
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC i.MX8
||igep0060
+
| style="height: 22px;"|igep0060
|-
+
|- style="height: 22px;"
||
+
| style="height: 22px;"|IGEP SMARC i.MX6 (Ultra Lite)
||igep0146
+
| style="height: 22px;"|igep0146
 
|-
 
|-
 
||
 
||
 
||sopa0000
 
||sopa0000
 +
|}
 +
The following table provides you the information about the different igep distributions. It is provided the DISTRO=distro-name and the description of it.
 +
 +
{| class="contenttable sortable"
 
|-
 
|-
||
+
!|distro-name
||xgao0030
+
!|Description
 
|-
 
|-
||
+
||isee-release
||xmed0030
+
||Rootfs with sysV suite and x11
 
|-
 
|-
||
+
||isee-release-no-x11
||slnk001x
+
||Rootfs with sysV suite and without x11
 
|-
 
|-
||
+
||isee-systemd
||gran0100
+
||Rootfs with systemd suite and x11
 
|-
 
|-
||
+
||isee-systemd-no-x11
||gplc0000
+
||Rootfs with systemd suite and without x11
 
|}
 
|}
As an example using this command
+
As a final example using this command
  
  bitbake igep-minimal-image MACHINE=igep0034
+
  MACHINE=igep0034 DISTRO=isee-release-no-x11 bitbake igep-minimal-image
Produces a minimal rootfs, u-boot, Kernel image and DTB for ISEE AM335x products.
+
Produces a minimal rootfs (sysV suite, withuot X11), u-boot, Kernel image and DTB for ISEE AM335x products.
  
 
==='''Types of custom Poky Linux Distributions'''===
 
==='''Types of custom Poky Linux Distributions'''===
Line 179: Line 184:
  
 
The following table explains the types of images, the description and the aproximated size to give you a hint of what you are building.
 
The following table explains the types of images, the description and the aproximated size to give you a hint of what you are building.
 +
 +
 +
{{Message/Information Message|title=TITLE|message= <span style="color: #ff0000;">When you are bitbaking an image with X support  you '''MUST''' set DISTRO=distro-name compatible with X environment.</span>}}
 +
  
 
{| class="contenttable sortable" style="width: 890px;"
 
{| class="contenttable sortable" style="width: 890px;"
Line 218: Line 227:
 
| style="width: 124px;"|20MB to X MB
 
| style="width: 124px;"|20MB to X MB
 
|}
 
|}
 +
=== ===
 
==='''Compatibility Chart'''===
 
==='''Compatibility Chart'''===
 
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.
 
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.
Line 417: Line 427:
 
|- style="height: 22px;"
 
|- style="height: 22px;"
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"|sopa0000
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"|sopa0000
| style="border-color: #000000; background-color: #82fa58; text-align: center; vertical-align: middle;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
|- style="height: 22px;"
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"|xgao0030
 
| style="border-color: #000000; background-color: #82fa58; text-align: center; vertical-align: middle;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
|- style="height: 22px;"
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"|xmed0030
 
| style="border-color: #000000; background-color: #82fa58; text-align: center; vertical-align: middle;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
|- style="height: 22px;"
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"|slnk001x
 
| style="border-color: #000000; background-color: #82fa58; text-align: center; vertical-align: middle;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
|- style="height: 22px;"
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"|gran0100
 
| style="border-color: #000000; background-color: #82fa58; text-align: center; vertical-align: middle;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
|- style="height: 22px;"
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"|gplc0000
 
 
| style="border-color: #000000; background-color: #82fa58; text-align: center; vertical-align: middle;"| 
 
| style="border-color: #000000; background-color: #82fa58; text-align: center; vertical-align: middle;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 
 
| style="border-color: #000000; text-align: center; vertical-align: middle; height: 22px;"| 

Revision as of 10:28, 7 May 2018

yocto-project-transp.png

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:


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.


Host Setup

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.


Information.jpg 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.

cd poky

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 git@git.isee.biz:poky-yocto/meta-isee.git -b pyro

Source the environment using:

source oe-init-build-env

You should be now inside poky/build folder.

Add all the layers into build/conf/bblayers.conf.

BBLAYERS ?= " \
/home/isee/yocto-project/meta \
/home/isee/yocto-project/meta-poky \
/home/isee/yocto-project/meta-yocto-bsp \
/home/isee/yocto-project/meta-openembedded/meta-oe \
/home/isee/yocto-project/meta-openembedded/meta-multimedia \
/home/isee/yocto-project/meta-openembedded/meta-python \
/home/isee/yocto-project/meta-openembedded/meta-networking \
/home/isee/yocto-project/meta-openembedded/meta-ruby \
/home/isee/yocto-project/meta-qt5 \
/home/isee/yocto-project/meta-isee \
"

from poky/build folder Create your own custom Linux distribution with the following command.

MACHINE=machine-name DISTRO=distro-name bitbake igep-minimal-image

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.

Commercial Name machine-name
  igep0002
  igep0010
IGEPv2 igep0020
IGEP COM MODULE igep0030
IGEP COM AQUILA AM335x igep0033
IGEP SMARC AM335x igep0034
IGEP SMARC AM3352 igep0035
IGEPx6 igep0036
IGEP SMARC (Marvell PXA212) igep0040
IGEP SMARC (Zynq) igep0045
IGEP SMARC i.MX6 (Solo) igep0046sx
IGEP SMARC i.MX6 (Dual Lite) igep0046dl
IGEP SMARC i.MX6 (Quad) igep0046q
IGEPv5 igep0050
IGEPv5 SMARC igep0055
  igep0057
IGEP SMARC i.MX8 igep0060
IGEP SMARC i.MX6 (Ultra Lite) igep0146
sopa0000

The following table provides you the information about the different igep distributions. It is provided the DISTRO=distro-name and the description of it.

distro-name Description
isee-release Rootfs with sysV suite and x11
isee-release-no-x11 Rootfs with sysV suite and without x11
isee-systemd Rootfs with systemd suite and x11
isee-systemd-no-x11 Rootfs with systemd suite and without x11

As a final example using this command

MACHINE=igep0034 DISTRO=isee-release-no-x11 bitbake igep-minimal-image

Produces a minimal rootfs (sysV suite, withuot X11), 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.


Information.jpg When you are bitbaking an image with X support  you MUST set DISTRO=distro-name compatible with X environment.


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

 

Compatibility Chart

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
machine-name mrskeltal minimal basic basicX full sato lxde custom
igep0002                
igep0010                
igep0020                
igep0030                
igep0033                
igep0034                
igep0035                
igep0036                
igep0040                
igep0045                
igep0046sx                
igep0046dl                
igep0046q                
igep0050                
igep0055                
igep0057                
igep0060                
igep0146                
sopa0000                


How to develop with Yocto Project