Please note that my blog has moved to: http://superpiadventures.com/
It became clear to me after playing around with Raspbian that I would need to compile my own software and/or Debian packages. Raspbian is new project and is still getting its feet off the ground.
Compiling on the R Pi itself is slow, it takes an hour to compile Quake3 and about 12 hours to compile XBMC, so I decided to compile on my desktop PC. The problem is that my desktop is running Ubuntu 12.04 i386 and my Pi is running Raspbian for armhf.
I used that as a base to create my own chroot that can cross-compile for armhf. Here are instructions for Ubuntu 12.04 i386:
In order to compile for a different architecture then we are currently running on we need an emulator. We will use QEMU for this:
apt-get install qemu-user-static
Creating the chroot
Create the chroot (using qemu-debootstrap) and mount some needed filesystems:
sudo apt-get install debootstrap sudo qemu-debootstrap --arch armhf wheezy chroot-raspbian-armhf http://archive.raspbian.org/raspbian sudo mount -t proc proc chroot-raspbian-armhf/proc sudo mount -t sysfs sysfs chroot-raspbian-armhf/sys sudo mount -o bind /dev chroot-raspbian-armhf/dev
Remember that is as minimal as a distro can get, you need to set up everything yourself from here, including adding a user and the applications you need.
Edit: Updated this section to use qemu-debootstrap. This handles the qemu binary and debootstrap –second-stage all for you.
Changing to the chroot
Now that you have everything setup, you can change to your chroot with:
sudo LC_ALL=C chroot chroot-raspbian-armhf
Some setting up
Now that you have the environment, you may need to do some house cleaning to get things running smoothly.
Adding a user
useradd -m -s /bin/bash <username>
Setting up reposatory and adding Raspbian GPG key
In order to install packages from the Raspbian repo, you need to add the repo to sources.list and grab the GPG key:
echo "deb http://archive.raspbian.org/raspbian wheezy main" >> /etc/apt/sources.list wget http://archive.raspbian.org/raspbian.public.key -O - | apt-key add - apt-get update
VideCoreIV userspace libs
You may need to fetch the libraries for VideoCoreIV for hf, these live here: https://github.com/raspberrypi/firmware/tree/master/hardfp
Note that some of these changes won’t survive a reboot. You will need to run the following should you reboot your desktop:
sudo mount -t proc proc chroot-raspbian-armhf/proc sudo mount -t sysfs sysfs chroot-raspbian-armhf/sys sudo mount -o bind /dev chroot-raspbian-armhf/dev