Yocto Project Quick Start Guide for Ubuntu

Yocto is an embedded Linux build system used to create a Linux distribution for a specific application/board combination. I’ll describe 2 methods to get started:

  • Building and running  a qemu image for x86 from scratch
  • Using pre-built binaries to run the x86 image in qemu

This is a shorter version of the longish Yocto Project’s Quick Start Guide. The official guide is more complete (explains all details) and give instructions for several distributions, whereas this guide simply lists each step and is focused on Ubuntu. So you could use this guide to start the build, and during the build (which will last a while), read the official guide to actually understand how it all works.

Yocto Project in QEMU with SATO UI
Yocto Sato User Interface Running in QEMU

 

Prerequisites

First, you need to use bash instead of dash in Ubuntu:


and select “No” to use bash.

Then install the required packages with apt-get:

Building and running a qemu image for x86 from scratch

Download and extract the latest version of Yocto:


Setup the environment to build the binary images with Yocto:


If you are short in disk space (The build requires up to 50GB), add the following line to edison-6.0-build/conf/local.conf:


If you have a multi-core build machine, also set BB_NUMBER_THREADS and PARALLEL in local.conf, respectively to twice and 1.5 times the number of cores in order to speed up compilation.

You can then start building the OS binaries for sato, a GNOME mobile-based UI:


core-image-sato build requires 45 GB to build. If your space is limited you could build core-image-mininal (17GB required) which is a distribution with command line only.

The build can take a very long time. I’ve built core-image-minimal in a Virtual Box machine running Ubuntu with 1GB RAM and it tools nearly 2 days. core-image-sato took nearly 48 hours in a notebook running Ubuntu 10.04.

Once the build completes, time to run qemu:

Using pre-built images

Create a working directory, download and extract the binary toolchain:


Download the pre-build kernel and rootfs image for qemu x86:


If you want another rootfs (e.g. sato), you can download it from http://downloads.yoctoproject.org/releases/yocto/yocto-1.1/machines/qemu/

Set the environment:


Finally run qemu:


I have tested this in Ubuntu 11.10 (Virtual Box), the build completed, but for both methods qemu only showed a black screen. Running those images in Debian Squeeze 6.0.3 (Virtual Box) and Ubuntu 10.04 LTS (Native) worked perfectly.

That’s all your need to get started with Yocto. Now you need to customize it in order to build a distribution for your target system. If you have a Beagleboard, you could check out the pre-built images at http://downloads.yoctoproject.org/releases/yocto/yocto-1.1/machines/beagleboard/.

You can learn more by visiting the Yocto Project website and also reading some of my previous Yocto posts with an overview and links to several videos and presentation slides about the Yocto Project.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC