The first Rasperry Pi's boards have been shipped to their new owners and in response to high demand for an OpenELEC/XBMC image we have merged our RPi development work into our public github repository. The OpenELEC RPi project code that you can download has already been run by the XBMC team on pre-production Raspberry Pi boards so we know it can be used to build a working system; although we also know there are some issues that need solving and the complete package needs optimising.
Once the OpenELEC developers get their hands on their own production boards we will release a pre-built and supported OpenELEC RPi image alongside our normal ION, Fusion, Ultra and AppleTV (etc.) builds.
OpenELEC fully supports Raspberry Pi's main goal of providing a low cost platform for kids to develop programming, software and hardware development skills on. Through learning how to package and compile OpenELEC to run on Raspberry Pi you can build a working knowledge of the following essential “developer” skills:
Cross Compiling and Build Systems
The heart of the OpenELEC project is our software build system. It supports a software building technique called cross-compiling; the process of creating executable code that runs on one hardware platform from something other than that platform. Cross compiling is a crucial function for the OpenELEC project for the following reasons:
How to get the OpenELEC sources?
To build OpenELEC you will need a Linux system like Fedora, Ubuntu, ARCH Linux or SuSE Linux to use as your build-system. To “check out” OpenELEC's sources you must have the git software package installed. OpenELEC is hosted on github so the command to run is:
git clone git://github.com/OpenELEC/OpenELEC.tv.git
After doing this you will have an "OpenELEC.tv" folder. Change to this folder with:
OpenELEC is project based and each pre-built OpenELEC image has its own project folder. If you navigate to "projects/RPi" you will find the "options" file which defines the core packages and drivers used in the RPi project and the Linux kernel configuration. Another folder to look at is the "packages/" folder-tree which contains the build-scripts, patches, configs and meta (info) file for each software package included within OpenELEC.
To create an OpenELEC image for Raspberry Pi we need to tell the build-system the project and architecture to build for. The Raspberry Pi project uses the "arm" architecture so the “make” command to start the build process with is:
PROJECT=RPi ARCH=arm make
That’s all that’s needed! ..but make sure you type the command EXACTLY as shown here as the make command is case-sensitive.
The first thing the build-system does is check for the essential software packages it needs to function. If any are missing it “should” automatically download and install them for you. It may not work automatically on every Linux distro, but if it cannot install them automatically it will print a list of missing package-names on screen so you can install them manually.
The speed of the build process depends on the hardware you’re running. On “current” hardware with multi-core CPUs and several GB of RAM it can be as quick as 2.5 hours. If you are using older hardware it could run to 10-12 hours. The first time you build will always be slower as the build-system needs to download and cache the sources for each package we use. Future builds will run faster as the sources have been cached and only a small number of new or changed packages will need to be fetched.
Have some fun learning how to create your own OpenELEC build and use the development forum if you have any questions. The next part of this tutorial series will follow in a couple of days and will explain how to install OpenELEC on an SD-card and boot your Raspberry Pi.