Building your own recipes from first principles
WORK IN PROGRESS
Overview
This walk-through has the aim of taking you from a clean system through to building and packaging a project for inclusion in an image.
You may already have Yocto installed and just be looking to work with recipes for the first time, in which case you can jump forward to the section you find most relevant.
The following assumptions are made. You are:
- familiar with basic Linux admin tasks - using Ubuntu 12.04 LTS as your build system - working with Yocto 1.6 (daisy) release
(1) Obtain the required packages for your host system to support Yocto
First we will install the required host packages for Ubuntu as detailed in the quickstart, i.e.
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath libsdl1.2-dev xterm
Full details of system requirements and installation can be found in the Yocto Quickstart here: http://www.yoctoproject.org/docs/1.6/yocto-project-qs/yocto-project-qs.html
(2) Download and extract the Yocto 1.6 release
At the time of writing, the current release of Yocto (1.6) release can be found here: https://www.yoctoproject.org/download/yocto-project-16
$ cd ~ $ mkdir yocto $ wget http://downloads.yoctoproject.org/releases/yocto/yocto-1.6/poky-daisy-11.0.0.tar.bz2 $ tar xjvf poky-daisy-11.0.0.tar.bz2
This will get you the Yocto 1.6 base meta-data and the bitbake tool. You can also add in extra layers, usually of the form "meta-foo" to provide machine support and additional functionality.
(3) Configure the build environment to build an emulator image
$ cd ~/yocto/poky-daisy-11.0.0 $ source oe-init-build-env build_qemux86
This will create a build tree in "build_qemux86" although you could use a different name if you so wished with no adverse effects.
It is entirely possible to have many build trees in parallel in different folders and to switch between them using oe-init-build-env.
(4) Build a baseline image
After configuring the environment you will be left in the build_qemux86 folder.
You should then build a baseline image as this will take some time (numbers of hours)
$ bitbake core-image-minimal