Embedded Linux system for Raspberry Pi with Yocto Project

Yocto Project, and OpenEmbedded, have been making news lately as the toolchain to build custom embedded Linux systems. I decided to try and get a working Linux system up and running on a Raspberry Pi.

The procedure that follows uses the meta-raspberrypi BSP in tandem with Yocto Project poky.

Initialize the build by executing the following commands. I use an Ubuntu 14.04 VM with Parallels.

git clone http://git.yoctoproject.org/git/poky
git clone http://git.yoctoproject.org/git/meta-raspberrypi
git clone https://github.com/dv1/meta-gstreamer1.0.git
source poky/oe-init-build-env rpi-build

Append meta-raspberrypi and meta-gstreamer1.0 layers to BBLAYERS in conf/bblayers.conf. For example

  /home/parallels/yocto/poky/meta \
  /home/parallels/yocto/poky/meta-yocto \
  /home/parallels/yocto/poky/meta-yocto-bsp \
  /home/parallels/yocto/meta-gstreamer1.0 \
  /home/parallels/yocto/meta-raspberrypi \

Set MACHINE to raspberrypi in conf/local.conf.

Complete the build by executing

bitbake rpi-hwup-image

That will take a while.

After the build is complete, create an SD card with the following command. Remember to change /dev/sdb to the proper device name.

dd if=tmp/deploy/images/raspberrypi/rpi-hwup-image-raspberrypi.rpi-sdimg of=/dev/sdb

Boot Pi using the SD card. Command line output appears on the HDMI display, or the serial port on the expansion header. Login is root, with an empty password.


13 thoughts on “Embedded Linux system for Raspberry Pi with Yocto Project

  1. Please answer to these questions:
    1) What basic packages needed for raspberrypi?
    2) What if I want to add any package after my image is build?
    3) Do i need to repeat the complete process again?
    4) How can i add any driver (ex: TFT driver) to the build kernel image?
    5) How to add any desired applications to packages?

  2. is there a version of this that works?
    meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_3.12.26.bb do_configure apparently fails these days.

    1. I just built from latest commit on master and build fails. Log for whoever is willing and able to take a look and provide a patch…

      | DEBUG: Executing python function sysroot_cleansstate
      | DEBUG: Python function sysroot_cleansstate finished
      | DEBUG: Executing shell function do_configure
      | NOTE: make oldconfig
      | make: *** No rule to make target `oldconfig’. Stop.
      | ERROR: oe_runmake failed
      | WARNING: exit code 1 from a shell command.
      | ERROR: Function failed: do_configure

  3. When you execute “bitbake rpi-hwup-image”, it will show you a list of things that need to be installed, however when you try to install “makeinfo”, it will return with an error saying that the package wasn’t found. I guess Ubuntu has it listed as “texinfo” in their repository, so you’d type:
    “sudo apt-get install texinfo”.

    As for the issue with libsdl, you’ll need to simply install a package named “libsdl1.2-dev”. So,
    “sudo apt-get install libsdl1.2-dev”.

    Pretty simple fixes, but I figured I would spare everyone the headaches by simply posting my findings in the comments. Hope I helped!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s