Building Poky with Wayland and Weston for Raspberry Pi 2 using the Yocto Project
Introduction
Raspberry Pi 2 Model 2 is second version of the most popular single board computer. It has ARMv7 processor from Broadcom and the same GPU as is the first Raspberry Pi version - VideoCore IV.
Yocto is an umbrella project of the Linux Foundation with tools for building and maintaining a GNU/Linux distribution for embedded devices. Poky is its reference implementation that contains meta layers and recipes for building a distribution from scratch. It supports both X11 and Wayland display server protocols.
In this example we will build a Poky image for Raspberry Pi 2 Model B with Wayland and its reference implementation Weston with enabled hardware graphics acceleration. It is recommended to use a powerful personal computer (for example: Intel Core i7 CPU, 8GB RAM, at least 80GB free disk space) with a GNU/Linux distribution, in my case Ubuntu.
Cook an Image for Raspberry Pi 2
Follow the steps below to build an image for Raspberry Pi with Wayland and Weston using the Yocto Project. Jethro, the latest release of the Yocto project by the time of writing (updating) this tutorial, will be used.
Get all Yocto meta layers
Get Poky:
git clone -b jethro git://git.yoctoproject.org/poky.git poky-rpi2
cd poky-rpi2
Run the following command to build Poky image with Wayland and Weston for Raspberry Pi 2:
bitbake core-image-weston
Grab a cup of coffee and calmly wait until the end of the build procedure. Depending on the hardware of your computer it may take up to several hours.
Plug a microSD card to your computer, replace X with its corresponding ID (which can be found through commands like lsblk or fdisk -l) and execute the following commands to flash the image on it:
Alternatively, if you prefer you can use bmaptool instead of dd.
Connect a keyboard, a mouse and a monitor to your Raspberry Pi 2. Plug the microSD card and turn on the board. Your GNU/Linux distribution with Wayland and Weston should boot in a few seconds. Enjoy it :)
Build Configuration
If you experience any difficulties using this tutorial please try exactly the same versions of the meta layers as in my build configuration: