Setup Yocto Environment

From RidgeRun Developer Wiki





Follow Us On Twitter LinkedIn Email Share this page



Preferred Partner Logo 3



Install Host Packages

You must install essential host packages on your build host. First make sure your host PC is up to date (on a Ubuntu distribution):

sudo apt-get update

Then, install the following required packages:

sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping libsdl1.2-dev xterm libyaml-dev libssl-dev

sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev sed cvs subversion coreutils texi2html docbook-utils help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev bc rename zstd libgnutls28-dev

sudo apt-get install python3-git liblz4-tool python3-jinja2 python3-subunit locales libacl1

# For Ubuntu 20.04 and earlier
sudo apt-get install python python-pysqlite2

# For Ubuntu 22.04 and newer
sudo apt-get install python-is-python3

Setup Repo

Repo is a tool built on top of Git that helps manage many Git repositories. The repo command is an executable Python script that you can put anywhere in your path. To install it run the following steps:

Configure git user and email:

git config --global user.name "Your Name"

git config --global user.email "Your Email"

Create a bin folder in the home directory and download repo:

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

Add the following line to the .bashrc file to ensure the ~/bin folder is in your PATH variable.

export PATH=~/bin:$PATH

Setup Yocto Project

Create your working directory:

mkdir ${HOME}/oe-core
cd ${HOME}/oe-core

Initialize the Toradex manifest (replace <version> with the BSP version you want) (You can check BSP versions on the following link):

repo init -u git://git.toradex.com/toradex-manifest.git \
-b refs/tags/<version> \
-m tdxref/default.xml

Then sync all the layers:

repo sync

This downloads these layers:

  • OpenEmbedded core layers
  • Toradex BSP layers
  • NXP layers required for Verdin iMX95
  • All dependencies matching the selected BSP version

After the layers are downloaded, source the export file to setup the environment.

. export

Sourcing the export file for the first time should also create and prepare the build directory. Every time a new shell is opened, this file should be sourced to setup the environment.