Debian Sarge on IBM ThinkPad T42F(p?) - TYPE 2373

Linux On Laptops
("Local" URL of this document)

System configuration:

lscpi output:

0000:00:00.0 Host bridge: Intel Corp. 82855PM Processor to I/O Controller (rev 03)
0000:00:01.0 PCI bridge: Intel Corp. 82855PM Processor to AGP Controller (rev 03)
0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB 2.0 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corp. 82801DBM LPC Interface Controller (rev 01)
0000:00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4) Ultra ATA Storage Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc RV350 [Mobility Radeon 9600 M10]
0000:02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
0000:02:00.1 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus Controller (rev 01)
0000:02:01.0 Ethernet controller: Intel Corp. 82540EP Gigabit Ethernet Controller (Mobile) (rev 03)
0000:02:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

Till obtaining this laptop I used 2.4 kernel series and I had only a few try to compile 2.6. To avoid the problem of upgrade I decided to install the new stable Debian release AKA sarge with 2.6.8-2-386 and later to migrate my stuff onto this machine.

Debian Installation

Debian Configuration

After I had setup root password and local user, I chose GUI Workstation, Mailserver and SQL server options in tasksel. This installed GNOME Desktop (with metacity wm) and at the X configuration I chose ati driver found in the official xserver-xfree86 debian package.

X resolution: 1400x1050 => nice unrendered fixed fonts in xterm

At first I tried X with 1280x1024 and 1280x960, however, I was not satisfied with the rendered fonts in xterm, especially when using mc. Then once, when I was browsing the menu of the panel of metacity I discovered a screen resolution configurator tool which offered 1400x1050. Trying this solved the problem of the rendered "not too nice" reverse font occurring in mc.

Harddisk test

~# hdparm -itT /dev/hda
/dev/hda:

 Model=HTS548080M9AT00, FwRev=MG4OA5DA, SerialNo=MRL402L4HKARDB
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=DualPortCache, BuffSize=7877kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=156301488
 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 
 AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled
 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a: 

 * signifies the current active mode

 Timing cached reads:   2776 MB in  2.00 seconds = 1386.13 MB/sec
 Timing buffered disk reads:  106 MB in  3.02 seconds =  35.08 MB/sec

Next task: suspend and hibernation

First, I installed acpid then I edited the scripts /etc/acpid/events/(sleepbtn,lid) and /etc/acpid/sleep.sh according to Sanjiv's page. (add also /etc/init.d/hsf stop if the hsfmodem driver package of Linuxant has been installed) These are activated upon pressing Fn+F4 and closing the lid, respectively. However, resuming from suspend to RAM ( echo 3 >/proc/acpi/sleep) resulted a blank screen. This problem could be solved with acpi_sleep=s3_bios kernel parameter.

The installed debian kernel was not configured for swsusp. Thus, I had to obtain the kernel source and patches to 2.6.12 (the latest stable version at the time of writing this). There were some problem with compiling the default DRM modules and the vesafb console support (vga=792 kernel parameter blanks the screen until X gets started). Choosing only the relevant DRM modules (excluding 3dfx, etc.) and compiling with the CONFIG_FRAMEBUFFER_CONSOLE=y option (i.e. fixed into the kernel) helped. (It took a while to figure it out...)

The default acpid recognises only battery (BAT), lid closing (LID), power button (PWRF) and Fn+F4 (SLPB) events, but not Fn+F12. Loading the module ibm_acpi helps (and echo enable >/proc/acpi/ibm/hotkey). Add it to the list of MODULES in /etc/default/acpid with battery (if you wish to check battery state) and modify the scripts in /etc/acpid/events according to acpi_listen. (I had to also add a hwclock --hctosys line in the resume section of the suspend-to-RAM script.) In order to enable automatically ibm_hotkeys I did:

cat <<EOF >/etc/modprobe.d/ibm_acpi
install ibm_acpi modprobe --ignore-install ibm_acpi; echo enable >/proc/acpi/ibm/hotkey
EOF

To use more keys with [Fn] key mask is to be set. E.g. echo 0x080f >/proc/acpi/ibm/hotkey enables F1 and F2, too. (If you want more try 0xffff!)

Trying to hibernate the system (echo 4 >/proc/acpi/sleep) showed strange behaviour: some times the suspend succeeded (2 or 3 times), but after then it hung after ACPI/PCI messages. So, I had to power off manually and fsck the crashed filesystems. The pci=noacpi kernel parameter did not even help.
There was a hint at configuring wireless adapter, that the PCI IRQs should be set to Auto instead of the default setting 11... No luck. :-(
Writing messages in the swsusp.c showed that the problem is at device_resume() function call in swsusp_write.

Without any further help I decided to download the patches of Software Suspend 2.1.9.5 and hibernate-1.10-1.rpm from www.suspend2.net. The latter was simply converted with alien and installed.
In the make menuconfig I have enabled only SWSUSP2 (not SWSUSP). Because the deb obtained from make-kpkg --initrd ... does not create a swsusp2 compatible initrd.img, it had to be "remake" after adding a resume2 script to /etc/mkinitrd/scripts:

#!/bin/sh
cat <<EOF >>$INITRDDIR/script
if [ -z "\$noresume" ]; then # be careful with the 'dollar' sign
    echo >/proc/software_suspend/do_resume
    umount -n devfs
    umount -n proc
fi
EOF

Then make it executable: chmod 755 /etc/mkinitrd/scripts/resume2 and mkinitrd -o /initrd.img
The result should be checked: mount /initrd.img /mnt -t cramfs -o loop && cat /mnt/script

I also added/changed the following options in /boot/grub/menu.lst:

# kopt_2_6_12=root=/dev/mapper/lnx-root ro vga=792 acpi_sleep=s3_bios \
    pci=noacpi resume2=swap:/dev/mapper/lnx-swap
#   ^^^^^^^^^^ I do not know whether this is necessary...
# altoptions=(recovery mode) single noresume

So when I choose to boot recovery mode (single) the resuming is skipped. (Todo: reinitializing swap partition during this type of boot method, see the comment in Software Suspend2 HOWTO at AVOIDING DATA LOSS)

Maybe it is not the best/nicest solution but it seems to work...

Wireless interface

According to lspci (see above) this machine has Atheros chipset. Thus, the madwifi driver should be compiled and installed following the instructions at madwifi.sf.net (cvs, etc.). One may need to aptitude install wireless-tools, as well.

CPU frequency control

The 2.6.12 kernel has default settings for CPU_FREQ, however, the installed cpufreqd package did not find /sys/devices/system/cpu/cpu0/cpufreq/ until the module speedstep_centrino was loaded. The fine tuning of /etc/cpufreqd.conf is still necessary...

To be able to change the CPU freq as user, the module cpufreq_userspace should be loaded, too --- if it was compiled as a module for the kernel. In this case and if processor is listed in MODULES in /etc/default/acpid, the following helps to load it automatically:
cat <<EOF >/etc/modprobe.d/cpu
install processor modprobe --ignore-install processor; echo "modprobe acpi_cpufreq ?"; modprobe speedstep_centrino
install speedstep_centrino modprobe --ignore-install speedstep_centrino; modprobe cpufreq_userspace; modprobe cpufreq_powersave
EOF
In the first install line the modprobe acpi_cpufreqd is only "echoed": I have not found it to be necessary. In the second install line cpufreq_powersave is also loaded indirectly upon invoking speedstep_centrino.

Modem setup

It is a pity, but slmodem-2.9.10 (www.smlink.com) does not work with this hardware. The compiled ALSA mode driver seems to be working, until ones tries ATDT which results NO DIALTONE (cd modem; make SUPPORT_ALSA=1; modprobe snd-intel8x0m; ./slmodemd --alsa).

Thus, I downloaded the scanModem tool from http://www.linmodems.org/, which guessed that it is an hsfmodem with CXT chipset. A driver for it can be obtained from http://www.linuxant.com/.

scanModem output:

Status/summary

Fn+F1 ifup/ifdown eth0 (ibm_acpi, 0x080f mask; e1000)
Fn+F2 ifup/ifdown wlan (ibm_acpi, 0x080f mask; ath_pci) 
Fn+F3 blank? (radeontool?, see Le blog de Noir-Bizarre)
Fn+F4 acpi_sleep=s3_bios (see Documentation/power/video.txt)
	if pressed at console with vesafb it garbles the screen ("solution": change to X)
Fn+F5 bluetooth?
Fn+F7 CRT switch? (freezes with debian vanilla kernel?) (S-Video switch?) atitvout package?
Fn+F12  swsuspend2 patch + hibernate script (installing bootsplash for GUI?)
Fn+PgUp ThinkLight!
CPU freq control: cpufreqd, speedstep_centrino
touchpad double-touch-click: it works with my kernel but not with vanilla
modem:	hsfmodem 
ide-scsi? (cdrecord with ide-cd? -- this seems to be the default in sarge)