Search by Tags

Build TorizonCore With Yocto

 

Article updated at 18 Sep 2020
Compare with Revision




Subscribe for this article updates

Select the version of your OS from the tabs below. If you don't know the version you are using, run the command cat /etc/os-release or cat /etc/issue on the board.

Torizon 5.0.0

Introduction

TorizonCore is the base operating system in which Torizon is built. It is a minimal Yocto-based embedded Linux image and, even though customers may usually stick to application development on top of containers, sometimes they may need to customize the base image for their needs.

Note: If you just want to start using TorizonCore as-is with no customization in the original image, see the Quickstart Guide for information on how to install it on your Toradex Computer-on-Module.

The Repo manifest for Toradex Embedded Linux TorizonCore and BSP layer setup for Yocto Project/Openembedded on Git repository contains a Repo manifest and setup scripts for the TorizonCore build system. If you want to modify, extend or port TorizonCore to a new hardware platform, this is the manifest repository to use.

The build system uses various components from the Yocto Project, most importantly the OpenEmbedded build system, the bitbake task executor and various application and BSP layers.

Toradex TorizonCore is based on Linux microPlatform from foundries.io and therefore requires the meta-lmp layer.

You have two options to build TorizonCore (and possibly any Yocto-based image):

  • Use a native distribution like Ubuntu to build TorizonCore. This is the way documented in this article.
    • Pros: has the advantage that you can easily understand what is going on.
    • Cons: you may be stuck on a certain Distribution Version which is supported by the Yocto Release where TorizonCore is built on; you need to install all dependencies by yourself in every new development machine.
  • Use a Docker container and build everything inside that container.
    • Pros: it has the advantage that it will work independently of the version of the host distribution; it works under Windows; the commands used inside the container are the exact same as if you would build on the native distribution.
    • Cons: it may seem to be more complicated at the first look.

This article complies to the Typographic Conventions for Torizon Documentation.

You can build TorizonCore natively under your favorite Linux flavor. However, not all distribution version/Yocto version combos are allowed. If your distribution is not supported you will get a warning when running your first bitbake command. In such cases, it may happen that your current distribution can't build TorizonCore. We recommend following the "Containerized TorizonCore Build" tab above if this happens.

Prerequisites

You must have a host PC configured with the following prerequisites:

Download Metadata

To configure the scripts and download the build metadata, do:

$ mkdir ~/bin
$ PATH=~/bin:$PATH

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

In addition, make sure you have Git user name and e-mail configured:

$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"

Run repo init to bring down the latest stable version of Repo. You must specify a URL for the manifest, which specifies the various repositories that will be placed within your working directory. Furthermore, a branch must be specified.

TorizonCore version Branch
5.x.y dunfell-5.x.y
0.0.0 master

Note: master is maintained to monitor changes in the external layers. Builds can be broken for a longer period of time. This branch is not recommended for productization.

To check out the latest TorizonCore release:

$ repo init -u https://git.toradex.com/toradex-manifest.git -b dunfell-5.x.y -m torizoncore/default.xml

A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.

To pull down the metadata sources to your working directory from the repositories as specified in the repo manifest, run:

$ repo sync --no-clone-bundle

When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

More rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation. You need root access to modify the TCP setting:

$ sudo sysctl -w net.ipv4.tcp_window_scaling=0
$ repo sync -j1

Setup Environment

Supported MACHINE targets (officially tested by Toradex):

  • apalis-imx6 - Apalis iMX6
  • apalis-imx8 - Apalis iMX8
  • apalis-imx8x - Apalis iMX8X V1.0B
  • apalis-imx8x-v11a - Apalis iMX8X V1.1A and newer
  • colibri-imx7 - Colibri iMX7 (eMMC & raw NAND*)
  • colibri-imx6 - Colibri iMX6
  • colibri-imx6ull - Colibri iMX6ULL*
  • colibri-imx8x - Colibri iMX8X V1.0C or newer
  • colibri-imx8x-v10b - Colibri iMX8X V1.0B
  • verdin-imx8mm - Verdin iMX8MM

Note: Raw NAND-based modules are currently supported only by experimental releases and they may not be supported in the stable versions of TorizonCore.

Supported image targets:

  • torizon-core-docker
  • torizon-core-podman

The default distribution (DISTRO) variable is automatically set to torizon, which is provided by the meta-toradex-torizon layer.

Setup the work environment by using the setup-environment script:

$ [MACHINE=<MACHINE>] source setup-environment [BUILDDIR]

If MACHINE is not provided, the script will list all possible machines and force one to be selected.

Start Building

To build the TorizonCore image:

The above setup script should properly prepare the environment with correct defaults. Additionally you'll want to modify the local.conf file by adding ACCEPT_FSL_EULA="1".

$ bitbake torizon-core-docker

Customization

The Yocto Project can be quite defying and hard to use. In the following documentation, we cover some basic functionality that is likely you will have to go through during your development:

It does not replace the official Yocto Project documentation, though. At the end of this page, we provide links to it, and you will most likely need to study it to some degree.

On TorizonCore all your custom layers must be version controlled by Git, due to how we include layer revision information with OSTree. More details are provided in the aforementioned article Hello World integration into OpenEmbedded.

Torizon 4.0.0

Introduction

TorizonCore is the base operating system in which Torizon is built. It is a minimal Yocto-based embedded Linux image and, even though customers may usually stick to application development on top of containers, sometimes they may need to customize the base image for their needs.

Note: If you just want to start using TorizonCore as-is with no customization in the original image, see the Quickstart Guide for information on how to install it on your Toradex Computer-on-Module.

The toradex-torizon-manifest project on Github repository contains a Repo manifest and setup scripts for the TorizonCore build system. If you want to modify, extend or port TorizonCore to a new hardware platform, this is the manifest repository to use.

The build system uses various components from the Yocto Project, most importantly the OpenEmbedded build system, the bitbake task executor and various application and BSP layers.

Toradex TorizonCore is based on Linux microPlatform from foundries.io and therefore requires the meta-lmp layer.

You have two options to build TorizonCore (and possibly any Yocto-based image):

  • Use a native distribution like Ubuntu to build TorizonCore. This is the way documented in this article.
    • Pros: has the advantage that you can easily understand what is going on.
    • Cons: you may be stuck on a certain Distribution Version which is supported by the Yocto Release where TorizonCore is built on; you need to install all dependencies by yourself in every new development machine.
  • Use a Docker container and build everything inside that container.
    • Pros: it has the advantage that it will work independently of the version of the host distribution; it works under Windows; the commands used inside the container are the exact same as if you would build on the native distribution.
    • Cons: it may seem to be more complicated at the first look.

This article complies to the Typographic Conventions for Torizon Documentation.

You can build TorizonCore natively under your favorite Linux flavor. However, not all distribution version/Yocto version combos are allowed. If your distribution is not supported you will get a warning when running your first bitbake command. In such cases, it may happen that your current distribution can't build TorizonCore. We recommend following the "Containerized TorizonCore Build" article if this happens.

Prerequisites

You must have a host PC configured with the following prerequisites:

Download Metadata

To configure the scripts and download the build metadata, do:

$ mkdir ~/bin
$ PATH=~/bin:$PATH

$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

In addition, make sure you have Git user name and e-mail configured:

$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"

Run repo init to bring down the latest stable version of Repo. You must specify a URL for the manifest, which specifies the various repositories that will be placed within your working directory. Furthermore, a branch must be specified.

TorizonCore version Branch
4.0.0 zeus
0.0.0 master

Note: master is maintained to monitor changes in the external layers. Builds can be broken for a longer period of time. This branch is not recommended for productization.

To check out the latest TorizonCore release:

$ repo init -u https://github.com/toradex/toradex-torizon-manifest -b zeus

A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.

To pull down the metadata sources to your working directory from the repositories as specified in the repo manifest, run:

$ repo sync --no-clone-bundle

When downloading from behind a proxy (which is common in some corporate environments), it might be necessary to explicitly specify the proxy that is then used by repo:

$ export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>
$ export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>@<proxy_server>:<proxy_port>

More rarely, Linux clients experience connectivity issues, getting stuck in the middle of downloads (typically during "Receiving objects"). It has been reported that tweaking the settings of the TCP/IP stack and using non-parallel commands can improve the situation. You need root access to modify the TCP setting:

$ sudo sysctl -w net.ipv4.tcp_window_scaling=0
$ repo sync -j1

Setup Environment

Supported MACHINE targets (officially tested by Toradex):

  • colibri-imx7 - Colibri iMX7 (eMMC & raw NAND*)
  • colibri-imx6 - Colibri iMX6
  • colibri-imx6ull - Colibri iMX6ULL*
  • colibri-imx8x - Colibri iMX8X V1.0C or newer
  • colibri-imx8x-v10b - Colibri iMX8X V1.0B
  • apalis-imx6 - Apalis iMX6
  • apalis-imx8 - Apalis iMX8
  • apalis-imx8x - Apalis iMX8X
  • verdin-imx8mm - Verdin iMX8MM

Note: Raw NAND-based modules are currently supported only by experimental releases and they may not be supported in the stable versions of TorizonCore.

Supported image targets:

  • torizon-core-docker
  • torizon-core-podman

The default distribution (DISTRO) variable is automatically set to torizon, which is provided by the meta-toradex-torizon layer.

Setup the work environment by using the setup-environment script:

$ [MACHINE=<MACHINE>] source setup-environment [BUILDDIR]

If MACHINE is not provided, the script will list all possible machines and force one to be selected.

Start Building

To build the TorizonCore image:

The above setup script should properly prepare the environment with correct defaults. Additionally you'll want to modify the local.conf file by adding ACCEPT_FSL_EULA="1".

$ bitbake torizon-core-docker