Yocto

From ArchWiki
Revision as of 12:11, 4 August 2015 by Soderstrom (talk | contribs) (Created an initial description of how to get Yocto working in Arch Linux. Please feel free to give feedback and discuss this page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Arch Linux is currently not validated to work with Yocto/Poky, and it used to require changing the build script. That is no longer the case. This guide is written with respect to YP Core 1.8 (Fido) and newer.

Installation

Multilib

Enable Multilib repository by uncommenting both of these lines in /etc/pacman.conf

[multilib]
Include = /etc/pacman.d/mirrorlist

Then update the package list and upgrade with pacman -Syu.

Install dependencies

pacman -S git diffstat unzip texinfo python2 chrpath \
          gcc-multilib wget xterm sdl socat cpio

You may recieve the following conflicts

:: gcc-multilib and gcc are in conflict. Remove gcc? [y/N] y
:: gcc-libs-multilib and gcc-libs are in conflict. Remove gcc-libs? [y/N] y

Resolve these by choosing 'y' (we actually want the multilib versions)


Test your installation

In order to test that yocto is properly working, we will build core-image-minimal

Clone the git repository

Before we begin we need to clone the official git repository. Here we will use the fido branch.

$ git clone --branch fido git://git.yoctoproject.org/poky.git poky

python2

Yocto currently requires the use of python2, but the default in Arch Linux is python3. In the Python page there is an explanation about how to trick the environment.

We will do almost the same, but also add a simple script file so that it can be easily sourced later.

$ mkdir -p ~/bin/python2
$ ln -s /usr/bin/python2 ~/bin/python2/python
$ ln -s /usr/bin/python2-config ~/bin/python2/python-config

Now create the file ~/bin/python2-env and insert the following text within it

export PATH=~/bin/python2:$PATH

Setup and build the minimal image

First you need to source the python2-env file we just created and then initialize the yocto environment. In the example below we create a folder named build-qemux86, the source command will also place you in this folder. From here we can now build the core-image-minimal.

$ cd poky
$ source ~/bin/python2-env && source oe-init-build-env build-qemux86
$ bitbake core-image-minimal

This will take some time to complete. For more details about yocto there is a Quick Start Guide