These are archived pages, most of them date back to 2007-2012. This content might not be relevant or accurate anymore.

Debian on ION system HTPC

Base system setup applies to all computers. Tweaks are for ASUS AT3IONT-I Deluxe motherboard with nVidia ION (and Intel Atom).

⚠️ Later I installed XBMC 10.0 “Dharma” which seems to be better and with more ergonomic OSD than Boxee (not as pretty though). There is also plugin for CSFD.cz database.

debootstrap-ping the base system

Everything is done by debootstrap tool which does installation of base Debian system:

debootstrap--arch=i386 --keep-debootstrap-dir squeeze path/to/squeeze/ http://ftp.se.debian.org/debian/

Here are some helpful links about debootstrap:

Now we need to do some changes to installed system (you will have to change Linux version for future Debian versions):

# use variable for system path and 

BASE=path/to/squeeze

# mount pseudo-filesystems

mount proc $BASE/proc -t proc
mount sysfs $BASE/sys -t sysfs

# chroot and set root password

chroot $BASE /bin/bash
passwd

# basic configuration

dpkg-reconfigure tzdata
aptitude install locales
dpkg-reconfigure locales

# install kernel and bootloader

aptitude install linux-image-2.6.32-5-686
aptitude install grub

We need to make some configuration files (I will skip fstab until we have all done):

echo boxee > /etc/hostname

cat > /etc/network/interfaces <<EOF
auto lo
iface lo inet loopback
EOF

cat > /etc/apt/sources.list <<EOF
deb http://ftp.se.debian.org/debian squeeze main contrib non-free
deb-src http://ftp.se.debian.org/debian squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

deb ftp://ftp.at.debian.org/backports.org squeeze-backports main contrib non-free
deb http://www.debian-multimedia.org squeeze main non-free
EOF

Installing software

At this point you can run aptitude and install whatever you want. I made a list of changes I did. It includes gdm, XFCE and various utilities but you don’t really need them in pure HTPC (but I tried to remove as much bloat as I could).

(First part are really basic tools I like to have.)

+mc
+screen
+openssh-server
+rsync
+ntpdate
+molly-guard
+curl +openssl blacklist/extra
+dnsutils
+mlocate +dlocate
+ethtool
+iw
+acpid -acpi-support-base
+nmap
+firmware-linux

+alsa-utils # for ALSA
+readahead  # for quicker boot

# bluetooth:

+blueman
+bluetooth -bluez-cups

# fancy desktop environment

+gdm -gnome-panel -gnome-session -metacity
+xfce4-session +gdm -aumix -fortunes-min -gdm-themes -gnome-keyring -notification-daemon +xfce4-notifyd
+gnome-disk-utility
+xfce4-terminal

# other useful tools

+xbindkeys +xbindkeys-config
+devilspie

# fun stuff

+irssi
+links2
-vim-tiny
-nano
+zile
+rtorrent

Preparing partitions and /etc/fstab

This is really generic fstab which depends on parititon labels boxee and swap:

cat > fstab <<EOF
# /etc/fstab: static file system information.

#
# file system    mount point   type    options                  dump pass

LABEL=swap       none          swap    sw                       0    0
proc             /proc         proc    defaults                 0    0

LABEL=boxee      /             ext4    defaults                 0    1
#LABEL=boot      /boot         ext2    ro,nosuid,nodev          0    2

EOF

You can set the labels like this (⚠️ don’t mix up the devices):

mkswap -L swap /dev/...
tune2fs -L boxee /dev/...

Also we don’t want long boot on HTPC:

# no checking after remounts/days

tune2fs -c0 -i0 /dev/...

Copying the system

Ok, my notes here are lacking, but you’ll do fine :)

umount $BASE/proc
umount $BASE/sys
umount $BASE/dev
# I have used: mount -t none /dev $BASE/dev -o bind

# but in the end I installed grub from my system

cp -a $BASE/* /mnt/boxee/
grub-install --root-directory=/mnt/boxee/ /dev/sdb

And don’t forget to delete APT cache with aptitude clean. You will need to run update-grub later on running system.

Booting with QEMU

It should give you grub shell, not grub-rescue:

qemu -hda /dev/sdb

An in grub shell:

root (hd0,msdos2)
linux /vmlinuz root=LABEL=boxee
initrd /initrd.img

ION HTPC installation

Make non-privileged user:

adduser boxee
usermod -a -G audio,video,cdrom,plugdev,powerdev boxee

Blank password

If you choose to use login manager you might want to use blank password. From /etc/passwd erase “x” between colons for boxee user. In /etc/pam.d/common-auth change pam_unix to use nullok.

Make sure /etc/ssh/sshd_config includes PermitEmptyPasswords no.

HDMI audio

/etc/asound.conf found here http://forums.boxee.tv/showpost.php?p=49052&postcount=6. The downside is that ALSA won’t remember it after suspend and alsa force-reload will kill the app.

cat > /etc/asound.conf <<EOF
pcm.dmixer {
	type dmix
	ipc_key 1024
	ipc_key_add_uid false
	ipc_perm 0660
	slave {
		pcm "hw:0,3"
		rate 48000
		channels 2
		period_time 0
		period_size 1024
		buffer_time 0
		buffer_size 4096
	}
}

pcm.!default {
	type plug
	slave.pcm "dmixer"
}
EOF

More packages:

+nvidia-vdpau-driver +nvidia-settings

# better for HTPC with wifi than network-manager

+wicd

# boxee.tv or xbmc, but you're free to install mplayer-nogui or vlc (no VDPAU yet?)

+boxee
+flashplugin-nonfree

# for fancy bootsplash try plymouth, but it boots a little longer

You’ll need to run nvidia-xconfig.

Suspend

If you want to suspend you’ll have to make some modules unloaded before:

cat > /etc/pm/config.d/usb <<EOF
SUSPEND_MODULES="ehci_hcd uhci_hcd ohci_hcd"
EOF

⚠️ New scripts are reloading these manually after suspend – this allows resume by power button on the remote. See pm/sleep.d directory.

Drivers

Here’s nice package for bluetooth driver ath3k (don’t forget to install included firmware) and Philips remote driver: http://ubuntuone.com/p/3aX/. ath3k will be in later kernel.

I just extracted and compiled it manually.

hid_philips_asus

This driver works better for me than lirc. Also you’ll want newer version from Ubuntu. LIRC howto.

Here’s my mappings.h for Boxee. I’m not sure what’s wrong with rewind and fast forward, but it doesn’t work all the time. Below is another version for XBMC.

⚠️ Note: I’m using KEY_SLEEP for starting Boxee from acpid. Also I have radio button mapped to KEY_VIDEOSWITCHMODE which makes ACPI event and I reconnect WiFi connection (I had some wifi connection problems).

/***************************************************

 * Button mappings
 *
 * Change the key values according to linux/input.h
 * and then rebuild the driver
 ***************************************************/

/* Power button */
#define BUTTON_POWER			KEY_SLEEP

/* Play, rewind, forward buttons */
#define BUTTON_REWIND			KEY_LEFTBRACE

#define BUTTON_PLAYPAUSE		KEY_PLAYPAUSE
#define BUTTON_FORWARD			KEY_RIGHTBRACE

/* Previous, stop, next buttons */
#define BUTTON_PREVIOUS			KEY_COMMA

#define BUTTON_STOP			KEY_STOP
#define BUTTON_NEXT			KEY_DOT

/* Volume buttons */
#define BUTTON_MUTE			KEY_MUTE

#define BUTTON_VOLUMEUP			KEY_VOLUMEUP
#define BUTTON_VOLUMEDOWN		KEY_VOLUMEDOWN

/* Arrow buttons */
#define BUTTON_RIGHT			KEY_RIGHT

#define BUTTON_LEFT			KEY_LEFT
#define BUTTON_DOWN			KEY_DOWN

#define BUTTON_UP			KEY_UP

/* OK button */
#define BUTTON_OK			KEY_ENTER

/* Back button */
#define BUTTON_BACK			KEY_BACKSPACE

/* Special buttons from left to right counter clockwise*/
#define BUTTON_HOME			KEY_ESC

#define BUTTON_WINDOWS			KEY_I
#define BUTTON_RADIO		KEY_FAVORITES//

#define BUTTON_MUSIC		BTN_SELECT   //
#define BUTTON_DTS		KEY_SUBTITLE //

#define BUTTON_TRANQUIL			KEY_S
#define BUTTON_FULLSCREEN		KEY_Z

/* Middle special button */
#define BUTTON_HOMETHEATER		KEY_HOMEPAGE

/***************************************************

 * Button mappings
 *
 * Change the key values according to linux/input.h
 * and then rebuild the driver
 ***************************************************/

/* Power button */
#define BUTTON_POWER                    KEY_SLEEP

/* Play, rewind, forward buttons */
#define BUTTON_REWIND                   KEY_RIGHTBRACE

#define BUTTON_PLAYPAUSE                KEY_PLAYPAUSE
#define BUTTON_FORWARD                  KEY_LEFTBRACE

/* Previous, stop, next buttons */
#define BUTTON_PREVIOUS                 KEY_COMMA

#define BUTTON_STOP                     KEY_STOP
#define BUTTON_NEXT                     KEY_DOT

/* Volume buttons */
#define BUTTON_MUTE                     KEY_MUTE

#define BUTTON_VOLUMEUP                 KEY_VOLUMEUP
#define BUTTON_VOLUMEDOWN               KEY_VOLUMEDOWN

/* Arrow buttons */
#define BUTTON_RIGHT                    KEY_RIGHT

#define BUTTON_LEFT                     KEY_LEFT
#define BUTTON_DOWN                     KEY_DOWN

#define BUTTON_UP                       KEY_UP

/* OK button */
#define BUTTON_OK                       KEY_ENTER

/* Back button */
#define BUTTON_BACK                     KEY_BACKSPACE

/* Special buttons from left to right counter clockwise*/
#define BUTTON_HOME                     KEY_ESC

#define BUTTON_WINDOWS                  KEY_I
#define BUTTON_RADIO            KEY_O//KEY_SWITCHVIDEOMODE

#define BUTTON_MUSIC            KEY_TAB
#define BUTTON_DTS              KEY_COMPOSE

#define BUTTON_TRANQUIL                 KEY_S
#define BUTTON_FULLSCREEN               KEY_Z

/* Middle special button */
#define BUTTON_HOMETHEATER              KEY_HOMEPAGE

We must make sure it loads before usbhid. Add this to /etc/modules:

hid_philips_asus
usbhid
hid

And this /etc/modprobe.d/blacklist.conf:

blacklist usbhid

Then run update-initramfs -u. You might need to put command like this to /etc/rc.local to enable USB device to send wakeup signal:

# IR wakeup, UPS wakeup - you might want to enable USB2, US12, US15

echo USB0 > /proc/acpi/wakeup

⚠️ This stopped working in 2.6.32-29, in addition you will need to enable USB devices to allow wakeup with /etc/pm/sleep.d script like this:

#!/bin/sh

grep . /sys/bus/usb/devices/*/manufacturer | while read line; do
	name=`echo $line | cut -d: -f2`
	out=`echo $line | cut -d: -f1 | sed 's@manufacturer@power/wakeup@'`
	if [ "$name" = "PHILIPS" -o "$name" = "APC" ]; then
		echo Allowing $name device to wake up
		echo enabled > $out
	fi
done

Other tweaks

You’ll probably want halevt to mount removable media automatically. Didn’t work for my external DVD drive.

Important configuration files including boxee init script. You will need to run update-rc-d boxee enable for appropriate runlevel (usually for 2, which is default in inittab).

 
 
 
disorder's homepage