2005 / Debian GNU/Linux 3.1 (sarge) on hp omnibook xe4500

Debian GNU/Linux 3.1 (sarge) on hp omnibook xe4500


After having spent a few years with Slackware Linux on the xe4500 and several months with Ubuntu Warty, then Hoary on it, I decided to try out the new Debian release: Sarge.

On this page, I want to document parts of the installation procedure (with the new Debian installer the installation is very straightforward) and how to configure things to work right. So mostly these are some hints how to get your system configured.

This guide could also be helpful for people just wanting to configure a Debian system to their taste while never having used Debian itself before (like me). I've been familiar with Debian package management, however.

Updates / ChangeLog

24.07.2005: Initial version, most basic things
25.07.2005: DOSBox, Kernel 2.6, Battery Monitoring, One-Touch keys, Temperature monitoring
26.07.2005: Some minor changes, first public release on the net
08.10.2005: Added fine-tuning notes section (flac with beep-media-player, CD burning and gnome-volume-manager coolness without GNOME)
09.12.2005: gnome-volume-manager coolness without GNOME - konqueror support (thanks to Marijke vd Sijde), added my semi-auto-umount solution, added apt-pinning and testing migration
18.12.2005: Added link to Tero Karvinen's Ubuntu Linux on xe4500 page, updated TODO list, infos on omnibook kernel module with testing kernels and gcc-4.0
25.12.2005: Added built-in modem setup section
25.03.2006: Added the how to defeat the noisy fan section + xe4500-related links
18.07.2006: Fixed spelling and grammar errors, should be easier to read now; Updated Java installation section; added mute LED section; added very, very simple firewall section
10.08.2006: Added link to new omnibook kernel module fork
28.12.2006: Clean-up, merged with Slackware 10.1 page; moved to new URL

Installing the base system

For my installation, I used the two 3.1r0a DVD images which I created by downloading the CD images, extracting them into one directory and using jigdo to produce DVD images.

HINT: The xe4500 had problems reading my DVD-Rs, so I burned the Debian images into DVD+RWs which worked well. You probably should do the same or else the installer will throw lots of errors. Also, if there is a new Debian release, you could burn the new release over the older one when using DVD+RWs. Installing from the CDs is also an option, of course.

The installation is really straightforward, you do not have to use any of the previously found hacks - it just works.

Installation overview

1) Switch on your notebook, insert the 1st DVD and press ESC to get into the boot media selection menu. Select CD-ROM drive there.
2) The Debian logo and boot prompt appears. Just press enter and it boots into the installer.
3) Follow instructions from the installer. I allowed the installer to take my whole 30gig harddisk - you might want to make a different selection.
4) After restarting, make sure to boot your notebook from harddisk.
5) Let apt read in both DVDs (or whatever media you have got) - give it time to read the DVDs.
6) Select tasks you want to install packages for. I choose not to install any packages there, but made my own selection afterwards.
7) Congratulations, you made a basic Debian install on your xe4500.

Installing additional packages

NOTE: If you have already selected some tasks, feel free to skip this section. This is only for people who have not installed additional packages by default and want to configure the system to their needs.

After the installation, you should login as root and start installing additional packages you need. Thanks to Debian's wonderful package system you will get all the dependencies installed automatically and without problems. Installing only the packages you need also gives you a slick system without a bunch of unneccessary tools you will probably never need.

Following are short descriptions of packages I installed on my system and how to do it.

X Window System

You should start by installing the X Window System: apt-get install x-window-system. After that, the configuration wizard is started. Display resolution is (of course) 1024x768. Everything else should be clear. This already gives you xdm (/etc/init.d/xdm start) as display manager and twm for the window manager - a very basic X11 installation.

Display Manager

NOTE: If you want to use GNOME or KDE, you can install either of them (or both) by running apt-get install gnome-desktop-environment or apt-get install kde, respectively. I am not going to install them here, but use alternatives. Feel free to skip this and the following sections if you feel more comfortable with one of the "bigger" desktop environments.

The display manager displays a graphical login screen. Currently, we have xdm installed. If you like it, feel free to skip this step. I wanted to try out another display manager. Looking at the possibilities, I've chosen to try out wdm, the WINGs Display Manager. It's very small and only depends on a few packages (libjpeg62, libtiff4, libungif4g and libwraster3). If you want, you could also install gdm (around 60 megs with dependencies) or kdm (around 90 megs with dependencies). Installing wdm is as easy as typing apt-get install wdm in your shell. Debian's configuration wizard will ask you to select the default display manager - select wdm here. Go to a console, type /etc/init.d/xdm stop (if you have started xdm in the previous step) and then start wdm by typing /etc/init.d/wdm start. The friendly login screen of wdm will appear.

Window Manager

You should search somewhere on the web, because there are so many window managers available if you want to choose an alternative to my selection. For a fast and nice window manager, I decided to use fluxbox which I have used before and liked very much. It is just a matter of typing apt-get install fluxbox and after a restart of your display manager you should be able to choose fluxbox from the window manager menu.

Various Packages

After having a very basic X11 setup and usable display manager plus window manager, we should be installing some packages which are not yet installed but should be installed to gain some advanced features for our system. Just type this and you will be fine (check package descriptions with apt-cache show packagename if you want to know what each package does):

Command line for installing general packages

apt-get install xscreensaver vim vim-gtk less mozilla-firefox ssh bzip2 xine-ui vorbis-tools flac mpg321 xmms xmms-flac ffmpeg wxvlc alsa-base portmap nfs-client alsa-modules-2.4-686 mc mime-support openssl ispell aspell rsync acpi acpid xpdf gimp xfreecd gamix cdparanoia yaret normalize-audio dosbox xkbsel gaim rdesktop xtightvncviewer tightvncserver xchat wireless-tools

You might also want to install some of the localization packages that translate applications into your native language. For me, this is German, so I used the following commands:

apt-get install mozilla-firefox-locale-de-de myspell-de-at aspell-de

There are also packages that are useful when used on the xe4500 and its hardware. You want to install these, and we will configure them later:

apt-get install hotkeys atitvout radeontool wmacpi

Questions (and answers) for configuration wizards

- When you are asked if you want to manage fonts with defoma, choose yes.
- You probably only want to allow SSH Protocol Version 2 connections.
- I like having sshd running on my xe4500, so i started sshd.
- You need to re-compile your kernel with ACPI support? Don't worry. We will install a proper kernel later.
- Paper size for me is A4.

System configuration tasks

X11 Touchpad configuration (Kernel 2.4 only)

If you have already configured your touchpad, you can safely skip this step.

Also, please skip this step if you are planning to install kernel 2.6 later, as this is not needed for kernel 2.6!

If not, however (for example if you have installed a USB mouse), you have to add the touchpad as secondary input device. With vim /etc/X11/XF86Config-4 you open the X11 configuration file. Search for the Section "InputDevice" and copy the whole section, paste it underneath (place in said line, type 10yy then place below and p to paste). Then change the Option "Device" from "/dev/input/mice" to "/dev/psaux" and rename the Identifier in that section from "Configured Mouse" to "Touchpad". Finally change the option "CorePointer" to "SendCoreEvents" (because you only can have one CorePointer. After that scroll down to Section "ServerLayout" and add the following line:

InputDevice "Touchpad"

Now restart your X server and the touchpad should be working.

ALSA installation

This step is as easy as running alsaconf in a root shell and let it detect the xe4500's sound card - configuration is automatic. You can then start alsamixer and set the volume to a value you like. Typing alsactl store as root saves the volume settings for the next system start (this is done automatically on shutdown too, but anyway..).

Shell aliases

You should edit ~/.bashrc to enable some aliases for easier usage of the command line: vim ~/.bashrc. I uncommented the line for ll, which i commonly use.

XScreensaver startup

In order to get xscreensaver started as a daemon with your fluxbox session, you have to edit ~/.fluxbox/init: vim ~/.fluxbox/init. Search for the line starting with session.screen0.rootCommand: and append the following code to it: ~/.fluxbox/autostart.sh. I have already prepared a sample autostart.sh file for you to use: It sets a black-to-red gradient as background and (re)starts xscreensaver.

Listing of ~/.fluxbox/autostart.sh:

bsetroot -gradient Vertical -from black -to darkred
/usr/bin/xscreensaver-command -exit
/usr/bin/xscreensaver -no-splash &

As soon as you have everything in place you should restart fluxbox and look at the running processes by opening xterm and running the command ps ax - you should see a running xscreensaver process.

Support for encrypted DVDs (libdvdcss)

To be able to play your legally bought DVDs on your new Debian system, you will need to install libdvdcss. The instructions from http://www.videolan.org/vlc/download-debian.html didn't work out for me because the apt-sources are broken at the time of writing. You should get the most recent libdvdcss2 file from http://download.videolan.org/pub/videolan/debian/i386/, download it to your xe4500 and install it by going to the directory you downloaded the file to and run dpkg --install libdvdcss2_1.2.8-1_i386.deb (of course you replace the version number if it's different for you). After that you can try and open VLC from fluxbox and play any of your DVDs (you can also try xine).

Installing Java

For me as a Java developer (and for basically everyone who uses Java applications) there should be at least a Java runtime installed. Debian doesn't include the (non-free as in free speech) JDK or JRE from Sun, so we have to install some helper program which will build a Debian package from the official Java distribution. Here we go: apt-get install java-package. After that we need to download the official Java distribution from this page: http://java.sun.com/j2se/1.5.0/download.jsp. Then, as a non-root user (this is important!) run the following command: fakeroot make-jpkg jdk-1_5_0_02-linux-i586.bin (replace filename with yours of course). Enter your name and e-mail address, then read license agreement. Wait until the package is extracted and the debian package is built. After make-jpkg has finished, it should leave us with a .deb file in the current directory. Install the resulting package file with dpkg --install sun-j2sdk1.5_1.5.0+update02_i386.deb (of course here replace the filename with the name of the package you have got).

Update 20060718: Sun's Java 5.0 is now in Debian testing/unstable, so you can install it from the non-free section of the Debian archives: apt-get install sun-java5-jdk for the JDK (if you want to run and develop Java applications) and apt-get install sun-java5-jre for the JRE (if you only want to run Java applications).

Installing MS TTF Corefonts (Web Fonts)

The package msttcorefonts provides most of the fonts found on the web, for example Verdana. It's simple to install the package: apt-get install msttcorefonts. While installing the package, it will download the font installers and extract the TTF files. After it has finished, install the suggested tool x-ttcidfont-conf by doing a apt-get install x-ttcidfont-conf. Select freetype when asked. As soon as you have installed all packages, the fonts should be available in X.

Using DOSBox to play old games

(Mostly taken from this page) The package dosbox (which we installed above) provides an emulator for old DOS games. If you (like me) have got a German (or other non-english) keyboard, some keys are not working. To fix this, execute setxkbmap us before you start DOSBox, then use your keyboard as if it has got the US layout and after you have used DOSBox, use setxkbmap de (or whatever your language code is).

Using Wine to run Windows applications

In order to run Windows applications with Wine, you have to install some additional packages: apt-get install wine wine-utils winesetuptk. After that you should be able to configure your Wine installation with winesetup (this is called winecfg in more recent versions). Now you can start any application with winelauncher application.exe (again, in more recent versions, you may simply use wine application.exe).

Upgrading the kernel to 2.6

It is a good idea to upgrade to kernel version 2.6 because it includes many new features which are nice to have for the xe4500 (for example, it seems as if ACPI is not included in the stock 2.4 kernel in Sarge). As root, do a apt-get install kernel-image-2.6-686 which installs the most recent 2.6 kernel that is available from Debian for sarge. After the kernel has been installed, make sure to restart the xe4500 (can be done on the wdm login screen by setting the action to Reboot and logging in as root).

After rebooting, ACPI should be automatically activated and things like the Touchpad Switch should start working again. If the mouse in X is faster than before, this is because kernel 2.6 seems to duplicate data from /dev/input/mice to /dev/psaux, therefore resulting in double movement speed (because we have added a new entry for the Touchpad for /dev/psaux). Just do a vim /etc/X11/XF86Config-4 and comment (put a # at the beginning of the line) out the line in Section "ServerLayout" for the InputDevice "Touchpad". Restart your X server and your mouse should behave normal again.

Configuring services and tools for the xe4500

This section will describe how to set up some advanced tools and services that are good to have on an xe4500. This means advanced functionality like ACPI monitoring and one-touch keys.

ACPI Battery Monitoring

Thanks to fluxbox' slit we can use WM-dockapps. We have installed wmacpi before, which provides a nice display of the battery and ac status. We could run it from an xterm, but we want to have it started automatically on fluxbox start. Therefore we edit the (previously created) ~/.fluxbox/autostart.sh file and simply add these two lines to it:

killall wmacpi
/usr/bin/wmacpi &

Now log out and log in again and you should have a nice battery monitoring dockapp sitting on your desktop.

One-Touch, part I: Omnibook Kernel Module

Before using our One-Touch keys (the five keys above the normal keyboard), we will have to install a special driver (Kernel module) for the xe4500 which will generate events for all our One-Touch keys plus volume keys.

First of all, we have to make sure that the kernel source is installed and configured. Become root and execute apt-get install kernel-package kernel-tree-2.6.8 libc6-dev, which is the source code for our kernel. Then add yourself to the src group (with vim /etc/group) and become yourself again (your user account, not root). Log out completely and log in again. Checking with the command groups you should now see the src group to which you belong now. Then go and extract the kernel source (as your normal user account):

cd /usr/src/
tar xjvf kernel-source-2.6.8.tar.bz2
ln -s kernel-source-2.6.8 linux
cd /usr/src/linux/
cp /boot/config-2.6.8-2-686 .config
make-kpkg --rootcmd fakeroot kernel_image

Woo! It starts off building your kernel. Watch shit scroll by for minutes. (NOTE: I don't know if it is really necessary to build the whole kernel or if you just have to install the sources, but building a kernel once is fun anyway and it gurantees that you can compile modules later on too. You don't have to install your self-built kernel when using the config file from /boot/, because this will result in the same kernel as is already installed. We only compile kernel to get a sane environment for building our kernel module.)

Now we can start building the kernel module. Go to http://sourceforge.net/projects/omke and download the latest release of omnibook kernel module. For me, this is omnibook-2005-02-17, so I downloaded this file to my home directory. I like to keep all source packages in ~/source/ and the archives in ~/source/packages/, so i create these directories:

mkdir ~/source
mkdir ~/source/packages

We now extract the source package and move the archive into our packages directory. Then we cd into the source directory.

cd ~/source
tar xzvf ~/omnibook-2005-02-17.tar.gz
mv ~/omnibook-2005-02-17.tar.gz ~/source/packages/
cd ~/source/omnibook-2005-02-17/

Usually, there would be a symlink to the source directory in /lib/modules/ for our kernel version. This isn't the case, but we know that our source is in /usr/src/linux/ anyway, so we go and edit the Makefile (you probably guessed: vim Makefile) and scroll down to the two lines starting with KSRC, one commented out. Remove the commend from the commented-out line (KSRC=/usr/src/linux) and comment out the other line (KSRC=$(VMODDIR)/build). Now the omnibook kernel module knows how to find the kernel source it needs. Go and build that kernel module and install it into your system:

make install
modprobe omnibook

To make keycodes work under kernel 2.6 we need to create a init-script that takes care of setting keycodes. Open up a new file (as root) with vim /etc/init.d/xe4500 and paste the following code:

#! /bin/sh
# xe4500 xe4500 - specific settings on system startup
# Thomas Perl <thp@perli.net> -- 25.07.2005, 23:05


echo "Setting keycodes for hp omnibook xe4500..."
setkeycodes e070 235
setkeycodes e071 236
setkeycodes e072 237
setkeycodes e073 238
setkeycodes e074 239

echo "Loading omnibook kernel module..."
modprobe omnibook

Change file permissions of it to 755 by doing a chmod 755 /etc/init.d/xe4500. Now we just have to tell Debian to run this script on system startup. This is done by simply running update-rc.d xe4500 defaults. This will start the script in normal runlevels.

One-Touch, part II: hotkeys configuration

After having everything in place, we can make use of the hotkeys tool to execute commands on key presses. We start by creating a directory in our home directory: mkdir ~/.hotkeys. Then we create a new definition file for our xe4500 by executing vim ~/.hotkeys/xe4500.def and pasting the following code into the file:

<?xml version="1.0"?>

<config model="hp omnibook xe4500">

<userdef keycode="236" command="xterm">mail</userdef>
<userdef keycode="243" command="xterm">terminal</userdef>
<userdef keycode="178" command="mozilla-firefox">www</userdef>
<userdef keycode="241" command="xscreensaver-command -lock">lock</userdef>
<userdef keycode="240" command="x-terminal-emulator -e mc">help</userdef>

<Mute keycode="160"/>
<VolDown keycode="174" adj="2"/>
<VolUp keycode="176" adj="2"/>


Of course, the commands and captions (which will appear on the OSD of hotkeys) are just examples - feel free to insert your own.

Now we have to go and put hotkeys into our autostart.sh in the fluxbox directory, to get it started everytime we start fluxbox. vim ~/.fluxbox/autostart.sh and add the following lines:

killall hotkeys
hotkeys -t xe4500 --no-splash

This will start hotkeys in the background on every start. Try it out - you should have working volume controls and One-Touch keys :)

Temperature display: wmtemp

Before we start, we should install X11 development libraries, because we need them to compile wmtemp: apt-get install xlibs-dev

On the Omnibook Kernel Module project page (http://sourceforge.net/projects/omke) there is a nice application called wmtemp. Download the most recent archive (for me, this is wmtemp-0.02.tar.gz) to your home directory. Then issue the following commands (as normal user):

cd ~/source/
tar xzvf ~/wmtemp-0.02.tar.gz
mv ~/wmtemp-0.02.tar.gz ~/source/packages/
cd ~/source/wmtemp-0.02/
./debian/rules build
./debian/rules binary
cd ..
dpkg -i wmtemp_0.02_i386.deb

Congratulations - you have just created a Debian package and installed it. Of course, we will now include wmtemp into our ~/.fluxbox/autostart.sh file. To do this, start vim ~/.fluxbox/autostart.sh and append the following two lines:

killall wmtemp
wmtemp &

Restart fluxbox and be happy - you can now see the temperature of your CPU in the slit.

HINT: You can install the package wmsysmon and add it to your autostart.sh just like wmtemp and have a nice uptime display.

Updating the system with security updates

To keep up to date with security updates from Debian, update your local apt cache with apt-get update and then upgrade any new packages with apt-get upgrade and your system should be up to date.

Setting up the Conexant AC'97 Modem Controller (M5457)

Installing the driver from Linuxant

I currently connect to the internet by ISDN, currently with a Cisco router, I access the internet through my local ethernet therefore. I thought it would be nice to try how to set up the XE4500's internal modem to work with the analog phone line, just for fun. It's a Winmodem (or "softmodem"), and the available driver from Linuxant costs money. They have a free version available which restricts speeds to 14.4kbps, but that's okay for trying it out. Hint: If you need a modem for your xe4500, you better go and buy a "real" hardware modem for about € 20,- instead of paying about the same price for only the driver for your Winmodem.

So, where to start? Let's see what we have.. A short lspci already shows good results:

thomas@silver:~$ lspci | grep -i modem
0000:00:08.0 Modem: ALi Corporation M5457 AC'97 Modem Controller

Having read about these drivers somewhere else on the net, I headed to linuxant.com, went to their drivers section, clicked on conexant modems and finally found the download section for the HSF (softmodem) driver. Here's the direct link: http://www.linuxant.com/drivers/hsf/full/downloads.php. I selected the DPKG package from the Generic pakages with source section. The file I downloaded was hsfmodem_7.18.00.07full_i386.deb.zip, but it's probably best to use the most recent driver available. I still wonder why they put the deb package into an extra zipfile.. While waiting for the 1.1meg download to be finished, make sure you already have got the kernel-source and gcc compiler installed. My best practice to install the sources needed for module compiling is to install module-assistant and then start it and select the PREPARE command (you will find more detailed instructions in the omnibook kernel module section of this page).

After your download has finished, simply extract the zip archive and you'll get a nice deb package to install:

thomas@silver:~/downloads/conexant$ unzip ../hsfmodem_7.18.00.07full_i386.deb.zip
Archive: ../hsfmodem_7.18.00.07full_i386.deb.zip
  inflating: hsfmodem_7.18.00.07full_i386.deb
  inflating: LICENSE

Installing the package then is as easy as issuing sudo dpkg -i hsfmodem_7.18.00.07full_i386.deb. You will get asked where the linux source build directory is for your running kernel. Accepting the default (/lib/modules/2.6.12-1-686/build for me) should work out well if you've prepared your system with the help of module-assistant. Get some coffee while the installation is building modules for your running kernel.

When finished compiling, the driver installer will ask you about the country you are currently in. For me, it guessed AUSTRIA which is right, so I accepted the default. This is probably important for country-specific settings of modems. You can always change this with hsfconfig --region. Last but probably not least, you have to enter your e-mail address (that seems to be important when you go and register your driver, so if you are planning to buy the driver later, you might enter a valid e-mail address here). For the license key, you most likely want to enter FREE (e.g. accept the default).

This should finish the configuration and you will get a new device /dev/ttySHSF0. The installer will also automatically create a symlink from /dev/modem to that device. If you later want to enable full features (you'll have to pay for that), you can enter your license key with hsfconfig --license.

For a short check if everything is in place, enter lsmod | grep hsf which should show you a bunch of loaded modules that are related to your new modem drivers.

How to dial into your ISP

Now comes the cheesy part :) I've found wvdial to be quite usable. Simply install it with the usual sudo apt-get install wvdial and then go on to autoconfiguration (Answer Y to the question about autoconfiguartion). Be sure to have the ISP's phone number, your login name and your password available.

After autodetection, the wvdial config script should say something like the following:

Found a modem on /dev/ttySHSF0, using link /dev/modem in config.
Modem configuration written to /etc/wvdial.conf.
ttySHSF0: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

Before starting wvdial to dial into the internet, make sure you add yourself to the dip group. Here's how: sudo vi /etc/group, then add your username to the line that starts with dip. My username is thomas, so i changed the line dip:x:30: to dip:x:30:thomas. Now make sure you log out and log in again. Then, open up a shell and enter groups - you should see dip in the list of groups you belong to. Now, everything is set and ready to go.

If you've been connected to the internet by other means so far (for example, over ethernet), make sure to shut down all the interfaces so that your dial-up line gets the default route to the internet. I am usually connected via eth0, so I did a sudo ifdown eth0 to stop the ethernet device. With every kind of network connection disconnected, plug in your POTS (e.g. analog telephone) cable into your xe4500, fire up a shell and enter wvdial. Lean back while wvdial spits out status lines and you hear the good old modem sounds through your xe4500's speakers (or are you using headphones? :). That's it - you got your xe4500 internal modem working with Debian GNU/Linux. It's just 14.4kbps, but hey - you didn't pay anything for the driver :)

Fine-tuning hints

I want to add some hints for you to check out which may be helpful if you want to do the same I wanted to do and didn't know how to do it..

Playing FLACs in beep-media-player (bmp)

Unfortunately, beep-media-player (apt-get install beep-media-player) doesn't contain a Plug-In for FLAC audio files which I often hear. Therefore I mainly used xmms which is nice, but the GTK+1.2 interface just isn't cool anymore. Now what you do? The FLAC Plug-In for XMMS can be found in the package xmms-flac. If you haven't already installed it, install it now: apt-get install xmms-flac. A short dpkg -L xmms-flac tells us that the Plug-In is to be found in /usr/lib/xmms/Input/.

Now, for beep-media-player to recognize our xmms Plug-Ins (it seems to work so far for me) we have to make a symlink. I'll do it for my home directory. Fire up some terminal emulator, cd to your home dir (cd ~) and create the necessary directories, if they don't exist already (mkdir -p .bmp/Plugins). Go into that directory (cd .bmp/Plugins) and now make a symbolic link for all our XMMS Plugins (ln -s /usr/lib/xmms/Input) - of course, if you already have Input plugins installed, you will have to cd into your Input-Plugins directory and link all files there (cd Input ; ln -s /usr/lib/xmms/Input/*). Restart or start beep-media-player and try to open a FLAC file - it should play without problems :)

CD burning with k3b

For CD burning, I currently use k3b, because it's very easy to use and seems very stable. Unfortunately, it depends on some KDE libraries, but other than that it's great. You install it by a simple apt-get install k3b. If you want to have k3b in your language, you can install i18n for it by doing a apt-get install k3b-i18n. The rest of the configuration should be done automatically or with the help of k3b. I'm using kernel 2.6 - you might have to do some more configuration with kernel 2.4 (ide-scsi emulation).

gnome-volume-manager coolness without GNOME

From my Ubuntu time, I like the gnome-volume-manager daemon which really simplifies the use of removable media (usb sticks, iPod, harddisks). But as I am not using neither GNOME nor Nautilus, I have to do some hacks to get it working the way I want. As a file manager, I use the lightweight rox-filer (apt-get install rox-filer). First of all, we install the gnome-volume-manager packages and its dependencies and configure it:

apt-get install gnome-volume-manager

The properties dialog pops up and we can choose how it should behave. I selected the mounting of hotplug devices and the mounting of removable media. I didn't select the "blank cd media" option - you could open k3b there, for example. I also didn't select anything on the multimedia tab - again, you can select what you want there.

Up to here, everything should work out of the box. I also wanted to open rox-filer everytime i plug in hotplug devices. In the gnome-volume-properties dialog select the third option (the option to open/browse mounted media). Trying it out leads to no useful result - it mounts, but doesn't open (given you have not installed nautilus, which I haven't). Now, we will fix that too!

The reason for this "bug" is that the path of the file browser is hardcoded in the gnome-volume-manager executable:

thomas@silver:~$ strings `which gnome-volume-manager` | grep nautilus
/usr/bin/nautilus -n --no-desktop %m

Now you probably know what we are going to do: We create a wrapper in the file /usr/bin/nautilus. Become root and edit the file (sudo vi /usr/bin/nautilus). Write the following shell script into the file:

# nautilus "lookalike" for gnome-volume-manager
# Thomas Perl <thp@perli.net>, 25.09.2005

rox "$3"

We use $3 here because the first argument will be "-n" and the second "--no-desktop" when gnome-volume-manager calls us. Of course, if you want to use my nautilus "lookalike" script for other things than just gnome-volume-manager, you will have to do some more sophisticated parameter checking :)

Marijke vd Sijde adds: »I have the automounting working with konqueror. Just type "konqueror $3" in the nautilus file, it works as well :)«

Now, that's cool, but I have done two more things that I find useful (and because it is a shell script, you could do anything you like with it). The first thing is that my iPod's FAT partition has the label PERLIPOD - that's how I can recognize it and do something special with it. The second is that I have got a volume (it's an ipodlinux ext3 partition for the curious) that I don't want to open at all when I connect it - this might also be useful for a usb stick you don't want to open in a file manager for some reason. Now I will describe the two hacks one by one..

Open gtkpod when iPod is connected
This one is quite obvious. My iPod FAT partition has the label PERLIPOD, so it will get mounted at /media/PERLIPOD everytime I plug it in. Because the same directory is given as argument to (our) natilus, we can check the basename of the $3 argument, and if it is (for me) PERLIPOD, I can sync it with gtkpod by calling gtkpod instead of rox-filer. Now, I sometimes connect the iPod just because I want to charge it's battery and don't want to sync it. zenity to the rescue! zenity could be described as dialog for GTK+. With the line zenity --question --text="Du hast soeben deinen iPod angesteckt.\nWillst du ihn jetzt mit gtkPod synchronisieren?" && gtkpod I let it ask me if I want to sync it, and when I click OK, it will start gtkpod, else it will do nothing. As usual, you will have to have it installed (apt-get install zenity). You will find the whole script with iPod support below.

Do not open anything on special volumes
If you don't want to open rox-filer on special volumes, you could check the name of the volume or check for special contents. My way of doing it is th check for the file .perli-no-open (you can name it differently of course) and if it exists, rox-filer will not be opened. So for every volume I don't want to open I issue a touch .perli-no-open in the root directory of the volume. If I want to open it again, I rm .perli-no-open the file again. See below for how I use this technique in my nautilus "lookalike" shell script.

Now, here's the full script for both the iPod hack and the do not open hack. You have to save this script as /usr/bin/natilus to get used by gnome-volume-manager as mounting handler:

# nautilus "lookalike" for gnome-volume-manager
# Thomas Perl <thp@perli.net>, 25.09.2005

if [ "`basename $3`" == "PERLIPOD" ]; then
  zenity --question --text "Du hast soeben deinen iPod angesteckt.\nWillst du ihn jetzt mit gtkPod synchronisieren?" && gtkpod
  exit 0

if [ ! -f "$3/.perli-no-open" ]; then
  rox "$3"

Unmounting automounted volumes from /media
I got asked about how I do unmounting the automounted volumes that have been mounted by gnome-volume-manager the way i described above. I use a icon on my XFCE panel which is linked to a simple shell script:

PLATTEN=$(for i in `cat /etc/mtab | awk '{ print $2 }' | grep ^/media`; do basename $i; done)
AUSHAENGEN=`zenity --entry --text="which do you want to unmount: $PLATTEN"`

if [ "$AUSHAENGEN" != "" ]; then
  pumount "$AUSHAENGEN" && zenity --info --text="unmount successful."

For this code snippet, you need to install zenity and pmount packages. You probably already got pmount installed as a dependency for gnome-volume-manager.

For umounting, Marijke vd Sijde suggested the following: I recently found a way to unmount media quickly with the KDE tool KwikDisk.

As a last note I want to add that it should be possible to configure gnome-volume-manager to use a command other than nautilus for opening mounted media. For usability, that could be an option in gnome-volume-properties (I imagine a radio button for "open in file manager" for nautilus and another radio button + text box for "run command:").

apt-pinning and how to migrate to testing/unstable

I recently found myself needing more recent packages that are not available in current stable (Sarge). To address this need, I used a technique called apt-pinning. This allows you to install more recent packages from testing or unstable, but keeping the rest of the packages from the stable distribution. If a package from testing depends on another package from testing, apt will be so smart to install the dependencies, but only these that are really needed to be updated. I will not cover how to set up apt pinning, see this page for more information about apt-pinning: http://jaqque.sbih.org/kplug/apt-pinning.html.

What I want to show you is how you are using apt-pinning to install newer versions of some package. We start with a standard stable installation and are now going to install OpenOffice.org 2.0, because we need it for doing some work. To accomplish this, we can display all available versions of the package openoffice.org by issuing a apt-cache show openoffice.org | grep ^Filename. For me, this results in the following lines displayed:

thomas@silver:~$ apt-cache show openoffice.org | grep ^Filename
Filename: pool/main/o/openoffice.org/openoffice.org_2.0.0-4_i386.deb
Filename: pool/main/o/openoffice.org/openoffice.org_1.1.4-7_all.deb
Filename: pool/main/o/openoffice.org/openoffice.org_1.1.3-9_all.deb

If I now want to install the version that is in the unstable distribution, I install openoffice.org and all needed dependencies this way: apt-get install -t unstable openoffice.org. Apt will calculate dependencies and install all necessary new packages. Experiment a little bit with it. If you want to migrate your Debian system to the testing distribution, you would issue the following command: apt-get -t testing dist-upgrade.

Errors while compiling omnibook kernel module on kernel from testing: If you cannot compile the omnibook kernel module for a new Kernel from the testing distribution, you might have the wrong gcc version installed. For me, I've had installed gcc-3.3 from Sarge, but my 2.6.12 kernel I'm currently using from testing has been compiled with gcc-4.0. To fix this, simply install gcc-4.0 with apt-get install gcc-4.0. After that, the default gcc still is gcc-3.3 (as you can see when doing a ls -l $(which gcc)). To set gcc-4.0 as the default for the gcc command, simply run sudo ln -sf gcc-4.0 /usr/bin/gcc. Now extract omnibook kernel module source code, make, sudo make install and sudo modprobe omnibook. That should make the omnibook kernel module available for newer kernels too. If you still experience problems, run module-assistant and select the PREPARE task - this will download all kernel headers necessary to compile modules for your current running kernel.

How to defeat the noisy fan

After having showcased Xgl at school this week and rambling about the noisy fan, Steve came up with the glorious idea to use an air compressor to get rid of the dust inside the fan. Up until today, the fan of my xe4500 has had as much uptime as the xe4500 itself - no spin-down. So, today (20060325), I used a air compressor and cleaned the fan - and see! The fan finally cools down the CPU to about 41 degrees (celsius) at which the fan spins down. Now, we're in for more silence. Just for the curious: The fan turns on at about 50 degrees. So if you're having problems with the noisy fan, try to clean out the dust from the fan (no need to disassemble). Also, a pair of headphones will help you defeat fan noise beyond 50 degrees.

Unfortunately, setting trip_points to set the spin-down temperature to a higher value doesn't work on the xe4500 (also see this page for information about trip_points). The hp e-diagtools (to be found on the hibernate partition or the recovery CDs) has a mode to test the fan, which turns the fan off. The binary in question can be found on the first recovery CD in tools/cddiags/edt_cd.exe (this is a self-extracting zip archive). Use unzip /cdrom/tools/cddiags/edt_cd.exe to extract the archive - the file you are interested in is HPDT/FAN.EXE. I've extracted this file and put it online here in case you might want to try it out: xe4500-fan.tar.gz. Maybe someone with a knowledge of DOS reverse-engineering can use this DOS executable to find out how to control the fan using software?

Play with your xe4500 mute LED

Using the source package for the omnibook kernel module from 26th of January 2006 and this patch, you can compile a version of the omnibook kernel module that supports switching the mute led (the orange/yellow light that sits inside your mute button on the left of the xe4500) on and off.

Update: Mathieu Berard informed me that he has released a new fork of the omnibook kernel module that includes my patch: sf.net/projects/omnibook. Try it out!

Very simple firewall initscript

You can download a very simple firewall script that only allows outbound connections and inbound HTTP and SSH connections here: firewall. Place this in /etc/init.d/ and activate it by running update-rc.d firewall defaults.

Debian-related Links

http://www.hants.lug.org.uk/cgi-bin/wiki.pl?ManagingPackages/Apt › Package Management
http://jaqque.sbih.org/kplug/apt-pinning.html › Apt-Pinning

XE4500-related Links

http://www.impactcomputers.com/hewlett-packard-omnibook-xe4500-parts.html › Replacement parts for xe4500
http://h20000.www2.hp.com/bizsupport/[...] › hp support driver downloads for xe4500
http://h20000.www2.hp.com/bizsupport/[...] › hp support overview for xe4500 (helpful information)

Linux-on-XE4500 Links

http://www.net42.co.uk/linux-on-xe4500.shtml › Martin Johnson's Red Hat 7.3/8.0/9.0 and SuSE 9.0 on XE4500 pages
http://www.utc.fr/~villegas/docs/xe4500/ › RedHat Linux 8.0 on XE4500 by Marc Villegas
http://www.cc.jyu.fi/~jajuhein/xe4500/debian-on-xe4500.html › Debian GNU/Linux on XE4500 by Jari-Pekka Heini
http://alex.meindlsoft.net/index.php?kb_id=201 › Alexander Meindl's XE4500 page
http://www.wsp.ro/cristian/ › RedHat Linux 7.3 on XE4500 by Cristian Draghici
http://myy.helia.fi/~karte/[...] › Ubuntu Linux HP omnibook xe4500 by Tero Karvinen

http://zurich.ai.mit.edu/mailman/listinfo/omnibook › Omnibook Mailing List (General Linux-on-Omnibooks discussion)
http://sourceforge.net/projects/omke › Omnibook Kernel Module (for OneTouch Buttons)
http://sourceforge.net/projects/omnibookNEW Omnibook Kernel Module (in active development as of late 2006)

Mon Jul 9 14:53:40 2007 +0000