(Note: I have upgraded my system to Fedora Core 3, so I will no longer update FC2 specific information. See here for upgrading from FC2 to FC3, and the system setting of FC3.)
I happen to have an IBM ThinkPad T40 (2373-75J). Recently I decided to start using Fedora Core 2 as my primary desktop environment. (I had my reasons for this choice. I'm not to explain why Linux, why Fedora, etc. here.)
I chose not to use dual-boot, because in my experience rebooting in the middle of work was too annoying. I just bought a new hard disk and replaced it with the original one, so I didn't have to care much about how to preserve the hidden disk-to-disk partition in the original disk. In the case I really need to run applications on MS Windows, I would use VMware Workstation. The current latest version of VMware doesn't officially support FC2, but Workstation v4.5.2 seems to work without a problem with the latest FC2 kernel. It costs $189.00 if you buy it at the VMWare site, $110-$120 if you buy an academic version, or there is a 30-day free trial. (Well, this is not a page about VMWare:)
Below is my memo of setting up various stuffs. I hope some of the information is useful to those who visited this page, but please do everything at your own risk.
Useful links
First of all, there are a lot of people who have already put great efforts in using Linux on T40 or other ThinkPad series.- Fabrice Bellet's page is extremely useful, especially for setting up a Wireless LAN.
- Klaus Weidner's page also has wonderful content. He is using Debian Linux. I have followed his BIOS settings. He maintains links to a lot of other useful pages.
- The page of Theodore Ts'o is about Debian on T40p.
- Jason Merrill's page on Fedora Core 1 on T30. I got information on how to downgrade the wireless card firmware here.
- The Linux-Thinkpad mailing list
TODO list
- Modem
Work done
- BIOS
- Installation
- KDE
- Firefox
- Trackpoint scroll
- Emacs
- Wireless LAN
- On-screen display
- MPlayer
- Suspend/hibernation
- Random freezing issue
BIOS
I'm using the latest version of BIOS and the embedded controller. According to people's recommendation found here and here, I changed several BIOS settings from defaults: disabling the touch pad and legacy floppy, changing IRQ allocation, disabling BIOS power management, etc. The reason I needed those changes - it was all about stability. At the time I installed FC2 first, I suffered from consistent system freeze. Changing BIOS setting helped increasing stability. (See here for the freezing problem.)Installation
Installation was pretty easy. I burned four CDs, booted from the first one, selected the custom install, and just chose "everything." I didn't create a partition for /boot. I didn't have to do anything to get Ethernet adapter, sound, X, and TouchPad work. They just worked out of box.KDE
The default desktop environment of FC2 is GNOME. I decided to change it to KDE, by rewriting /etc/sysconfig/desktop to DESKTOP="KDE". This is just a matter of preference. One note about GNOME: for some options of X, GNOME has a separate configuration. For example, I prefer swapping the position of the left control key and the caps lock key on X. Usually this can be done by adding the following to etc/X11/xorg.conf.
Option "XkbOptions" "ctrl:swapcaps"
However, in GNOME this doesn't work. Writing per-user key mapping in ~/.Xmodmap is another standard way to do this, but it is ignored too, unless you explicitly run "xmodmap ~/.Xmodmap" after GNOME is up. In GNOME, you need to launch the "keyboard switcher" applet and define the key mapping. (I don't know well what's happening inside.)
KDE KLaptop (battery monitor) recognized the battery status without any configuration (either with ACPI and APM.)
I disabled klipper (KDE clipboard tool), after it died several times with no reason.
Firefox
The default FC2 desktop (either GNOME or KDE) shows an Mozilla icon as a default browser. I prefer Firefox for daily use, so I just installed it. There isn't much to say about installation - get the binary package from mozilla.org and install it somewhere. You can get an RPM package somewhere, or you can even create one using the stuff here.After a while, I noticed that the browser often gets stuck during the DNS lookup, even if there is no problem in the network. It turned out that this is a known problem in Mozilla and Firefox. (You may want to read this or this.) In short, the cause of the problem is in the way they handle dns lookup when ipv6 is enabled. This problem will be solved in the future version, but if you are using Mozilla or Firefox and don't need IPv6, you may want to solve the problem by disabling ipv6. One easy way to do this without recompiling the kernel is to add the following line to the /etc/modprobe.conf.
alias net-pf-10 off
alias ipv6 off
Some people say the only first line is needed. In my case I had the second line to eliminate the problem.
Trackpoint scroll
Both the trackpoint and the touchpad worked without configuration, except the scrolling using the center button. I definitely need this for web browsing.An IBM page mentions tp-scroll, a small program that solves this problem. I got the source tar.gz file and compiled it. It seems to work pretty well. Here are some notes, though.
- As FC2 uses X.org instead of XFree86, /etc/X11/xorg.conf should be modified instead of XF86Config.
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/imouse"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "off"
EndSection
/usr/local/bin/tp-scroll /dev/input/mice /dev/imouse &
that is, (1) the device file should be /dev/input/mice, and (2) you need "&" at the end of the line. (/etc/rc.d/rc.local and /etc/rc.local seem to be two separate files in FC2. I'm not sure how these two are used, but I would recommend to use /etc/rc.d/rc.local.)
Jason Merrill's page provides some other software for UltraNav touchpad/trackpoint, although I haven't had a chance to try them.
Emacs
For some reasons, I wanted to compile emacs myself. Both CVS head (21.3.50) and the latest release (21.3) crashed during 'make', I searched for a reason and found that this is a known issue with recent Linux kernels. You may want to read this. In short, the following commands solve this.$ setarch i386 ./configure $ setarch i386 make bootstrap
Wireless LAN
My T40 model comes with Cisco Aironet 350. There are several options for using this hardware on Linux.- The FC2 kernel comes with a working driver, airo.c, out of box, which I ended up using. (The driver used to have a problem when FC2 first came out, and that's why I surveyed other options. The latest kernel should work great.) More information on this driver is available at Fabrice Bellet's page.
- There is another driver airo-linux, which was originally developed to support several several Cisco cards on Linux 2.4.
- Fabrice Bellet made his version of airo-linux, airo_mpi, which fix bugs and add missing functionalities in the original. You can get it at his page. I didn't tried it myself, but I believe at least some part of his work has been merged to both airo-linux and the latest airo.c.
- Cisco has recently released a new Linux driver here.
- LinuxAnt DriverLoader is an attractive option when your wireless card has poor Linux support. It works as a wrapper for Windows NDIS drivers, so with an Windows device driver and DriverLoader, you can use may unsupported wireless hardware. I have once tried it with another wireless card (Netgear MA521), which worked pretty well. It is $19.95, or there is a free trial version.
- NdisWrapper is very similar to LinuxAnt DriverLoader, except this is a GPL-licensed software. I haven't tried it.
Old information from several sites recommended to downgrade the wireless card firmware to 5.00.03, because the Linux drivers used to support only the old firmware. The latest drivers supports the newer firmware version 5.30.17, so there's no need of downgrading if you are using this version. If you need to install this version of firmware (because your Windows driver has silently upgraded the firmware, for example), you can download the necessary package here. Caution: A safe way to upgrade/downgrade the firmware is to go back to Windows for a moment, install ACU, and then load the firmware image using it. There is an ACU utility for Linux available, but many people say you shouldn't use it.
"/sbin/iwconfig" should display eth1 and wifi0 ("the airo driver creates a new network interface wifi0 to deal with raw 802.11 frames" according to Fabrice Bellet's page). I usually use ESSID with WEP 128-bit key. "/sbin/iwconfig eth1 essid 'your_essid' key 'your_hex_key'" should work. (your_essid and your_hex_key should be written to the values you're using, of course.) Then "/sbin/ip link set dev eth1 up" will start the device, and "/sbin/ifconfig eth1 ..." will set an IP address and other settings.
For DHCP, you can add the following to /etc/sysconfig/network-scripts/ifcfg-eth1.
BOOTPROTO=dhcp
ONBOOT=yes
MODE=managed
ESSID=your_essid
KEY="restricted your_hex_key"
Then '/sbin/ifup eth1' will do everything.
If you need to dynamically configure these values depending on the network you're connecting, '/sbin/iwlist eth1 scanning' command may be useful to obtain the current network status. You can write your own small script and make it called from ifcfg-eth1 to determine an appropriate settings. (I read documents which recommend to modify /etc/pcmcia/wireless.opts for this purpose, but that doesn't work in this case, because /etc/pcmcia/wireless is never called. /sbin/ifup just calls /etc/sysconfig/network-scripts/ifup-wireless, which in turn calls iwconfig using the values defined in ifcfg-eth1.)
The Cisco driver package include a couple of tools which is installed at /opt/cisco. Although I'm not using this driver, I could use these tools once the connection is established. For example, /opt/cisco/bin/acu displays a connection status somewhat graphically. This tool even has a firmware update functionality, although many people warn it's extremely dangerous to use due to its fundamental flaw.
On-screen display
I want to have an on-screen display feature when I pressed volume control buttons, or when I switch to the external display mode to do presentation. tpb is a program which enables ThinkPad special keys. xosd is required to use tpb. (You can get the source code from these websites and install them, or there are RPMs compiled for FC2 available too.) You may want to edit /usr/local/etc/tpbrc (or relevant configuration file) to change fonts, color, etc. (The default font used seems a little too small, so I recommend you set the OSDFONT value.) Once it is done, you can run it by just "/usr/local/bin/tpb &". (There are a number of command-line options too.)MPlayer
If you want to use mplayer on Fedora, you might want to know a known problem of MPlayer on Fedora described here.Suspend/hibernation
Suspend and hibernation are very important functions for a laptop PC. Although I could get them work, the approach I took was rather an old-fashioned one: using APM and BIOS. As a FC2 user, I hope to use modern power management features of kernel 2.6, but I haven't had luck so far. Anyway, my T40 successfully enter suspend mode on Fn+F4, and enter hibernation on Fn+F12 from KDE desktop environment. Devices such as wireless LAN and sound seem to recover correctly without special settings.Suspend
Suspend/resume works out of box with the APM-enabled kernel. The default FC2 kernel seems to be compiled with an APM support, but ACPI overtakes it during the boot process. Therefore, you can re-enable APM by just disabling ACPI. The simplest way to do this is to add the "acpi=off" option to the end of the "kernel" line in /boot/grub/grub.conf.kernel /boot/vmlinuz-2.6.xxx ro root=LABEL=/ rhgb quiet acpi=offThen reboot the system. You can check if APM is working by checking dmesg output.
Now the system should enter the suspend mode when you press Fn+F4. If you don't want the system to suspend when you closed the LCD, you need to change the option in the BIOS.
Hibernation
Hibernation was more difficult. Note that the method I used may be too risky to recommend to others.- Hibernation support by ThinkPad BIOS needs either a hibernation file on a (hidden) FAT partition, or a special hibernation partition. I ended up using the hibernation partition, because although I tried the hibernation file first, based on the information in Jason Merrill's page, the BIOS didn't seem to recognize my hibernation file. His page has links to the hibernation file tool as (1) utility diskette, (2) Windows program, and (3) Linux program. For a non-dualboot system without a floppy drive, (3) was my only choice. If your environment can use (1) or (2), it might work. Then you don't have to try the method I used.
- Since I didn't have a floppy drive, I got a ISO image for creating a hibernation partition here. (Note: this image was created by someone outside of IBM. I just decided to trust the kind person who made this image available:) Burning this image to a blank CD-R makes a bootable hibernation utility.
- There are several very important things you may want to know. (1) This tool seems to blow away MBR information very often, which is why I think this is risky. I didn't lose any data on existing partitions, but you should backup important data, and at least prepare to reinstall GRUB right after you created a hibernation partition as explained later. (2) The tool tries to create a hibernation partition as /dev/hda4, allocating the earliest available spaces in /dev/hda. Therefore, for preserving consistent partition table, you may want to create three partitions (1 - 3), leaving a disk space at the end of the disk before running this tool. This means that you can't use extended partitions. (3) The hibernation partition created by the tool has an ID 'a0'. The tool seems to have a function to detect an existing hibernation partition and reformat it. If this function works, the limitation of (2) should be eliminated by manually creating a hibernation partition with an appropriate size and ID (using fdisk etc.), then just reformatting it with the tool. Unfortunately, as far as I tried, the partition created with this approach was not recognized as a valid hibernation partition.
- Below is the actual steps I took to make a successful hibernation partition.
- Boot from the partition utility CD. If should say that no existing hibernation partition is found.
- Choose "create a partition" from the menu. The tool displays the minimum size needed for the partition (which should be approximately the main memory size+ video memory size + alpha.) You must have enough free disk space.
- The tool creates the partition, format it, and write the necessary information. When it's done, you can remove the utility CD and reboot.
- In my experience, the MBR is likely to be broken, and the "missing operating system" message will appear! You need to recover MBR.
- Boot from the first Fedora Core 2 install CD. (You can burn it from the FC2 ISO image. Only the first CD is necessary. Or you can use other CD-bootable Linux such as Knoppix instead.) When you saw the prompt, enter "linux rescue" to enter the rescue mode. You should be able to see the root partition of your system mounted at /mnt/sysimage.
- The following commands should reinstall GRUB in MBR and reboot. (You can eject the FC2 install CD.)
# chroot /mnt/sysimage # /sbin/grub-install /dev/hda # exit # exit
- Now the system should boot normally as it did before. You can enter the hibernation mode by pressing Fn+F12. It works great, except it's extremely slow.
Random freezing issue
After the initial installation, I suffered from an annoying freezing problem. It seemed to occurs just randomly - mostly once or twice per day. When it occurs, the system really freezes: the keyboard stops responding (except the power button for forced shutdown), mouse also freezes, and network was down (It didn't respond to ping or remote connection anymore.) It seems to occur more frequently when the pc is in idle, but it also seems to occur when using a browser (Firefox or Konquor).Having system freeze so often is too painful - I was rather surprised this was happening on Linux. I really wanted to stop it before I ruin the harddisk after too many sudden system crashes.
After a few months, I seem to have conquered this problem. (I haven't experienced the freezing problem for a long time.) However, I don't know what exactly was causing the freeze. I suspect that multiple factors were involved: relative instability of 2.6 kernel, possible bugs in BIOS, X, device drivers, or even a hardware problem. After all, maybe the biggest factor is a lot of updates - including the kernel and X - contributed enhancing the stability most. Below is the summary of what I did other than upgrading packages. I leave this information here, but it is likely that some of them are no longer necessary. I haven't had a chance to revisit them and see if the system start freezing again.
Disabling power management
Several people seem to have similar freezing problems too. Their suggestion was to turn off power management functionalities.I began this by disabling screen blank. The current Fedora desktop is very complex, and there are several separate mechanisms related. I just disabled everything I found related.
- ThinkPad BIOS has power management settings. I turned off all functionalities following Fabrice Bellet's instructions.
- Virtual console have screen blank timer enabled on by default. To disable this, I added the following to /etc/rc.d/rc.local.
setterm -blank 0 -powersave off
I also added 'setterm -blank 0' to ~/.bashrc just for safety. - X supports a DPMS power-saving functions.
$ xset -dpms'
disables this. Adding this line to ~/.xsession would work. Instead, I disabled dpms by editing /etc/X11/xorg.conf. Also in the "Monitor" section, I comment out the line Option "dpms". - If you are using KDE, display power control can be turned off from the "Control Center" utility. This may be the same as the dpms setting above, but I'm not sure yet.
- Also in the KDE Control Center, "laptop battery" section has a power control tab. ACPI is not recognized active here, so I could set anything here.
- An X built-in screensaver can be turned off by 'xset s off'.
- A screensaver application such as xscreensaver should not be running. You can look at the process list by 'ps auxww' and kill it if necessary.
- KDE screensaver can be turned off at the Control Center. I'm not sure how this is related to the two above.
I further changed the following settings related to power management.
- I turned off ACPI, by adding "acpi=off" to the kernel line in /boot/grub/grub.conf. With the default FC2 kernel, APM is enabled instead. (As a side effect, suspend seems to work well with APM.) I stopped both acpid and apmd using chkconfig.
- I disabled the cpuspeed daemon. As a result, CPU frequency is not controlled automatically anymore. (You can see this by 'cat /proc/cpuinfo'.) I'll come back to this issue once I get a system stable enough.
- I disabled gpm. I heard vmware may act strangely without gpm, but I haven't experienced such problem so far.