Table of Contents

Building XBian Packages

XBian actually only contains a small set of applications and tools presented to the user under the form of deb packages, installable on top of a Debian-based GNU/Linux distribution:

Raspbian (stable version, named Wheezy), the leading Debian-based GNU/Linux distribution optimized for the Raspberry Pi;

Debian (testing version, named Jessie) for SolidRun's CuBox-i.

All of the CuBox-i devices are supported: Solo, Dual Lite, Dual, Quad and even the HummingBoard.

Until decided otherwise, as you may have noticed the 2 platforms use different Debian versions.

Fortunately both use ARM architectures, ARMv6 for the Raspberry Pi and ARMv7 (i.MX6) for CuBox-i, are binary-compatible, so there's no need to compile each binary twice. It's only needed in case the target systems use different libraries so the binary would be linked wrong.

Repositories

All of XBian's packages have their own repository. Each repository contains all the necessary build configuration, patches, and scripts to allow easy building and deployment. All packages follow the same structure and all can be processed automatically by XBian's build scripts located at xbianonpi/xbian.

I wanna be a developer or create my own package

If you want to participate in the development of XBian (we'd be more than happy!) or just want to build a package for your own private use, that's easy:

you need a build system: any GNU/Linux is fine. CPU architecture is not relevant: x86_64, Sparc or even ARM).\\Only requirements are a connection to the Internet, Git, QEMU and build tools for the ARM architecture

in the directory where the repository was cloned, execute the build.package script, e.g. sh build.package

The behaviour of the scripts can be set in many ways through config files which are part of build package (nit the scripts), but by default they come preconfigured for following actions: a) original sources are cloned locally
b) XBian patches and changes are applied
c) sources are preconfigured & configured with XBian's settings
d) sources are build
e) binaries are installed into package template folder
f) package is build and compressed into single .deb file

We can prepare Wheezy & Jessie environments with help of debootstrap tool available for Debian and Ubuntu systems.

After packages are downloaded and command finishes, we have to finalize the install by unpacking and configuring all the packages. this is again handled automatically by debootstrap. just we need it to run in target arch environment via chroot.

This will install ~150-200mb of packages. We just need few more packages to install to be able later to compile any of XBian's packages. this we will install from upstream repositories and from XBian repository. To access the upstream repositories (in that first case raspberian/armhf/wheezy) we have to edit the /etc/apt/sources.list in the chroot ./armhfwheezy directory again. In there, we put

After packages are downloaded and command finishes, we have to finalise the install by unpacking and configuring all the packages. this is again handled automatically by debootstrap. just we need it to run in target arch environment via chroot.

You can add any user (even not root) as needed and for sure change directory= to reflect actual directories you debootstrapped our buildroots into. For simple test we can now try:

schroot -c armhfwheezy (or armhfjessie)

If you get output like this and no error, all is fine

mk@debian:~$ schroot -c armhfjessie
(armhfjessie)mk@debian:~$

Now we only have to clone the repos we want to build into one directory, copy build.package and gen.package from xbianonpi into that directory as well. Then just descent into package directory you want to build and run ./run.me. by default this would try to compile .deb packages for all supported architectures. This can be specific by calling ./run.me -m rpi. only for Raspberry Pi will be prepared.

Build scripts are able to utilize all available CPUs in the system for parallel building. To allow that, export MAKEFLAGS='-jX' where X the degree of parallel processes allowed. Usually this is set to match number of CPUs so general approach would be for instance putting following line into ~/.profile

export MAKEFLAGS="-j$(grep -c processor /proc/cpuinfo )"

Troubleshoot

If you get the perl error about locales, run the apt-get install step again after you did this: