Copyright © 2002 Ross Burton
Abstract
This document details how I installed Debian Woody and later Debian Sid onto an IBM X222 series laptop.
Table of Contents
Table of Contents
This document is a guide to how I installed Debian Linux onto my IBM ThinkPad laptop. I installed the unstable Debian packages, also known as "Sid". I am assuming that the reader has knowledge of Debian, specifically of the installer and configuration.
The hardware for which this guide is aimed at is an IBM X22 2662-05G laptop. This laptop has the following hardware:
I wanted to install Debian (specifically the branch named Sid) on this laptop as it my preferred Linux distribution. This, however, will prove to be tricky as the latest official release, Debian 2.2 (aka Potato), is rather old. The LinuxCare web site has a page detailing how to install various Linux distributions onto this laptop, but Debian is not mentioned. However, the information supplied is very useful as it gives hints towards what is required.
Table of Contents
Before Linux could be installed, I had to make room for it. I wished to keep Windows 2000 on the laptop so that I could boot into it if I needed to. To do this I installed Partition Magic 7 and looked at the partitions defined.
More hunting around revealed another copy of the Windows 2000 install CD, this time unpacked. I guess it is for the user when they add new hardware. In total there was nearly 2G of disk space being used by Windows 2000 images which I did not need. I did some research and found that IBM will send out rescue CDs if requested. Reports varied on the price from free up to $50 but I knew it was possible. With that information, I removed the rescue partition and deleted the Windows 2000 images. This gave me plenty of disk space to install Linux onto.
Using Partition Magic I resized the Windows 2000 partition to 5G (from 9G) and created a few new ext2 partitions. I have a natural habit of creating a /boot partition even on systems which won't require it, so I created a 10M partition for /boot and used the rest of the space for /. I did not format them in Partition Magic as Linux is much faster at formatting ext2 partitions, so I left that for the installation routine. Now I was ready to attempt installation of Linux.
I initially tried installing Debian 2.2, also known as Potato. This release is fairly old but stable and is how I originally installed Linux on my desktop machine. I docked the laptop to the MediaSlice and booted the CD and immediately hit a problem. When the kernel tried to start the md driver the laptop froze. 10 minutes on Google later revealed that this was a common problem with modern hardware an older version 2.2.x kernels. The solution is to boot with a modern kernel, either 2.2.x or 2.4.x.
I hunted around the Internet for replacement boot floppies, as the task of creating new boot floppies seemed rather daunting. This revealed the rather obvious fact that people producing boot floppies with the latest kernel 2.4.x are not the sort of people who will be running older releases of Debian, rather Woody, also known as the soon to be released Debian 3.0. This meant that the boot floppies will want to install Woody somehow which suited me as Woody is very similar to Sid. Thus onto...
I down-loaded the boot floppy images from htttp://foo.bar/. These disks were based upon the 2.4.7 kernel, Creating the floppy disks is trivial in Linux: dd if=boot1.img of=/dev/fd0 bs=1024 Repeating this command gave me four floppy disks: two for booting, one with the core modules and one with extra modules. I booted the kernel, crossed my fingers as the md driver loaded and didn't freeze, and then entered the Debian installer.
Once inside the installer I hit F2 to go to a bash prompt to see what hardware I could get working from the boot floppies. The floppy drive and CD driver in the MediaSlice were detected by the kernel so they were available. But the most important one was the network card, so that I could do a network install of Woody without having to download an entire ISO image first (the base install size of Woody is ~30M). The network card is produced by Intel and is a EtherExpress model, common in corporate desktops. I tried modprobeing eepro100, which detected the card but unfortunately bailed out when it did not recognise it. I had thought this would happen but was hoping it would not. [1] This left me with a laptop which has a floppy and CD-ROM drive, but no network connectivity in Linux. Not a good situation. However, when I am in Windows 2000 I have a working modem and network card, as well as over 2G of spare disk space.
At this point I could see several options: either download an entire Woody ISO image and burn it on to a CD, or find a way of bootstrapping the installer without a CD. One of the options in the installer as a source to install from is basedebs.tgz, which looked suspiciously like a tarball of the base packages. A search of the Internet confirmed this, however also revealed that the Debian release team would not create this file until Woody was officially released. Not to be dismayed, I investigated creating this file myself. Through sheer luck and perserverence I discovered the channel #debian-boot on irc.debian.org, which is dedicated to the Debian install routine. Here I was told about the package debootstrap which is designed to bootstrap a Debian installation from inside another Linux. This does not seem useful but one of the tasks is to create a basedebs.tgz.
I downloaded the source of deboostrap from packages.debian.org and built it on a RedHat 6.2 box. This involved a few changes to the source, all of which I have forgotten but were simple and obvious. I promise to recreate what I did and update this document in the future. Finally, I ran the script and 30 minutes later it had download the required packages and created basedebs.tgz. I copied this file onto C: whilst in Windows on the laptop, and the booted the Debian installer again. This time I could mount the Windows partition, select basedebs.tgz as a source, and the installation continued. When I restarted and finished the installation I had a basic, but working Debian system.
At this point I upgraded from Woody to Sid mainly because I already a snapshot of Sid on CD which meant I could install it without a network connection. This stage is optional, and everything should work just as well in Woody.
[1] Some updates to this are due.
Table of Contents
Now I needed the ethernet card to work so that I could update Debian. At the time the Intel EtherExpress Pro 100 drivers in the kernel did not work with the mini-PCI card fitted. I had to install GCC and tools, and then build the e100 driver from Intel. However, the kernel driver has been updated and I currently use kernel 2.4.18 and the stock eepro100 module. Installing this kernel is as simple as downloading the package kernel-image-2.4.18-686 in Windows 2000 from a mirror, and installing it with dpkg.
Now that a network driver is loaded, it is possible to use apt-get properly. I added entries for my local Debian mirror to sources.list, and did the usual dselect update && apt-get dist-upgrade. [2]
To use the IBM TrackPoint, or the "nipple" as it is commonly known, the kernel must support PS/2 mice. The stock kernel does, so this is not an issue. Remember to turn this option on if you compile your own kernel.
I tried for many days to get the mouse working in the console using gpm. Eventually I discovered the mouse type "fups2", which stands for "broken" PS/2. As a TrackPoint is not a real PS/2 device it is lacking many of the protocol's details, such as initialisation. This gave me a working mouse in the console. I could see the same problems happening again in X so I configured gpm to be a mouse repeater it reformats and repeats the mouse data as it is processed. This means that X can read this data instead of the real mouse device and everything should work.
device=/dev/psaux
repeat_type=msc
type=fups2
Now for graphics. The graphics card is an ATI Radeon Mobility LY, which is only supported by XFree86 4.2. Unfortunately, at the time of writing XFree86 4.1.1 is the latest packaged in Debian due to the maintainers efforts to get a perfect and stable XFree86 into the Debian 3.0 release. I could have checked out XFree86 from CVS and built it myself, but I found that had hit this problem a month beforehand and had built a tarball of XFree86 from CVS. This tarball is just the X server itself, so removing the package xserver-xfree86 and extracting this tarball gave me XFree86 4.1.99.1. With the following configuration in /etc/X11/XF86Config-4, X started correctly:
Section "Device"
Identifier "ATI"
Driver "ati"
VendorName "ATI"
BoardName "Radeon Mobility"
BusID "1:0:0"
EndSection
The mouse was trivial to configure. The primary pointer was A MouseSystems mouse reading from the gpm repeater file.
My desktop has a duel PS/2 and USB mouse. I decided that often I could take the laptop and the mouse so that I can have a more convenient pointing device. I was not sure if X could handle a device which was not always plugged in (thus the device will not always exist), but I was pleasantly surprised.
The TrackPoint is the "core pointer", and the USB mouse is told to produce events for the core pointer if it exists. If I did not do this, X would not start when the mouse was not plugged in, and when it was the USB mouse would control a second pointer which I could not see.
Section "InputDevice"
Identifier "TouchPad"
Driver "mouse"
Option "Device" "/dev/gpmdata"
Option "Protocol" "MouseSystems"
EndSection
Section "InputDevice"
Identifier "USB Mouse"
Driver "mouse"
Option "Device" "/dev/input/mouse0"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "TouchPad" "CorePointer"
InputDevice "USB Mouse" "SendCoreEvents"
EndSection
Originally I could not get sound working with kernel 2.4.7, however I have tried again with 2.4.18 and the sound works fine. modprobeing i810_audio creates the mixer and dsp nodes in /dev. The sound seems rather quiet compared to Windows 2000, but this may be a mixer issue. As the sound card is essentially from the Intel i810 chipset which is extremely common, support for it is ensured.
This section is incomplete.
To build the driver, download the latest ltmodem from SOMEWEBSITE I am using ltmodem-6.00b8.tar.gz. As the driver is a kernel module the kernel headers are required, if you are using a stock kernel install the relevant headers (for example kernel-headers-2.4.18-686). If you built your own kernel I assume you know how to get the required headers. Then extract the drivers and run the script build_deb. The script should find the kernel headers, compile the module and build a Debian package. This package can then be installed using dpkg -i.
Now add ltmodem to /etc/modules so that the modem driver is loaded on startup, and configure a PPP connection as usual. Instead of using a device such as /dev/ttyS0, use /dev/ttySLT0 to access the internal modem.
This section is incomplete.
tpctl is a program for controlling the ThinkPad's special hardware.
get thinkpad-modules, build, install.
This section is incomplete.
Mention hdparm, keyboard change on suspend, hibernation, noflushd if not using ext3 or reiserfs.
[2] Note that running dselect update opposed to apt-get update also updates dselect's list of packages.