EMB-2237-AI: Setup Yocto Build Environment

From Estone Technology Wiki
Jump to: navigation, search

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 http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/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 user.name "Your Name"
$ git config --global user.email "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: Follow steps below to build sources for EMB-2237-AI

EMB-2237-AI Sources

$ mkdir emb-2237-ai
$ cd emb-2237-ai
$ mkdir rootfs
$ cd rootfs
$ repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-sumo -m imx-4.14.98-2.0.0_ga.xml
$ repo sync
$ cd ../