System requirements:
Operating System: Yocto supports various Linux distributions as build environments, including Ubuntu, Debian, Fedora, and CentOS. The latest version of your chosen distribution should be installed on your build machine.
Required Packages: To build a Yocto image, you will need to install a number of development packages, including Git, curl, tar, and unzip. The exact packages required will depend on your build machine's operating system.
Disk Space: Building a Yocto image requires a significant amount of disk space. You should have at least 100 GB of free disk space per target available on your build machine to ensure that the build process can complete successfully.
Processor and Memory: A minimum of 16GB of RAM is available. Our recommendation is 32GB.
64GB RAM accelerates the build because you can keep most of the files in a RAM cache
A CPU with a minimum of eight cores
Network Connection: You will need a fast and reliable internet connection to download the necessary software and packages during the build process.
Linux User: Log into the build machine as a non-root user.
If you are a root user:
Add another user.
Log in as the non-root user before proceeding further.
Build time: The build time may take from 1 to 3 hours or even more according to machine configuration and speed.
Getting started for Yocto Kirkstone build.
Preparing the host system
There are some requirements to the host system.
Ubuntu 20.04.5
Tested distribution is currently Ubuntu 20.04.5 LTS. An installation-Image can be found here:
https://releases.ubuntu.com/20.04/ubuntu-20.04.5-desktop-amd64.iso
This should work as virtual machine (Virtual box ...) or bare-metal installation.
Yocto related base software
Needed tools are listed in the yocto documentation.
Execute the following commands to install them:
sudo apt install curl python tree gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool
Docker build images
The release builds are executed on docker images based on crops/poky:ubuntu-20.04
. The seconorth container images can be found in the SECO gitlab container registry
Development tools
Additional development tools that may be useful:
sudo apt install git minicom gdb-multiarch crossbuild-essential-armhf meld gedit nano cscope quilt qtcreator
Install the repo tool
If available the tool can also be installed from the distributions package manager. This directly downloads the latest version from google. See https://gerrit.googlesource.com/git-repo/ .
mkdir ~/bin # once curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo # once chmod a+x ~/bin/repo # once echo "export PATH=${PATH}:~/bin" >> ~/.bashrc # once source ~/.bashrc
Local Git setup:
git config --global user.name "Forename Name" # use your name instead git config --global user.email "my.name@example.com" # use your email instead
Download and build the SECO Northern Europe Yocto
This section describes steps to create a local build dir and how to use repo
to download all needed files. After that the build directory gets setup for one specific machine (imx6guf
, imx6ullguf
or imx8mguf
) and distribution (guf-wayland
) and a standard image is built.
Download source code
mkdir -p ~/projects/yocto-seco-ne cd ~/projects/yocto-seco-ne repo init -u https://git.seco.com/seco-ne/yocto/manifest.git -b kirkstone repo sync --no-clone-bundle
The repo tool stores its meta data in a hidden subdirectory called .repo
. The manifest file is stored at .repo/manifests/default.xml
and is used for the sync command which actually downloads the sources.
The selected branch is kirkstone.
After the download the resulting directory structure should look like this:
yocto-seco-ne$ tree -L 2 -a . ├── .conf │ ├── bblayers_imx6.conf │ ├── bblayers_imx8.conf │ ├── bblayers_imx8_dual-espresso.conf │ ├── .git -> ../.repo/projects/.conf.git │ ├── git-describe.inc │ ├── .gitignore │ ├── .gitlab-ci │ ├── .gitlab-ci.yml │ ├── .gitmodules │ ├── LICENSE.txt │ └── setup-environment ├── .repo │ ├── copy-link-files.json │ ├── manifests │ ├── manifests.git │ ├── manifest.xml │ ├── project.list │ ├── project-objects │ ├── projects │ ├── repo │ └── .repo_fetchtimes.json ├── setup-environment -> .conf/setup-environment └── sources ├── meta-freescale ├── meta-freescale-distro ├── meta-guf-distro ├── meta-guf-machine ├── meta-openembedded ├── meta-python2 ├── meta-qt5 ├── meta-seconorth-nogplv3 └── poky
Build
To get the build environment ready run the environment needs to be set up.
Accept the EULA agreement and proceed further.
For SECO i.MX8M platforms TANARO and Trizeps VIII Mini:
MACHINE=seco-mx8mm DISTRO=seconorth-wayland source ./setup-environment build
For SECO i.MX8MP platform Trizeps VIII Plus:
MACHINE=seco-mx8mm DISTRO=seconorth-wayland source ./setup-environment build
For the i.MX6Q/DL platforms SANTARO, SANTINO, SANTINO-LT, SANTOKA and other SAN* platforms if supported:
MACHINE=seco-mx6 DISTRO=seconorth-wayland source ./setup-environment build
Then build the default SECO Northern Europe image
bitbake seconorth-image
Installation
Installation using preinstalled Flash-N-GO System
After the image was built the files are located under build/tmp/deploy/images/seco-[mx8mp|mx8mm|...]/
. The files needed are installation file fng_install.sh
and the root file system seco-image6guf.tar.gz
. These files can be used in a Flash-N-Go System installation process.
See the Flash-N-Go System manual for more information.
GitLab access
It should not be necessary to have a SECO GitLab account to build the standard images. The public access should be sufficient to do that.
However, for customer specific layers and configurations, that are not publicly accessible, a SECO GiLab account is necessary. Contact a SECO Software expert or the Technical Support to get access.
You need too generate a key-pair and register this with your SECO GitLab account, see the gitlab docs.
ssh-keygen -t ed25519 -C "my.name@example.com" # use your email instead cat ~/.ssh/id_ed25529.pub
Copy and add the key content to your GitLab Profile User Settings -> SSH keys)
Frequently Asked Question's (FAQ)
What is Yocto and what is it used for?
Yocto is an open-source project that provides a set of tools and meta-data to build custom Linux distributions for embedded systems. Yocto can be used to build a customized Linux distribution for a specific target hardware platform, with specific packages and configurations.
2. What is the difference between Yocto and traditional Linux distributions?
Yocto provides a set of tools and meta-data to build custom Linux distributions, whereas traditional Linux distributions are pre-packaged and ready-to-use operating systems. Yocto allows you to create a custom distribution tailored to your specific needs, while traditional Linux distributions may not include all the packages and configurations you require.
3. How long does it take to build a Yocto image?
The time it takes to build a Yocto image can vary greatly depending on several factors, such as the size of the image, the hardware specifications of the build machine, and the network connectivity. A typical Yocto build on a fast machine with a good internet connection and adequate disk space can take anywhere from 30 minutes to several hours, depending on the size and complexity of the image being built.
4. Can I customize the packages included in a Yocto image?
Yes, you can customize the packages included in a Yocto image by modifying the meta-data used by the Yocto build system. You can add or remove packages, modify configuration files, and make other changes to the image as needed.
5. Can I use Yocto to build an image for a specific hardware platform?
Yes, Yocto can be used to build an image for a specific hardware platform. You need to specify the target hardware in the Yocto build configuration and provide any necessary device-specific meta-data.
6. What are the prerequisites for building a Yocto image?
Please view the prerequisites in the following link at the top of the page.
7. How to find weather the build is failing because of Internet issues?
Yocto builds consist of more than 1,500 components spread around the internet. Invasive man-in-the-middle proxies can prevent the builds from working by interfering with the end-to-end security built into some of the tooling (such as curl
or git
). If you have such an enviroment, please work with your local IT support staff for solutions because these will be specific to the network infrastructure your IT has chosen. We also recommend you read Yocto documentation on working with proxies.
Errors that indicate issues caused by proxies include:
fatal: unable to connect to github.com: github.com[0: 140.82.121.3]: errno=Connection timed out
.do_fetch. Failed to fetch URL.
fatal: unable to connect to git.yoctoproject.org:git.yoctoproject.org[0: 44.225.90.102]: errno=Connection timed out
.
You can also test for this:
curl -L https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz >go1.14.4.tar.gz
If that fails with curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt
, a proxy is being used.
8. How to clean the Yocto build?
We can use the following command to clean up the build in case of oe_runmake failures.
bitbake -c cleanall seconorth-image
9. What are the common build errors which could occur in the yocto build?
Hardware resources
Fetching problems
Kernel compile errors
UBI size is too small error
10. How to easily update and upgrade to the latest version of the downloaded packages?
We have two commands by which we can update and upgrade to the latest version of the packages.
sudo apt update sudo apt upgrade