Difference between revisions of "IBM ThinkPad X41"

From ArchWiki
Jump to: navigation, search
(use https for links to archlinux.org)
(Other information: update package name.)
Line 89: Line 89:

Revision as of 06:21, 6 March 2013

Installing Arch Linux isn't exactly trivial if you happen to be a lucky owner of an ThinkPad X41 laptop. As a rather new machine with a Serial-ATA (SATA) harddrive, no internal CD or DVD drive, and a slightly unusual networking chipset, you'll have to have some patience and time in order to get it “Arched”.

With this guide, we hope to make it easier for you to run your new favorite Linux distribution on your laptop. Please help us improve and keep it updated.

Update: As of June 17th, 2008 remastering the installation CD is no longer needed. The same IBM Thinkpad X41 boots and installs without a hitch with the official, standard ISO discs.

The problem

So what's the big deal here? You've installed a bunch of different distributions already, and never had any problems. So why should an Arch Linux install be any different? Well, for some reason the Arch Linux bootable ISO image doesn't contain the drivers necessary to boot from an USB-connected CDROM.

Since the X-series laptops from IBM/Lenovo doesn't have any internal optical drives, you won't be able to access the stuff on the CD after a boot. Part of this “stuff” is the tg3 kernel module, used by your primary NIC which is of Broadcom make. Hence, you can only boot from the CD, but not load modules, keymaps or get your network connection up and running.


The solution

Luckily, we are seemingly not alone with this problem, since there is an excellent guide on remastering the install ISO for Arch Linux. This is exactly what we'll try to do. We will build a custom kernel witch includes support for the X41's hardware, and replace or add it to the ISO. You'll need a working Unix system in order to build the kernel and remaster the ISO.

As described in the aforementioned guide, you'll need an up-to-date Arch Linux install ISO to base your work on. I simply downloaded “arch-0.7.2-base.iso” from https://www.archlinux.org/download.

Next we'll need a kernel. I simply downloaded the latest stable release from http://www.kernel.org, which was at the time of this writing.

Configuring the kernel comes next. I chose to compile all the drivers required by the X41 straight into the kernel, so I wouldn't need to mess with any modules at all. That's how I did it in my old Slackware days, you see. ;-)

Here is a kernel configuration file describing the kernel I built. You should be able to use it with newer kernels by dropping the file into the unpacked kernel source tree and issuing the `make oldconfig' command. Rename it from 'config' to '.config'.

Here is a short summary of some of the options (to the best of my knowledge).

  • BLK_DEV_SD - SCSI disk support, needed for harddrive access.
  • BLK_DEV_SR - SCSI cdrom support, needed for USB CDROM access.
  • SCSI_SATA - Generic SATA support.
  • SCSI_ATA_PIIX - Chipset support for Intel ICH5/6 SATA chipset.
  • BLK_DEV_RAM - Ramdisk support, needed during startup.
  • BLK_DEV_INITRD - Initrd support, needed for boot process.
  • TIGON3 - The wired gigabit ethernet card driver, tg3 for the Broadcom chipset.
  • MPENTIUMM - Select Pentium M processor type.

When happy with your configuration, build your kernel. Set the root device for the kernel using the rdev command:

rdev <kernel-directory>/arch/i386/boot/bzImage /dev/ram0

Follow the instructions for remastering the install ISO. Basically, you only need to copy the ISO contents to another directory, replace the 'isolinux/vmlinuz' kernel image with your own, and then make a new iso file from the modified directory tree. Burn the resulting ISO image to a CD.

Now you are ready to begin the installation! Hooray!

Performing the installation

So you've got your very own, customized Arch Linux bootable CD, and now you want to get it installed. Well, be warned. Since we kind of hacked that CD together, we'll need some magic fingers to get it to install properly.

First off, plug in your USB-based CD-drive into your laptop and put the CD in. Power up the laptop, and make sure you have your BIOS set to attempt to boot from the CD-drive. You'll be greeted with the standard Arch Linux boot prompt if you succeed.

Just press enter and your homemade kernel will begin booting shortly. If you get an error message about '/dev/ram0' not existing, you probably forgot to compile initrd support into your kernel (the ramdisc will hence not be created). If so, rebuild with support enabled and make a new CD (bummer, eh?).

After the boot messages have washed by, you will be left in the initial environment, from where you can load modules, change keymaps etc. Since I have a Swedish keyboard layout, I first wanted to change that. You will need to load the keyboard mapping files from the CD.

Examining the 'dmesg' output, you'll probably notice that no USB CD-drive is mentioned. You can either unplug the CD-drive and plug it back in, at which time it will be identified and assigned to '/dev/scd0', or simply “know” that the CD is actually already identified and assigned to '/dev/sr0'. Either way, you'll load the CD data by issuing the 'loaddisk <device>' command, where '<device>' is either '/dev/scd0' or '/dev/sr0', depending on your preference.

Then type 'km' and choose keyboard mapping in the list. Us swedes use 'i386/qwerty/sv-latin1.map.gz', choose whatever is appropriate for you.

Now you are ready to launch the Arch Linux setup program, located in the 'arch' directory. Type '/arch/setup' at the prompt.

From here on, the installation is pretty much smooth sailing. Just follow the on-screen instructions, and you should be home free.


Myself I chose not to install a kernel at this point (since I wasn't sure it wouldn't install the shoddy, home-made one used for booting the system), and instead booted up the system from the CD-drive once again, but using the freshly installed root filesystem on the harddrive. Then I used pacman to install a kernel directly from the Arch Linux repositories.

If you want to do the same, just reboot with the CD-drive plugged in, and when the boot prompt shows up, issue 'arch root=/dev/sda2 noinitrd ro' (if you root Linux partition happens to be '/dev/sda2', as in my case).

Login as root, make sure your network interface is running properly (I use DHCP), and then issue the following pacman commands:

pacman –sync –refresh
pacman -S linux

Then add your new kernel to '/boot/grub/menu.lst', or to whatever file your bootloader uses.

Other information

Some interesting packages for your IBM/Lenovo ThinkPad X41:

  • acpi
  • acpid
  • laptop-mode-tools
  • xf86-video-intel
  • thinkpad
  • tpb
  • tbctl

The IBM X41 comes with ipw2915 wireless Centrino (A, B and G) module. You use the ipw2200 modules (installable via pacman, several versions available depending on your kernel version). There seems to be some problem with the drivers for both wireless and cabled ethernet, since I've experienced weird behavior from those devices a number of times, both under Debian, Ubuntu and now also Arch Linux. The devices just doesn't respond to certain commands, or simply doesn't work. For example, the wireless device can sometimes not switch mode via the iwconfig command, "operation not supported". A reboot usually fixes these issues. They can be related to having performed a sleep earlier.

External Links