Installing Debian Woody on an IBM A22p

My goal was to set up my new IBM A22p in a dual boot configuration with Windows 2000 and Debian GNU/Linux Woody. This document traces through the steps I took. I hope it's useful to other people trying to the same or similar.

Steps toward a useful installation

Repartitioning the FAT32 partition

I ran FIPS to repartition the FAT32 partition, to free up space for the Linux partitions. Here are the steps:

Make sure to defragment the disk before running FIPS, or else you won't be able to make a very big partition for Linux. This is under Control Panel / Administrative Tools / Computer Management / Storage / Disk Defragmenter.

1. I created a DOS bootable floppy from the "System utilities" menu of the Product Recovery program (press F11 on boot). This floppy is called the "Recovery Repair" disk.

2. I unzipped fips 2.0 from the tools/ subdirectory of the Debian Potato CD, and copied fips.exe, restorrb.exe, and errors.txt to the floppy.

3. I booted the floppy and ran fips.

There are a number of different techniques for repartitioning the FAT32 partition, including parted (a Debian package, but is not available on the Potato boot CD), fips, and Partition Magic (a proprietary app).

Installing Debian

I started by installing a minimal Debian Potato system from CD-ROM. This install was unremarkable. Then, I set my /etc/apt/sources-list file to refer to woody as follows:

deb woody main contrib non-free
deb woody/non-US main contrib non-free

In theory, upgrading from Potato to Woody should be as simple as "apt-get update; apt-get dist-upgrade". However, I must not have good Debian karma, as the process required all sorts of hand-tweaking, including manual installation of some .debs, creating directories, etc. I won't go into the details here, as I believe the actual install process changes from day to day.


Probably the easiest way to get X running quickly and well is to borrow someone else's XF86Config-4 file. I borrowed this one from Peter Schwenke, who has installed Red Hat 7.1 on his A22p.

GPM has caused me all sorts of problems, so I removed it (apt-get remove gpm). If you're not running GPM, you either want to "ln -sf psaux /dev/mouse", or make sure that your XFConfig86-4 file contains this line:

        Option      "Device" "/dev/psaux"

Here's my resulting edited XF86Config-4 file.

I don't use consoles enough to really care that the mouse works in them. GPM was sorta working at one time, but it broke and I can't figure out why. If you get it working, let me know and I'll report it here.

Rebuilding the kernel

I replaced the 2.2.18pre21 kernel that comes with Debian Woody with my own custom 2.2.19 kernel, and it works a lot better. For one, my A22p came with a 3Com "Mini PCI" modem/Ethernet combo card, so there's Ethernet on the rear of the machine rather than a PCMCIA slot. The old kernel wasn't very happy with this hardware, but with the new one, the 3c59x driver works just fine.

Here's the .config file I used to build my kernel. It's fairly lean and mean, so if you've loaded your system up, you'll probably want to add more stuff.

I basically worked from the newbiedoc documentation from SourceForge. Here's a very quick summary of the steps (as root):

apt-get install kernel-source pcmcia-source alsa-source (and whatever other helper utilities you need)
cd /usr/src
tar xf kernel-source-2.2.19.tar.bz2 --use-compress-program bzip2
ln -s kernel-source-2.2.19 linux
tar xfz pcmcia-cs.tar.gz
patch < apa1480_stub-patch
tar xfz alsa-driver.tar.gz (if you want alsa sound)
tar xfvz tpctl.tar.gz (if you want tpctl)
cd linux
make xconfig
make-kpkg --revision=custom.1.0 kernel_image
make-kpkg modules_image
cd .. (to /usr/src)
dpkg -i kernel-image-2.2.19_custom.1.0_i386.deb \
  alsa-modules-2.2.19_0.9+0beta4-5+p0+custom.1.0_i386.deb \
(if you want alsa sound, see below)
  tpctl-modules-2.2.19_0.8.1-5+custom.1.0_i386.deb \ (if you want tpctl)


Hibernation doesn't seem to work at all from Linux.

Suspend I have mostly working now. The network card doesn't like to be suspended, so I stuck a little script in /etc/apm/event.d to shut down and restart the network.

It turns out there are roughly five ways to suspend the computer: apm -s, tpctl --Z, closing the lid, pressing Fn-F4, and waiting for the suspend timeout. Of these, I've only observed apm -s to actually invoke /etc/apm/apmd_proxy suspend. The others seem to immediately suspend, then call /etc/apm/apmd_proxy resume when the machine wakes up.

Suspend doesn't seem to be 100% stable - sometimes the machine hangs hard on resume.

The CD-R drive

My A22p came with a Sony CRX700E CD-R drive. To set this up, I did the IDE-SCSI dance. 1. Made sure the kernel was built with IDE-SCSI support. The .config file described above takes care of this, but here are the relevant lines if you prefer to DIY:


# SCSI support

# SCSI support type (disk, tape, CD-ROM)
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
2. The following line added to my /etc/lilo.conf:
3. Added /etc/modutils/cdr:
alias block-major-21 sg
alias scd0 sr_mod
4. Changed /dev/cdrom link to point to /dev/scd0 rather than /dev/hdc, so that mount /cdrom talks to it through ATAPI-SCSI, rather than vanilla IDE:
ln -sf scd0 /dev/cdrom


As always, there are two paths to sound: OSS and alsa. I got OSS to work first, shortly followed by alsa.


I wasn't able to get OSS sound working with the 2.2.18pre21 kernel. With the custom 2.2.19, it works pretty well. I built the cs46xx driver as a module when configuring the kernel, and added this /etc/modutils/oss file:
alias char-major-14 cs46xx


Configuring sound with alsa on Debian is definitely a hassle. I don't have much confidence that the Debian alsaconf actually puts the config file in the right place - it seems to have written /etc/alsa/modutils/0.5 and 1.0, while modutils actually pays attention to the file in /etc/modutils/alsa.

In any case, installing the following /etc/modutils/alsa seems to work:

# --- BEGIN: Generated by ALSACONF, do not edit. ---
# --- ALSACONF verion 0.4.3b ---
alias char-major-116 snd
alias snd-card-0 snd-card-cs46xx
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
options snd snd_major=116 snd_cards_limit=1 snd_device_mode=0660 snd_device_gid=29 snd_device_uid=0
options snd-card-cs461x snd_index=0 snd_id=CARD_0 snd_dac_frame_size=4 snd_adc_frame_size=4
# --- END: Generated by ALSACONF, do not edit. ---

After setting up alsa, I find that sound and mixers designed for OSS work fine, but amixer and alsamixer don't. I'm happy enough with OSS that I don't feel like bothering with this right now, but if you figure it out, let me know.

General modutils notes

After you update the files in /etc/modutils, make sure to run update-modules to update the actual /etc/modules.conf file, which is essentially the concatenation of the files in /etc/modutils. Then, you can use modprobe to insert the actual modules. I'm happily switching between alsa and OSS in the same login session as I type this.

The alsa-base package should hopefully have set up the /etc/modutils/alsa-path file, which lets modprobe find the alsa kernel modules.


Thomas Hood's tpctl utility allows you to fiddle with lots of fun things on your ThinkPad. I found that some things work pretty well, and others don't.

Working features: --S --io --is --sx --pmx --prx --psx --ptx --rx

Not working features: --ib --ir --pdx

Not yet sure: --H (hibernation doesn't work) --Z (suspend causes crashes right now)

Other resources