Today I decided to upgrade all my boxes at home to Maverick Meercat. First I started with my Netbook, then followed my NAS and now the XBMC box (Acer Revo 3600).

As a base point, you’ll need a minimal installation of Maverick Meercat (simply put the mini.iso onto an usb pen drive and boot from it), which luckily is rather easy:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# First we'll need these tools on the box where we're preparing the stick
sudo aptitude install syslinux mbr mtools

# Create a FAT16 partition on your USB stick
sudo fdisk /dev/sdb

# Format the partition as VFAT
sudo mkfs.vfat /dev/sdb1

# Need to install the bootloader (syslinux) before doing anything else!
sudo syslinux /dev/sdb1

# Now mount the mini.iso file as loop, copy the content to the usb stick
sudo mkdir /media/usb; sudo mkdir /media/cdrom0
sudo mount -o loop ~/mini.iso /media/cdrom0; sudo mount /dev/sdb1 /media/usb
sudo cp -r /media/cdrom0/* /media/usb

# Rename the isolinux.cfg
sudo mv /media/usb/isolinux.cfg /media/usb/syslinux.cfg

sudo umount /media/usb /media/cdrom0

# Create a MBR on the usb stick
sudo install-mbr /dev/sdb

After that is done, boot your box with the USB stick. Make the minimal command line installation. After that finishes, switch to the adjacent console (i.e. tty2) hit ENTER, and install a few packages that we need for after the reboot:

1
2
3
4
# Install important packages
chroot /target /bin/bash --login
aptitude install openssh-server wpasupplicant subversion git-core python-software-properties
exit

Now reboot the Revo. Once that’s done, we can start with prepping the real thing:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Need to blacklist the not working RAlink drivers
cat << EOF | sudo tee /etc/modprobe.d/blacklist-ralink.conf
# The below drivers don't work with the Atheros AR5001
# (Linksys WUSB600N)
blacklist rt2800usb
blacklist rt2x00usb
EOF

# Add the necessary PPA's
sudo add-apt-repository ppa:team-xbmc-svn/ppa

# Install necessary prerequisites (like nvidia-glx for VDPAU rendering)
# debhelper needs to be added, otherwise dkms is gonna fail.
# I need nvidia-glx-180 because the -190 apparently brings
# a large framedrop (as in I'm getting 18 FPS instead of 24)
sudo aptitude install debhelper linux-sound-base alsa-base alsa-utils screen hal

# Unmute the Master an PCM channels with alsamixer. Press ESC to quit
sudo alsamixer
sudo alsactl store 0

# Install XBMC as standalone (since we don't want a full-blown desktop environment like GNOME)
sudo aptitude install xbmc-standalone

# Configure the Xserver
sudo aptitude install pkg-config nvidia-glx-180 xinit
sudo nvidia-xconfig

# Add the init-script (no need for fancy tty login stuff)
cat << EOF | sudo tee /etc/init/xbmc.conf
# xbmc

description     "XBMC"
author          "Christian Heim <christian.heim@barfoo.org>"

console output

start on (filesystem and started rsyslog)
stop on runlevel [06]
respawn
respawn limit 10 300

expect fork
emits starting-x starting-dm

pre-start script
        # Need this ugly hack, since plymouth is still running, thus resulting
        # in an non-working xbmc/Xorg session. Sadly, there's currently no
        # other way to do this (ie. 'start on stopped plymouth')
        for i in $( seq 1 5 ); do
                plymouth --has-active-vt
                [ $? -eq 0 ] && break || sleep 1
        done
end script

script
        exec xinit /usr/bin/xbmc --standalone & >/dev/null 2>&1
end script

pre-stop script
        # Clean up the console before we switch to it, to avoid text flicker
        if [ -x /usr/bin/tput ] ; then
                tput -Tlinux reset > /dev/tty1 || true
                tput -Tlinux reset > /dev/tty8 || true
        fi
        rm -f /root/xbmc_crashlog* &>/dev/null || true
end script
EOF

Since this is an “desktop” (well, more over I want it to look cool … :P), I need to setup the XBMC bootsplash, which is being handled by plymouth:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sudo aptitude install plymouth-label v86d
wget http://excyle.nl/plymouth-theme-xbmc-logo.deb
sudo dpkg -i plymouth-theme-xbmc-logo.deb
echo FRAMEBUFFER=y | sudo tee -a /etc/initramfs-tools/conf.d/splash
echo uvesafb mode_option=1280x1024-24 mtrr=3 scroll=ywrap | sudo tee -a /etc/initramfs-tools/modules
sudo update-initramfs -u

sudo sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT="splash quiet"|GRUB_CMDLINE_LINUX_DEFAULT="splash quiet video=uvesafb:mode_option=1920x1080-24,mtrr=3,scroll=ywrap"|' /etc/default/grub
sudo sed -i 's,GRUB_HIDDEN_TIMEOUT=0,#GRUB_HIDDEN_TIMEOUT=0,' /etc/default/grub
sudo sed -i 's,#GRUB_GFXMODE=640x480,GRUB_GFXMODE=1920x1080,' /etc/default/grub
sudo update-grub2

Since I’m using an Crystal HD device with my Acer Revo, I also need the “extra” dependecies needed for it to work.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mkdir ~/checkout
sudo aptitude install subversion autoconf
svn checkout http://crystalhd-for-osx.googlecode.com/svn/trunk/crystalhd
cd crystalhd
cd linux_lib/libcrystalhd/
make
sudo make install
cd ../..

cd driver/linux
autoconf
./configure
make
sudo make install

Also, since I’m using a Hama MCE (well, or rather my Harmony One programmed to act like a Hama MCE), I also need the MCE Eventclient (in replacement for what a pain in the ass LIRC is, gladly):

1
2
3
4
5
6
sudo aptitude install git-core
cd ~/checkout
git clone git://repo.or.cz/hama_mce-eventclient.git hama_mce-eventclient
cd hama_mce
make
sudo make install

Sadly, hal tries to grab the device and we need to blacklist it, so we end up with a working remote!

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cat << EOF | sudo tee /etc/hal/fdi/preprobe/99_hama_mce.fdi
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
        <device>
                <match key="usb.vendor_id" int="1444">
                        <match key="usb.product_id" int="39041">
                                <merge key="info.ignore" type="bool">true</merge>
                        </match>
                </match>
        </device>
</deviceinfo>
EOF

What’s now left, is just dropping the asoundrc in root’s $HOME.

1
2
cd /root
wget -O .asoundrc http://christian.blog.pakiheim.de/uploads/2009/06/asoundrc

Now reboot the Revo one last time, and XBMC should come up just fine .. At least it does for me!