Category Archives: linux

Debian on a Raspberry Pi

Been having fun getting Debian up and running on my Raspberry Pi, this a note of the software and config tweaks I made to get it running how I wanted

I downloaded the Debian ARM image from here and copied the image in to an SD card I had, a 4GB SanDIsk SHDC class 4 (There’s a handy list of Raspberry Pi working SD cards here.)

dd if=debian6-19-04-2012.img of=/dev/disk1 bs=1m

The image uses around 2GB arranged as:

  • 1.5GB root fs
  • 200 MB /boot
  • 256 MB swap

To make use of the rest of the 4GB card I popped the card into a spare debian box I had and resized it with Gparted. I noticed the root fs was already at 80%, so I extended that a bit then made a new 1.25 GB partition for /home (ext4) and added the necessary entry to /etc/fstab. The card now looks like this:

  • 200 MB /boot
  • 2.3 GB /
  • 1.25 GB /home
  • 256 MB swap

My first boot failed with a kernel panic. It looked like a hardware/IRQ thing to me so I whipped the keyboard and mouse out of the USB sockets and tried again and it booted fine.

I headed back to the supported hardware page again showed me that my cheapo Argos keyboard was not gonna play so I found a different keybord, tried again and this time it booted up perfectly and I logged in (default user/pass on these Debian images is pi/raspberry).

For video I used the HDMI out as my telly has a spare HDMI socket in the back. Running ‘startx’ brings up the Xfce GUI, and I added ‘disable_overscan=1’ to the file /boot/config.txt get rid of the fat black borders around the desktop.

I plan to make some ports available on the internet (a web server and sshd at least) so there were a couple of sysadmin tasks I needed to do: I added a new user account for myself, logged out and in as me, and then removed the default ‘pi’ account. I also removed users ‘pi’ and ‘suse’ from the sudoers file.

Doing this reminded me to install vim, did that and changed the default $EDITOR from joe:

sudo apt-get install vim
sudo update-alternatives --config editor

(If you’re new to Debian then this page is useful.)

The openssh-server is installed but not enabled by default, to start it and get it to restart on a reboot I ran:

sudo service ssh start
sudo update-rc.d ssh defaults

I installed Apache with

sudo apt-get install apache2

The server will fail to start on install so you’ll want to

sudo groupadd -f -g33 www-data
sudo /usr/sbin/apachectl graceful

Sound wasn’t enabled by default, to get it going I loaded the snd_bcm2835 kernel module and installed the alas-utils package:

sudo apt-get install alsa-utils
sudo modprobe snd_bcm2835

I then added snd_bcm2385 to /etc/modules so it auto-loads on boot, and added the line ‘hdmi_drive=2’ to the /boot/config.txt file to force sound via the HDMI output.

That’s pretty much it. The online community and documentation for the Raspi is great. I found this troubleshooting guide particularly useful in getting up and running.

Debian Wheezy on a MacBook Pro 8,1

Some notes on running Debian Testing (‘Wheezey’) on the aluminium MacBook Pro that Aunty has been kind enough to furnish me with.

It’s the 8,1 model and runs pretty well with Wheezy’s 64 bit 3.2 Kernel, installation was standard and is well documented elsewhere on the web; i’m running it dual-boot with OSX using rEFIt to select the OS at boot time. The only real tweaks I’ve had to do so far are for the wifi, suspend and the sound.

wifi

The wifi chipset is Broadcom as with most of these recent MacBooks, so with the 3.2 kernel it’s just a matter of fetching the proprietary firmware:

  1. add the contrib and non-free repos to your /etc/apt/sources.list:
    deb http://ftp.uk.debian.org/debian/ wheezy contrib
    deb http://ftp.uk.debian.org/debian/ wheezy non-free

    (then run an apt-get update)

  2. get the firmware extractor:
    sudo apt-get install b43-fwcutter
  3. get the firmware:
    wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2
  4. unzip it and pop it in the right place:
    sudo b43-fwcutter -w /lib/firmware/ broadcom-wl-5.100.138/linux/wl_apsta.o
  5. reboot – wifi should be up and running

no wifi after suspend

I found the wifi worked well with the b43 driver but i found it wouldn’t come back after a suspend, eg shutting the lid. Googling this a bit it seems the b43 driver needs unloading on suspend; to achieve this create/edit a file in /etc/pm/config.d/config and add SUSPEND_MODULES=”b43″, worked for me.

no sound

Sound seemed to be up and running, even had OSD with the volume keys which was a surprise, but I couldn’t hear anything. Gnome 3 is a bit light on config options in the GUI, but by running alsamixer from a shell I was able to see that the speakers were muted, easy enough to fix.

no flash in google-chrome

If like me you prefer Google Chrome to Chromium you may find Flash is broken in the 64-bit deb that Google provides. There are various ways to sort this but I followed the guide here which worked a treat.