Installing Debian Sid (June 2005) on a ThinkPad T43

From ThinkWiki
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Please update with any contextual or cosmetic changes you feel appropriate.

June 30, 2005: Installing Debian/Sid (Unstable) on the T43 proved to be a very long process. Support for the relatively new machine should get much better over time, perhaps making much of this guide unnecessary. A great deal of useful information can be found in the T43 Category hardware page, and the other T-Series installation guides over on the Debian Category page.

Installation

Partitioning the hard drive

The thinkpad comes with Windows XP preinstalled but not set up. If you want to keep Windows it may be a good idea to turn on the machine and let it go through the Windows setup process before shrinking the partition. One step of the process is to convert the FAT32 windows parition to NTFS. The FAT32 partition may be easier to resize, but ntfsresize in Linux works fine too. For easy resizing, boot up in Knoppix 3.9+ with kernel 2.6 (earlier versions of Knoppix do not contain a 2.6 Kernel capable of handling the SATA drive). Once Knoppix is loaded head over to K->System->QtParted and you will be presented with a nice GUI for resizing the Windows partition. The Windows NTFS and IBM system restore FAT32 partitions take up 2/4 primary paritions, which doesn't leave much room for expansion. Between QtParted and cfdisk I partitioned my hard drive as:

- sda1 Primary      NTFS             20 GB
- sda3 Primary      Linux (reiser4)  20 GB   (/)
- Extended                           remaining space (~30GB)
   |- sda5 Logical  Linux (ext3)     256 MB  (/boot)
   |- sda6 Logical  Linux (ext3)     30 GB   (/storage)
- sda2 Primary      FAT32 (system restore)

If I started over I would probably put everything in a single extended parition. The reiser4 root parition here causes a lot of trouble because of the lack of widespread reiser4 support. The strategy here is to install the base system on sda6, compile a kernel with reiser4 support, and move everything back over to sda3. Obviously this can be skipped if you want to stick with ext3 or something else. The ext3 boot partition is also necessary since GRUB does not support reiser4 easily. sda6 will eventually become a FAT32 parition to share data between Windows and Linux. In the beginning you may find it useful to have an extra copy of everything on sda6 to use as a fall back in case something goes wrong. Also a swap partition can be useful if you want to be able to hibernate using swsusp or Software Suspend 2 (note the latter can also use a swap file), or if you have less than 1GB of memory. The inside of the drive (last sectors) can be ~50% slower than the outside (first sectors), so put frequently accessed portions up front.

Running the net install

As of June, 2005, the net installer still ships with a 2.6.8 kernel that will not read the SATA drive. It will be necessary to boot with kernel 2.4 to install the system (using legacy IDE drivers without DMA support - slow but manageable). To get all the latest and greatest, edit /apt/sources.list by hand and put in:

 - deb http://http.us.debian.org/debian unstable main contrib non-free
 - deb-src http://http.us.debian.org/debian unstable main contrib non-free
 - deb http://http.us.debian.org/debian experimental main contrib non-free
 - deb-src http://http.us.debian.org/debian experimental main contrib non-free

the experimental repository may be necessary since the packages in unstable don't always have their dependencies satisfied within unstable. Don't worry since experimental packages must be manually installed. There is no need to install extra stuff at this point (X, etc) as it all can be taken care of after the system is working.

Choosing a kernel

Debian strips the Broadcom Tigon3 driver out of their 2.6.11 kernels. Also the Intel Pro/Wireless 2200/2915 drivers are unavailable. You can try to go the Debian-way and download the Debian source and non-free patches while using the Debian modules tools to add support for everything. I decided to go over to www.kernel.org and get the latest mm kernel (2.6.12-mm2 at the time). Kernel building instructions are here. I started with the original Debian 2.6.11-1 configuration file (found in /boot), and made the major changes:

  • P4 optimizations
  • Preemptible Kernel
  • built-in support for ext2, ext3, reiser4 (comes with mm kernel)
  • built-in relevant SCSI and SATA support (ata_piix)
  • Broadcom tg3 and IPW2200 modules

Also a number of little things can be removed and customized (.config file). If you like to do so, go ahead and "apt-get install ccache" then change "gcc" to "ccache gcc" and "g++" to "ccache g++" in the Makefile to speed up future compilations. While gcc 4.0 comes with Debian Unstable, you probably want to use gcc 3.3 (or 2.95 as some suggest). The config file also represents bootsplash 3.1.6 and a SATA ACPI suspend fix patches to the 2.6.12-mm2 kernel (see sections below). The nice thing about built-in filesystem and SATA support is that we don't need an initrd.

Before you boot into a 2.6 kernel, go into "/etc/fstab" and change "hda" to "sda", etc since the SATA drives are handled through the SCSI drivers.

Reiser4

The mm patch will add reiser4 support to the 2.6.12-mm2 kernel. The next step is to change the root filesystem. Assuming the everything is installed in the ext3 partition on /dev/sda6, the steps are:

  1. apt-get install reiser4progs
  2. mkfs.reiser4 /dev/sda3
  3. boot into a reiser4-enabled live-CD
      1. # mkdir /mnt/sda6; mount -t ext3 /dev/sda6 /mnt/sda6
      2. # mkdir /mnt/sda3; mount -t reiser4 /dev/sda3 /mnt/sda3
      3. # cp -a /mnt/sda6/* /mnt/sda3/
  4. if you don't want to get a reiser4 live-CD, you can use a regular CD and copy all of /dev/sda6 into a subdirectory, boot back into /dev/sda6 and copy it back to /dev/sda3
  5. update the new /etc/fstab and /boot/grub/menu.lst

Wireless: Intel Pro/Wireless 2915ABG

The 2.6.12-mm2 kernel comes with the ipw2200 driver, but you'll still need to download the firmware from here and put it in /lib/firmware. Note that the driver in 2.6.12-mm2 is version 1.0.0 and does not use the latest firmware. Once the driver is set up, apt-get install wireless-tools, check "iwconfig", and if all is well set up /etc/network/interfaces accordingly.

Bootsplash

Here are some instructions. I've had no problems I could trace back to the radeon framebuffer device. vga=834 is for the 1400x1050 display. The bootsplash themes are accessible through the bootsplash.de debian archive, though I haven't yet found one for or adapted one to 1400x1050.

ACPI

CPU frequency scaling

First the relevant modules must be enabled in the kernel. Both the acpi-cpufreq and speedstep-centrino modules work to some extent, but I wasn't able to clock the CPU below 1.3 GHz with the speedstep-centrino module, while with acpi-cpufreq I had one non-reproduceable issue with the frequency being stuck at 800 MHz. You'll need to put the modules (acpi-cpufreq, cpufreq-ondemand, cpufreq-conservative, cpufreq-powersave) in /etc/modules so that they are loaded at bootup. There are many ways to automatically manage frequency scaling behavior. I chose to use "cpufreqd" with this configuration, and there is also powernowd using the cpufreq-userspace governor, or writing your own ACPI event scripts.

Suspend to RAM

The 2.6.12-mm2 kernel will crash on resume because there is no SATA support for suspend. There are patches at How to make ACPI work which need minimal changes to work with 2.6.12-mm2 (note: I have no idea what I'm doing but it seems to work). The video card does not wake up after resume, but the X.org radeon driver will reset the card properly. If you want to get the text consoles back, you'll either have to append "acpi_sleep=s3_bios" to the GRUB kernel arguments for a VGA display, or use vbetool to save/restore video bios state for a framebuffer device (not exactly stable on my machine).

Suspend to disk (hibernate)

Software suspend comes with the kernel, and Software Suspend 2 looks really nice but messy to patch into 2.6.12-mm2 (didn't really try). Without a swap drive I went for neither since suspend to RAM only takes ~.5 W of power and is much faster. It would be nice to be able to hibernate, switch to windows, and come back. Software Suspend 2 is supposed to be merged with the kernel at some point, so perhaps it's enough to wait for that.

laptop-mode

Laptop-mode is built into the kernel. To easily activate it, 'apt-get install powermgmt-base laptop-mode-tools'. It should help preserve battery life by minimizing hard-drive spin-up, though this depends on the SATA ACPI support.

X

XFree86

The radeon driver in the 4.3.0 XFree86 from Debian unstable is not new enough to support the Mobility X300. I tried the unofficial Debian fglrx drivers, and with some suggestions from this thread was able to compile against 2.6.12-mm2, but ended up with a radeon driver which crashed my computer (maybe because I had DRI enabled in the kernel).

X.org

There are experimental X.org packages available here which I am currently running with X300 support with the opensource drivers. I'm not really sure what I miss out on besides 3D acceleration by doing so.

Try setting in /etc/X11/xorg.conf:

Option "DynamicPM" "True"

which improves battery life considerably (see this page for details).

Later versions of X.org have renamed the flag to:

Option "DynamicClocks" "True"

External Sources