Debian GNU Linux on HP XE3 Laptop

Introduction

I own a Hewlett Packard Omnibook XE3-GF laptop (product number F3956HT), and I have spent heaps of time lately to install and configure Debian Linux on it. I will describe how I got most of the hardware to work, but also which software I'm using and how I had to configure it in order to run properly.

Contents

Problems
First Setup
Compile a new Kernel
XFree86
DHCP Client
Sound
Audio-CDs
CD-RW
Read WinXP-Partitions
Use a different Display Manager
Xlib-Error
Modem
Omnibook Module
Onetouch Buttons
USB Mouse Support
Power Management
Synaptics Touchpad
Import Mail from Outlook Express to Evolution
Import Address Book from Outlook Express to Evolution
3D support for the Intel i830 Grafics Card
Removing the Internal Keyboard
Typing International Characters on a US Keyboard
Mounting FAT-formatted Floppy Disks
EXT3: Adding Journalling to your Filesystem
USB Joystick
External USB Drives
Links
Contact Me

Problems

Let's talk about the bad things first. At this moment, there are the following problems with my linux-laptop installation: Any help with these problems would greatly be appreciated. Thanks and I hope you find my webpage useful.

First Setup

I downloaded the woody network-install-iso-image from www.debian.org and burned it onto a CD. Then I tried to shrink my WinXP partition using PowerQuest Partition Magic 8. Unfortunately, it managed to destroy my WinXP partition, so I had to delete all my harddisk-partitions. So, if you try to resize partitions, make sure to backup all your important data such as mail-folders, address books, MP3s etc.. before you start.
Next, I first re-installed WinXP, cause it's always good to have a running version of it. But I only made a partition of about 10 GBytes for WinXP. Then, I booted from the Debian Woody netinst CD. Everything works fine, one can easily specify the partitions one likes, for instance:

Name Flags Part Type FS Type Size (MB) Use
hda1 Primary IBM Thinkpad Hibernation 24.68 Whatever..
hda2 Boot Primary NTFS 10487.24 Windows XP
hda3 Primary Linux ext2 16.46 /boot partition for Debian
hda5 Logical Linux swap 254.99 swap partition for Debian
hda6 Logical Linux ext2 3997.49 The main Linux partition
Logical free space 15000
Note that it is often a good idea to make an own partition for the /home directory. This has the advantage that if you need to re-install Linux, you can leave this partition untouched and all your personal user settings will be conserved.

The networking adapter is not automatically recognised. Choose manually the driver "EtherExpressPro/100" from the section "Ethernet (10 or 100 Mbit)".
In order to get the soundcard (ESS Technology ES1988 Allegro-1) working, be sure to say YES to experimental kernel options and choose "Maestro3" in menuconfig's "Sound" section.
From there, you can install via network whatever packets you like. For a start, it's a good idea to use tasksel and pick the "X-server and window managers" set.

Compile a new Kernel

Now, in case you want to use the touchpad, some USB-mice, the winmodem, and other cool stuff like IrDA, WLAN PCMCIA cards, Bluetooth dongles ..., you will be forced to compile a new kernel into your system. Get the newest Kernel source from www.debian.org. You can find a Debian package containing the source. Normally, you can get this package using dselect. If not, download it from a Debian FTP mirror and install it using dpkg -i package-name.
Now, change to the directory where the kernel-source has been put, e.g. /usr/local/src/kernel-source/kernel-source-2.4.18 (you can see here that I am currently using kernel 2.4.18). Then, configure the kernel-source using make menuconfig. You can find my actual kernel configuration here. Next, compile the kernel source. It is very handy to use the make-kpkg command. This will construct a Debian package containing the new kernel image, which makes the task of installing the new kernel image very easy. To be able to use make-kpkg and make menuconfig, you will need the following additional Debian packages:
kernel-package
ncurses-dev


Type make-kpkg --revision=custom.1.0 kernel-image and if everything goes well, a .deb file will be created in the parent directory. Thus, type cd .. and then you may install the new kernel image using dpkg -i kernel-image-2.4.18_custom.1.0_i386.deb.

During the installation of this home-made package, the system asks you if want to change anything with lilo or the master boot record. The best way is to say "no" everywhere, but: you need to run lilo manually after that. (Run it in superuser mode.) This will cause lilo to re-scan for kernel images, so it will recognize the changes you have made. If you are installing a new version of the kernel, the current version of the kernel will be saved (using the .old notation), and you will still be able to boot it from lilo. If you are re-compiling the existing kernel version, it will be overwritten.

Of course, according to what hardware you are using, you won't need all of the kernel options I have activated. (You may also need some more kernel options.) So be careful if you simply load my configuration file. You will find more details concerning several of the kernel options in the following sections.

XFree86

If you simply install XFree86, you will enter a guided configuration application. Enter the following values:
X server driver: vesa (not i810, this only works if your kernel supports the intel grafix chip, or if you have the intel chip driver installed)
User kernel framebuffer device interface: YES
[...]
Keyboard: pc104 -- de_CH -- nodeadkey -- [no options]
Mouse: /dev/psaux -- PS/2
Monitor _is_ LCD: Medium -- 1024x768 @ 60Hz
1024, 800, 640 -- 16 bit

After this, you will need to edit the file /etc/X11/XF86Config-4 manually. Remove the option "DPMS" from the section "Monitor". Now, XFree86 should work. You will see later how to optimize it for using all the mouse buttons, an external USB mouse, and the 3D- and Powersaving-options of the Intel grafix card.

DHCP Client

The client is installed by default. But it does not work unless you activate the following kernel options:
Networking options --> Socket Filtering: y
Networking options --> Packet socket: y

Sound:

If the soundcard does not work, make sure you have activated the following kernel options:
Code maturity level options --> Prompt for development and/or incomplete code/drivers
sound --> maestro3: M

Then, add the new module maestro3 using modconf. Then, add the following line to /etc/modules.conf: alias sound maestro3. Also add the users that are supposed to use the soundcard to the "audio" group.

Audio-CDs

In case you are unable to read audio-CDs when logged in as a normal user, add your user to the group "cdrom". (Remark: Audio-CDs cannot be mounted, but audio-CD-software can read them just as well.)
Also change the group of /dev/sg* to "cdrom":
cd /dev
chgrp cdrom sg*

CD-RW

To use the Toshiba CD-R/CD-RW combo drive to burn CDs, do the following:
Recompile the kernel with the following options:
Block devices --> IDE/ATAPI CDROM support Y
Block devices --> SCSI emulation support Y
SCSI support --> SCSI support Y
SCSI support --> SCSI disk support Y
SCSI support --> SCSI CD-ROM support Y
SCSI support --> SCSI generic support Y


Add the following line to /etc/lilo.conf:
append="hdc=ide-scsi"
then execute lilo in su mode and load the modified lilo.conf

su
cd /dev
ln -s sr0 cdrom
ln -s sr0 dvd

Add the following lines to /etc/fstab:
/dev/cdrom /cdrom iso9660 ro,user,noauto 0 0
/dev/dvd /dvd iso9660 ro,user,noauto 0 0

Read WinXP-Partitions

Recompile the kernel with the following option:
File Systems --> NTFS file system support (read only) Y

Add the following line to /etc/fstab:
/dev/hda2 /winnt ntfs ro,user,noauto,uid=eperron,gid=users 0 0
The different options mean the following:
ro - read only
user - any user may mount it
noauto - one needs to mount it manually
uid=eperron - the owner of the mounted directory will be "eperron"
gid=users - the group of the mounted directory will be users

Use a different Display Manager

By default, Debian Linux installs the XDM display manager. If you want to use a different display manager, like KDM or GDM, the only efficient solution I found was to remove all the display managers you don't want using dselect.

Xlib-Error

If you execute a graphical application as super-user, the following error-message may appear:
Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server
xhost: unable to open display ":0"


To solve the problem, open an X-shell and make sure to log into the system as the user who started the X-session (that's normally your standard user).
Type:
xhost +

Modem

The XE3 laptop contains a winmodem by ESS. Winmodems are, as one might suggest, modems designed for MS Windows. They are very cheap, because a big part of the communication tasks is fullfilled by the driver software instead of the modem itself. But that's exactly what makes writing a driver for these modems so difficult. These circumstances and the fact that ESS doesn't publish the hardware specifications are the reasons why there is no open-source driver for the ESS winmodems.

However, sometime, some guy at ESS had written a Linux-driver for kernel 2.2.x, but he only published the binary module file. Some guys have hacked that file to work also with more recent kernels (see links section). The module works, but it is very experimental and often causes the system to freeze. So be careful while using it and make sure you're using a journalling filesystem to avoid data-loss due to system freezes (see the EXT3-section for more details).

Take the driver ess-modem-1989.tar.gz from here and untar it to some directory. Use fixscript on it to change the kernel version number in the file esscom.o. This will allow you to have the module installed without having to force the insertion (the system will believe that you compiled this module for your current kernel).
./fixscript18 esscom.o essmodem.o
There will be a new file called essmodem.o that is the new, modified module binary. If fixscript complains about unknown symbols or displays error messages containing new="", recompile the kernel with the following option:
Loadable module support --> Set version information on all module symbols

cp essmodem.o /lib/modules/2.4.18/misc/
where 2.4.18 should be replaced with the version number of your current kernel.

Start modconf, choose the essmodem module under misc and insert it into the standard boot configuration.

Create links /dev/ttyS15 --> /dev/essmodem and /dev/modem --> /dev/essmodem (e.g. ln -s /dev/essmodem /dev/ttyS15).

Finally compile networking devices --> ppp_asynch into kernel. The modem is now ready to work.

To avoid system crashes: I had the best results when plugging the phone cable before starting the machine, and only unplugging it after having shut down the machine. Like this, system freezes happen only very rarely. Attention: if your phone rings while the phone cable is plugged into the modem, my system freezes almost certainly.

Configure PPPD:
As super-user, run pppconfig
add connection
modem not identified automatically
as a device-name, choose /dev/ttyS15
Go to "advanced options", select "add user" and enter your standard username. This will allow your standard user to establish ppp connections.

To establish a ppp connection: type pon.
To disconnect: type poff.

In case you want to use an application or applet to establish connections and to monitor the modem traffic, it's useful to know that the lock file of the modem is at /var/lock/LCK..ttyS15 and that the device-name is ppp0.

Omnibook Module

There exists a quite nice kernel module that has been designed explicitly for omnibook laptops. It is useful for several things: the screen turns off when the console is blanked by a power saving deamon, the omnibook module can emulate APM support, which allows you to have an applet that displays the battery status, and some buttons like the onetouch buttons on the keyboard will work. To get this kernel module, download the latest release from http://sourceforge.net/projects/omke and install it easily with
make
make install


One drawback is that on my computer, the module sometimes stops working during a few seconds or up to several minutes. This happens especially while I am using the keyboard. I have no idea why this happens. It does not seem to be a common problem, and the guys from the OMKE project have never replied to my posting in the newsgroup.

Onetouch Buttons

Simply install the Debian package hotkeys. Use xev to find out the keycode of the extra buttons, and create an own .def file in /usr/share/hotkeys/. You can even use the play, forward, backward buttons on the front of the laptop (the ones for the CD-drive) and configure them to use XMMS.
Click here for an example of a .def file.
Sometimes, a few changes on the file /etc/hotkeys.conf are necessary. Click here for an example.

to start hotkeys in the background, execute hotkeys -b.

USB mouse support

Recompile the kernel with the following options:
Input core support --> Input core support Y
Input core support --> Mouse support Y
USB support --> Support for USB UHCI (NEW) Y
USB support --> USB Human Interface Device (full HID) support Y
USB support --> HID input layer support Y
USB support --> /dev/hiddev raw HID device support Y


Then, you shoud edit /etc/X11/XF86Config-4 and add the following section:
Section "InputDevice"
Identifier "Generic Mouse"
Driver "mouse"
Option "CorePointer"
Option "SendCoreEvents" "true"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "off"
Option "Buttons" "5"
EndSection


Click here for an example XF86Config-4 file.

Power Management

There are two different standards for power management: APM and ACPI. APM does not work unless you have installed the omnibook kernel modules. Some of the ACPI functionalities work, but only a few. However, it's still worth installing ACPI. The main advantage ACPI brought to me was that the machine would turn itself off automatically when shut down and that one could switch from the X-server to the console and still see something.

To activate ACPI support, recompile the kernel with the following options:
General setup --> Power management Y
General setup --> ACPI support Y
General setup --> "all acpi options" Y

Then make sure that the debian package acpid is installed.

The Omnibook module is able to emulate APM battery status monitoring. For using this option, make sure to have
General setup --> Advanced Power Management N
i.e., you need to disable the kernel APM support.
When inserting the omnibook kernel module with modconf, add following command-line args:
apmemu=1 user=1

Synaptics Touchpad

The built-in Synaptics touchpad works with it's basic functions if you use the standard PS/2 driver of XFree86. But there exists an excellent driver for this touchpad that supports all the buttons, and has some additional options, like scrolling on the right edge of the pad or middle-click if you tap with two fingers, right-click if you tap with three fingers.
Download synaptics-0.11.3.tar.gz from this website. In the beginning, the scroll-buttons between the two touchpad-buttons did not work. The authors of the driver sent me a patch named synaptics.c.firmware-major-check-fix.diff that solved this problem.
Unfortunately, in case you can't get a driver for your version of XFree86, you need to download the source code of your XFree86 version, because you need it to compile the driver. You find the source code (of version 4.1.0) at /debian/pool/main/x/xfree86/xfree86_4.1.0.orig.tar.gz from a debian FTP mirror. The source code is over 50 MBytes large.
Recompile the synaptics_drv module as described in the synaptics-driver INSTALL file. Copy the module synaptics_drv.o into the XFree86-module folder, that is /usr/X11R6/lib/modules/input. Edit /etc/X11/XF86Config-4:
Section Module, add
Load "synaptics"
Section InputDevice:
see the my XF86Config-4 file.

Import Mail from Outlook Express to Evolution

First, download the Windows version of Mozilla from www.mozilla.org. Boot your Windows partition and import Outlook Express mail folders into Mozilla. Re-Boot Linux. Mount your Windows-XP partition (read here how to do this). In Evolution, select File --> Import --> File --> Mbox, then select the file "my-file-name" from the Mozilla mail file on your Windows-XP partition (not the file "my-file-name.msf").

Import Address Book from Outlook Express to Evolution

Boot your Windows XP partition. Export Outlook Express address book in .csv format (comma separated values) and transfer the .csv-file to Linux.
Evolution wants the vcard format for import of addresses. This is why you need some conversion tool. Get csv2vcard from sourceforge.

To run it, you need the ruby interpreter ("ruby" package in Debian). Ruby is some programming language, I don't know it but it seems to work and to be good at text processing.
You also need the CSV module for ruby csv-1_2_1.tar.gz, which can be found here. To install this module, just unpack the tar.gz and run install.rb this ruby-script will install the module (it's already compiled, or doesn't need to be compiled or whatever). You also need the the debian packages libgtk-ruby, glade and libglade-ruby.

Now, you unpack csv2vcard and run cvs2vcard.rb. Select the .csv that you exported from Outlook Express and convert it. Attention: the Outlook Express .csv format has semicolons as separators, whereas csv2vcard requires commas, so open the .csv file with xemacs first, delete all "," then replace all ";" by ",".

3D support for the Intel i830 Grafics Card

There is a nice open-source driver for the intel grafics adaptor. You can find it on intel.com.

For compiling the driver modules, you need the agpgart module to exist on your machine:
Recompile the kernel with the options
character devices --> agpgart support M.
But make sure the agpgart module is NOT installed (rmmod agpgart, you may have to start your machine in non-graphical mode to do this) when compiling the driver.
Download the file i830-20030120-i386-linux.tar.gz (or a newer version), unpack it and run install.sh. This will compile the driver modules. It will also replace the agpgart module by a different version. If the installation succeeds, use modconf to insert both agpgart and i830. Finally, set Driver in section Device of /etc/X11/XF86Config4 to "i810".

To run 3D-games, you need the opengl-libraries installed. For debian, I installed the package libglu1-mesa and all it's dependencies.

Removing the Internal Keyboard

I recently got myself a new keyboard because I broke a key on the old one. One wouldn't believe how sensitive these keys are (I dropped my webcam on it, and it broke). The new keyboard is a US layout keyboard, while the old one was Swiss german. Please read the following section about how to type international characters on a US keyboard. In case you want to change keyboard, here is a description about how to do it: The keyboard that was inside my laptop was labeled
Model MP-99886CH-698
P/N PK1332N1700
My new keyboard is labeled:
Model MP-99883US-698
P/N PK1332N1000
You should check out the HP Partsurfer and enter the product number of your laptop to see what hardware fits inside it.

Typing International Characters on a US Keyboard

If you want to have a normal US keyboard, make sure the keyboard section of /etc/X11/XF86Config-4 reads as follows:

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc104"
Option "XkbLayout" "us"
Option "XkbVariant" "basic"
EndSection


However, if you want to have a US keyboard with support for international characters, like Umlaute and Accents, the layout option should read:

Option "XkbLayout" "us_intl"

If you want to switch back and forth between the two modes, open any terminal emulation and type

setxkbmap us_intl
or
setxkbmap us

Unfortunately, you will have to restart your hotkey-manager after that, otherwise the onetouch-buttons won't work anymore. The best way to solve this problem is to make two shell-scripts that do the switching and the restart of the hotkey-daemon. Then, you can put some clickable button or define some key-shortcut that executes the script for you.

Mounting FAT-formatted Floppy Disks

If you wish to mount and use FAT-formatted floppies, (the ones everybody is using) without messing around with the M-tools, just recompile your kernel with the following two options:
File Systems --> DOS FAT fs support Y
File Systems --> MSDOS fs support Y

Also, make sure the fs-type field in /etc/fstab is set on "auto" for /dev/fd0.
Now, you can mount a floppy disk with mount /dev/fd0. If it does not work, insert the floppy disk into the drive and try again.

EXT3: Adding Journalling to your Filesystem

With a normal ext2 partition, like it is created by the Debian woody setup program, a system crash is very annoying: the whole harddisk needs to be scanned, errors must be corrected, and even then, some changes you did on files and you saved to the disk before the crash might be lost, the clock might show a wrong time etc...
This is all not necessary. It is extremely easy to add journalling to your filesystem. Journalling means that the filesystem reports all the changes into a journal as soon as they are made by the user (like write such and such into file blabla.txt). Before the change is actually executed, a "go back" entry is made in the journal, that allows the system to put the harddisk back to the last consistent state in case it crashes in the middle of a writing operation. The EXT2 filesystem with added journalling is called EXT3.

But enought theory. To transform your EXT2 filesystem into an EXT3 filesystem without losing any data, do the following:
Recompile the kernel with the option
File Systems --> Ext3 journalling file system support Y
Then, as root, type
tune2fs -j /dev/hdaX
where /dev/hdaX is the name of the hard disk partition you want to transform.

If you create a new partition on your harddisk and want it to be in EXT3 format, type
mke2fs -j /dev/hdaX

Finally, make sure to set the fs-type of the corresponding partition in /etc/fstab to ext3.

USB Joystick

There are a few games under linux that are fun and that are easier to play with a gamepad, like koules or the NeoGeo-emulator gngeo. This is why I decided to get my Microsoft SidWinder GamePad to work on my laptop. Actually, it's very easy. Just recompile your kernel with the options:
Input Core support --> Joystick support Y
USB support --> USB Humen Interface Device (full HID) support Y


This will create new devices /dev/input/js0 to .../js3. For some games, e.g., koules, you need to make symbolic links:
ln -s /dev/input/js0 /dev/js0
ln -s /dev/input/js1 /dev/js1
ln -s /dev/input/js2 /dev/js2
ln -s /dev/input/js3 /dev/js3

External USB Drives

I only have USB1 on my laptop. So, what's the point in having an external drive on USB1? The point is that a lot of devices are recognized as external harddisks. For instance my Casio Exilim digital camera, and my Creative MuVo MP3 player. Here's what needs to be done:
Recompile your kernel with the following options:
USB support --> USB Mass Storage support Y
File systems --> VFAT Y

Unplug the USB device. As root, type
tail -f /var/log/messages
Now plug the device into your USB port and observe the tail-output. It should say something about new mass storage device and should end up telling you about a new SCSI harddisc, normally /dev/sda0, /dev/sdb0 or similar.
Add the following line to /etc/fstab:

/dev/sdb1 /usb_drive vfat ro,noauto,user 0 0

where you should replace /dev/sdb1 by the name of the device and /usb_drive by the name of a directory that you will create. Now, any user can mount the USB device by typing mount /usb_drive. Some people write that they observed a kernel panic when unplugging a mounted USB device, so make sure you always umount it before unplugging. However, I unplugged a mounted device several times without problems.

Attention: Not all USB devices will work with Linux. First, they have to be recognized as external harddrives. (It should say on the box: "no drivers needed for WinXP".) But even then, it's not sure that the device will actually work. Check out Google to look for success reports by other Linux users before buying new hardware. You might also want to look at this list of supported Linux devices. If you don't find it there, don't give up. The list is not complete.

Links

TuxMobil - The first place to look for information about Linux on mobile computers
MINI-FAQ for the ESS modem driver
Omnibook Kernel Module
Tuxmobile - Linux on Mobile Computers (former Mobilix.org)
CVS2VCard - Conversion Tool for Address Books
support.intel.com - Intel grafics drivers for Linux
HP Partsurfer Site.
Linux-USB Device Overview

Contact Me

If you have any comments, suggestions or greetings, please write an email to info AT perron DOT com. Before you ask any technical questions, please make sure to spend a fair amount of time reading this page and searching for and answer on Google.
Please feel free to check out my personal webpage at
www.perron.ch.