Building your own recipes from first principles: Difference between revisions

From Yocto Project
Jump to navigationJump to search
(Created page with " 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 alrea...")
 
No edit summary
Line 1: Line 1:
 
==Overview==
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.
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.
Line 10: Line 7:
The following assumptions are made. You are:
The following assumptions are made. You are:


- familiar with basic Linux admin tasks
* familiar with basic Linux admin tasks
- using Ubuntu 12.04 LTS as your build system
* using Ubuntu 12.04 LTS as your host build system
- working with Yocto 1.6 (daisy) release  
* working with Yocto 1.6 (daisy) release  


(1) Obtain the required packages for your host system to support Yocto
==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.
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
  $ 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
Full details of system requirements and installation can be found in the Yocto Quickstart [http://www.yoctoproject.org/docs/1.6/yocto-project-qs/yocto-project-qs.html here]
                  
                  
(2) Download and extract the Yocto 1.6 release
==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
At the time of writing, the current release of Yocto (1.6) release can be found [https://www.yoctoproject.org/download/yocto-project-16 here]
   
   
$ cd ~
  $ cd ~
$ mkdir yocto
  $ mkdir yocto
$ wget http://downloads.yoctoproject.org/releases/yocto/yocto-1.6/poky-daisy-11.0.0.tar.bz2
  $ 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
  $ 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.
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
==Configure the build environment to build an emulator image==


$ cd ~/yocto/poky-daisy-11.0.0
  $ cd ~/yocto/poky-daisy-11.0.0
$ source oe-init-build-env build_qemux86
  $ 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.  
This will create a build tree in "build_qemux86" although you could use a different name if you so wish 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.
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
[code]oe-init-build-env] will create a default configuration file in [code]conf/local/conf[/code] which will build an emulator image suitable for execution with [code]qemu[/code]
 
==Build a baseline image==


After configuring the environment you will be left in the build_qemux86 folder.
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)
You should then build a baseline image, which will take some time (numbers of hours)


$ bitbake core-image-minimal
  $ bitbake core-image-minimal

Revision as of 18:02, 9 May 2014

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 host build system
  • working with Yocto 1.6 (daisy) release

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

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

 $ 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.

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 wish 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.

[code]oe-init-build-env] will create a default configuration file in [code]conf/local/conf[/code] which will build an emulator image suitable for execution with [code]qemu[/code]

Build a baseline image

After configuring the environment you will be left in the build_qemux86 folder.

You should then build a baseline image, which will take some time (numbers of hours)

 $ bitbake core-image-minimal