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 by David-John Willis, 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
BBLAYERS ?= " \ /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.
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?
I’ve not done much customization of Yocto Project builds. You’ll find your answers by looking at the meta-rapsberrypi BSP linked above. The Yocto Project Linux Kernel Development Manual should answer most of your remaining questions.
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.
The build works with commit 2d1660112e54653f7bb763939d0416472c49fe01 on branch master of http://git.yoctoproject.org/git/poky. Haven’t tried building since.
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
This process worked very well, with only large delays cloning the various repos during the build. The output image booted the first time that the yocto build completed.
Thanks !
You’re welcome! Glad it worked.
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!
thanks for pointing this out.. saved me some time :)
git clone from repository…. download packages suck as poky and meta-raspberrypi. to work on bsp layers