Setup Yocto Build Environment

From Estone Technology Wiki
Jump to: navigation, search

Previous Section: EMB-2238 Main Page

Yocto Build Environment Setup

The following steps have been tested on Ubuntu 16.04 LTS. An internet connection is required to finish this tutorial

  • Check and install update for Ubuntu by inputing the following command to the terminal.
$ sudo apt-get update

Setting up the Ubuntu development host

A Yocto Project build requires that some packages be installed for the build based on your specific machine.

Essential Yocto Project Host Packages

$ sudo apt-get install 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
$ sudo apt-get install libsdl1.2-dev xterm
$ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
$ sudo apt-get install python-git
$ sudo apt-get install sed cvs subversion coreutils texi2html python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
$ sudo apt-get install uboot-mkimage (Ubuntu 12.04 LTS)
$ sudo apt-get install u-boot-tools

Setting up the repo utility

1. Create a bin folder in the home directory.
(this step may not be needed if the <~/bin> folder already exists)

$ mkdir ~/bin 
$ curl > ~/bin/repo
$ chmod a+x ~/bin/repo
$ nano ~/.bashrc

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

$ export PATH=~/bin:$PATH

Git Project Setup

First make sure that git is set up properly with the commands below.

$ git config --global "Your Name"
$ git config --global "Your Email"
$ git config --list

Build Sources

The recipes used to build the project come from both the community and i.MX. The Yocto Project layers are downloaded to the sources directory. This sets up the recipes that are used to build the project. The following example shows how to download the i.MX Yocto Project Community BSP recipe layers. For this example, a directory called imx-yocto-bsp is created for the project. Any name can be used instead of this.

Note: For regular build follow <iMX8M Sources> steps below. For Sources with Alexa-AVS dependencies follow <iMX8M Sources - Alexa-AVS> steps below.

iMX8M Sources

$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u -b master -m imx-alexa-sdk-4.9.51-8mq_ga.xml
$ repo sync

iMX8M Sources - Alexa-AVS

$ mkdir imx-yocto-bsp
$ cd imx-yocto-bsp
$ repo init -u -b master -m imx-alexa-sdk-4.9.51-8mq_ga.xml
$ repo sync

Next Section: Build and Install SDK