'grasping the pi, part 1: setting up'

So to probably help their Computer Science students get some programming practice before the start of term, University of Cambridge provided each one of them with a Raspberry Pi computer. I guess there is no need to introduce the Pi (there has been a lot of buzz about it on the Internet lately), so I will directly move on to sharing my experiences with this strange machine.

The Pi doesn't exactly have a CD drive or a way to change where it boots from, so the OS cannot be installed onto it in the traditional sense of words. The only storage it has is an SD card and the Downloads section of the Pi website (http://www.raspberrypi.org/downloads) has images that are preloaded with the bootloaders and Linux distributions built specifically for the Pi.

I first downloaded the recommended Raspbian Wheezy image that apparently has a lot of useful software already preinstalled. Since I use Arch Linux on my laptop, I easily flashed the image onto the SD card using dd, plugged the card, an Ethernet cable and my mobile phone charger (which is basically a Micro USB 2 cable) into the Pi and waited for some time, hoping to remotely log onto it to start playing around (I felt too lazy to go find an RCA cable to actually see what was happening on the screen).

Not much happened though -- the Link light that presumably represented the fact that the Pi had detected the network didn't flash on, so I did have to dig around and connect it to the TV, which revealed that the Pi didn't get anywhere useful because of a strange kernel panic due to it not being able to mount the root partition on the card.

I reflashed the card, which didn't help. I then noticed that the flashed image didn't use the whole amount of space on the card (it contained two partitions totaling 2GB, whereas the card was 4GB big) and the root partition couldn't be mounted even on my laptop, so I used GParted to extend it to the full size of the card. That didn't help either -- during the initial boot stages, the Pi failed to preload some libraries and hung in a loop, forever trying to fix that problem.

After reflashing the card again and failing, I decided to install the Arch Linux image available from the same page, which somehow worked flawlessly. Despite that Arch is a fairly minimal system, its wiki (wiki.archlinux.org) is excellent and provides a lot of guidance to making that system less minimal, so it wasn't too much of a loss. Raspbian, however, seems to have some sort of optimisations for the floating-point code, which makes multimedia packages work much faster, so I am still yet to find out whether it can be done in Arch as well.

I now was prepared to go headless and continue to set up my system via ssh from my laptop. I did some minor things, such as:

  • Adding a new, non-root user
  • Running pacman -Syu to upgrade the system (which also upgraded the firmware to the latest version)
  • Setting up sudo (allows to run a command with root privileges)
  • Installing yaourt (build packages in the Arch User Repository from source), links (a text-based browser), vim (editor), tmux (terminal multiplexer) and some programming-related things like base-devel (a package that contains the GNU Compiler Collection, make, ld etc) and a Python interpreter.

At this stage, I had a box that I could connect to Ethernet, remotely log onto it (if I could find the IP), and do some minor browsing and programming, which wasn't particularly exciting. I wanted some sort of a graphical interface and a way for it to use a wireless dongle that I had lying around to avoid tripping hazards from the Ethernet cable stretched across the room.