Yocto: Difference between revisions
Mschmoeller (talk | contribs) No edit summary |
|||
Line 18: | Line 18: | ||
|- align="center" | |- align="center" | ||
| Krogoth || 2.1 | | Krogoth || 2.1 | ||
|- align="center" | |||
| Thud (i.MX6ull only)|| 2.6 | |||
|} | |} | ||
Line 24: | Line 26: | ||
More information about Yocto stable branch maintenance at [https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance https://wiki.yoctoproject.org/] | More information about Yocto stable branch maintenance at [https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance https://wiki.yoctoproject.org/] | ||
== Setup Yocto Build System == | == Setup Yocto Build System (Thud - i.MX6ull only) == | ||
==== Install Required Host Packages ==== | |||
Install the required packages for your host development system. The Yocto Project documentation has a listing of install commands for many different linux host systems (Debian, Ubuntu, etc.). | |||
[http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#required-packages-for-the-host-development-system Required Packages for the Host Development System] | |||
==== Download and Install Google's repo utility ==== | |||
The BSP is based on the Yocto Project, which consists of a number of applicable metadata 'layers'. These are managed by the repo utility.<br /> | |||
$: mkdir ~/bin | |||
$: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo | |||
$: chmod a+x ~/bin/repo | |||
==== Create the BSP directory to download all of the metadata for the BSP layers ==== | |||
Note: You can use your own BSP directory. In the following we use <code>~/dhcom-yocto-bsp</code> | |||
$: PATH=${PATH}:~/bin | |||
$: cd | |||
$: mkdir dhcom-yocto-bsp | |||
$: cd dhcom-yocto-bsp | |||
==== Initialize the repositories ==== | |||
For Thud: | |||
$: repo init -u https://github.com/dh-electronics/dhcom_imx6-bsp-platform -b thud | |||
==== Download all of the metadata for the BSP layers ==== | |||
$: repo sync | |||
Once this has completed, you should have all of the metadata source of DHCOM and Freescale Community BSP in dhcom-yocto-bsp. | |||
== Setup environment and build an image (Thud- i.MX6ull only) == | |||
start a build, first set the MACHINE shell environment variable to set the machine. These are: <br/> | |||
{| border="1" style="border-collapse:collapse; height:150px; width:500px; margin: 1em auto 1em auto;" | |||
|+DHCOM i.MX6 Machines in Yocto | |||
! Board Type !! HW !! MACHINE | |||
|- align="left" | |||
| DHCOM i.MX6 ULL|| 100 || <code> dhcom1bimx6ull </code> | |||
|} | |||
For example, if you have a DHCOM i.MX6 Duallite HW300, then use MACHINE "dhcom3bimx6dl". | |||
Run the <code>setup-environment</code> script. This is a helper script which sets up the environment and creates a build directory for you. The first time you run this, you will be asked to accept the Freescale end user license agreement (EULA). | |||
$: MACHINE=dhcom1bimx6ull source ./setup-environment build | |||
Run bitbake with <code>core-image-minimal</code> as its argument. This will create a small image and should have the shortest possible build time. Note: all of the sources are downloaded from the internet and built from scratch. This includes the toolchain (gcc) and all of the native utilities, so building an image for the first time could take a few hours, depending on the performance of your host machine. | |||
$: bitbake core-image-minimal | |||
==== Locating the images and installing to a microSD card ==== | |||
Once the image is built successfully, there are several target images that are built by default. One of these is an image suitable for loading directly into an SD card. It contains all of the required binaries (bootloader, kernel, filesystem) in a preformatted binary image. | |||
You can find the image at: | |||
build/tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.wic.gz | |||
The <code>.wic.gz</code> image can be unziped with <code>gunzip</code> and copied to an SD card with the <code>dd</code> command: | |||
$ gunzip -c tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.wic.gz | sudo dd of=/dev/sd<N> bs=1M iflag=fullblock oflag=direct conv=fsync status=progress | |||
Note: '''<MACHINE>''' in the above corresponds to the MACHINE name provided to bitbake. '''"N"''' in the above command is the letter assigned to the SD card. This will vary depending on your host machine configuration. | |||
== Setup Yocto Build System (Krogoth & Dizzy) == | |||
==== Install Required Host Packages ==== | ==== Install Required Host Packages ==== | ||
Line 80: | Line 147: | ||
${BSPDIR}/sources/meta-dhcom_imx6 \ | ${BSPDIR}/sources/meta-dhcom_imx6 \ | ||
== Setup environment and build an image == | == Setup environment and build an image (Krogoth & Dizzy) == | ||
To start a build, first set the MACHINE shell environment variable to set the machine. These are: <br/> | To start a build, first set the MACHINE shell environment variable to set the machine. These are: <br/> |
Revision as of 14:53, 14 March 2019
For general information about the Yocto Project please refer to the official Website. "Yocto is not an embedded Linux distribution – it creates a custom one for you." This says that if you are using Yocto to build your system image you are the distributor. If you're not aware of what this means for you please contact us.
Requirements hardware and software
- Linux-based (Debian/Ubuntu is recommended) host system to use for building Linux/Yocto
- min 4GB RAM / > 8GB RAM are recommended
- disk space (depending on image to build about 80 GB)
- a microSD card-reader to write the generated image to the microSD card
Supported Stable Branch
With our OpenEmbedded / Yocto BSP Layer for DHCOM i.MX6 we support the following branches:
Name | Version |
---|---|
Dizzy | 1.7 |
Krogoth | 2.1 |
Thud (i.MX6ull only) | 2.6 |
Our BSP layer is based on the Freescale Community BSP.
More information about Yocto stable branch maintenance at https://wiki.yoctoproject.org/
Setup Yocto Build System (Thud - i.MX6ull only)
Install Required Host Packages
Install the required packages for your host development system. The Yocto Project documentation has a listing of install commands for many different linux host systems (Debian, Ubuntu, etc.).
Required Packages for the Host Development System
Download and Install Google's repo utility
The BSP is based on the Yocto Project, which consists of a number of applicable metadata 'layers'. These are managed by the repo utility.
$: mkdir ~/bin $: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $: chmod a+x ~/bin/repo
Create the BSP directory to download all of the metadata for the BSP layers
Note: You can use your own BSP directory. In the following we use ~/dhcom-yocto-bsp
$: PATH=${PATH}:~/bin $: cd $: mkdir dhcom-yocto-bsp $: cd dhcom-yocto-bsp
Initialize the repositories
For Thud: $: repo init -u https://github.com/dh-electronics/dhcom_imx6-bsp-platform -b thud
Download all of the metadata for the BSP layers
$: repo sync
Once this has completed, you should have all of the metadata source of DHCOM and Freescale Community BSP in dhcom-yocto-bsp.
Setup environment and build an image (Thud- i.MX6ull only)
start a build, first set the MACHINE shell environment variable to set the machine. These are:
Board Type | HW | MACHINE |
---|---|---|
DHCOM i.MX6 ULL | 100 | dhcom1bimx6ull
|
For example, if you have a DHCOM i.MX6 Duallite HW300, then use MACHINE "dhcom3bimx6dl".
Run the setup-environment
script. This is a helper script which sets up the environment and creates a build directory for you. The first time you run this, you will be asked to accept the Freescale end user license agreement (EULA).
$: MACHINE=dhcom1bimx6ull source ./setup-environment build
Run bitbake with core-image-minimal
as its argument. This will create a small image and should have the shortest possible build time. Note: all of the sources are downloaded from the internet and built from scratch. This includes the toolchain (gcc) and all of the native utilities, so building an image for the first time could take a few hours, depending on the performance of your host machine.
$: bitbake core-image-minimal
Locating the images and installing to a microSD card
Once the image is built successfully, there are several target images that are built by default. One of these is an image suitable for loading directly into an SD card. It contains all of the required binaries (bootloader, kernel, filesystem) in a preformatted binary image.
You can find the image at:
build/tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.wic.gz
The .wic.gz
image can be unziped with gunzip
and copied to an SD card with the dd
command:
$ gunzip -c tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.wic.gz | sudo dd of=/dev/sd<N> bs=1M iflag=fullblock oflag=direct conv=fsync status=progress
Note: <MACHINE> in the above corresponds to the MACHINE name provided to bitbake. "N" in the above command is the letter assigned to the SD card. This will vary depending on your host machine configuration.
Setup Yocto Build System (Krogoth & Dizzy)
Install Required Host Packages
Install the required packages for your host development system. The Yocto Project documentation has a listing of install commands for many different linux host systems (Debian, Ubuntu, etc.).
Required Packages for the Host Development System
Download and Install Google's repo utility
The BSP is based on the Yocto Project, which consists of a number of applicable metadata 'layers'. These are managed by the repo utility.
$: mkdir ~/bin $: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $: chmod a+x ~/bin/repo
Create the BSP directory to download all of the metadata for the BSP layers
Note: You can use your own BSP directory. In the following we use ~/fsl-community-bsp
$: PATH=${PATH}:~/bin $: cd $: mkdir fsl-community-bsp $: cd fsl-community-bsp
Initialize the repositories
The next step is to initialize the repositories. This establishes which branch of the repository will be used for your development. The master branch is the current development branch.
Note: The master branch is a development branch, not a stable branch. It is constantly changing with code updates, the adding of new features, and so forth.
For Dizzy use: $: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b dizzy For Krogoth use: $: repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b krogoth
Download all of the metadata for the BSP layers
$: repo sync
Once this has completed, you should have all of the metadata source of the Freescale Community BSP in fsl-community-bsp.
Add DHCOM i.MX6 BSP layer
To clone the OpenEmbedded / Yocto BSP layer for DHCOM i.MX6 execute the following steps:
$: cd fsl-community-bsp/sources For Dizzy use: $: git clone -b dizzy https://github.com/dh-electronics/meta-dhcom_imx6.git For Krogoth use: $: git clone -b krogoth https://github.com/dh-electronics/meta-dhcom_imx6.git
Edit ~/fsl-community-bsp/build/conf/bblayers.conf
(run bitbake once to create build directory, see 'Setup environment and build an image') to add the meta-dhcom_imx6 layer at the end:
${BSPDIR}/sources/meta-dhcom_imx6 \
Setup environment and build an image (Krogoth & Dizzy)
To start a build, first set the MACHINE shell environment variable to set the machine. These are:
Board Type | HW | MACHINE |
---|---|---|
DHCOM i.MX6 Solo | 200 | dhcom2bimx6s (former dhcomimx6s)
|
DHCOM i.MX6 DualLite | 200 | dhcom2bimx6dl (former dhcomimx6dl)
|
DHCOM i.MX6 Dual | 200 | dhcom2bimx6d
|
DHCOM i.MX6 Quad | 200 | dhcom2bimx6q (former dhcomimx6q)
|
DHCOM i.MX6 Solo | 300 | dhcom3bimx6s
|
DHCOM i.MX6 DualLite | 300 | dhcom3bimx6dl
|
DHCOM i.MX6 Dual | 300 | dhcom3bimx6d
|
DHCOM i.MX6 Quad | 300 | dhcom3bimx6q
|
DHCOM i.MX6 Solo | 400 | dhcom4bimx6s (new)
|
DHCOM i.MX6 DualLite | 400 | dhcom4bimx6dl (new)
|
DHCOM i.MX6 Dual | 400 | dhcom4bimx6d (new)
|
DHCOM i.MX6 Quad | 400 | dhcom4bimx6q (new)
|
For example, if you have a DHCOM i.MX6 Duallite HW300, then use MACHINE "dhcom3bimx6dl".
Run the setup-environment
script. This is a helper script which sets up the environment and creates a build directory for you. The first time you run this, you will be asked to accept the Freescale end user license agreement (EULA).
$: MACHINE=dhcom3bimx6dl source ./setup-environment build
Run bitbake with core-image-minimal
as its argument. This will create a small image and should have the shortest possible build time. Note: all of the sources are downloaded from the internet and built from scratch. This includes the toolchain (gcc) and all of the native utilities, so building an image for the first time could take a few hours, depending on the performance of your host machine.
$: bitbake core-image-minimal
Locating the images and installing to a microSD card
Once the image is built successfully, there are several target images that are built by default. One of these is an image suitable for loading directly into an SD card. It contains all of the required binaries (bootloader, kernel, filesystem) in a preformatted binary image.
You can find the image at:
build/tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.sdcard
The .sdcard
image can be directly copied to an SD card with the dd
command:
$ sudo dd if=tmp/deploy/images/<MACHINE>/core-image-minimal-<MACHINE>.sdcard of=/dev/sd<N> bs=1M
Note: <MACHINE> in the above corresponds to the MACHINE name provided to bitbake. "N" in the above command is the letter assigned to the SD card. This will vary depending on your host machine configuration.
Running the image on DHCOM i.MX6
As this is just a console image, you will need a serial terminal program such as minicom in order to interact with the board and run commands. Simply plug the microSD card into the slot on the DHCOM i.MX6 module and apply power. You should immediately see log messages in the serial terminal. When complete, you should get a login prompt:
Poky (Yocto Project Reference Distro) 2.1.2 dhcom3bimx6dl /dev/ttymxc0
dhcom3bimx6dl login:
The default login username is 'root' and there is no password.
Other interesting images
The image core-image-minimal
builds relatively quickly due to its small size. It is a good image to test to see if your board works. There are other images that you can also try, but can take a good deal longer to build.
Image | Description |
---|---|
core-image-base | Basic image with kernel modules and other features |
core-image-x11 | Basic image with X11 support |
core-image-sato | Image with Sato, a mobile environment and visual style for mobile devices. The image supports X11 with a Sato theme, Pimlico applications, and contains terminal, editor, and file manager. |
Example Configurations
External References
- The content of this tutorial heavily borrowed from i.MX6 Wandboard Wiki 'Getting started with Yocto on Wandboard'
- Have a look at 'Building Qt5 using yocto on Wandboard' to get information for adding Qt5
- Documentation of the latest Yocto Project Releases
- More additional information on Freescale Yocto Project Main-Page