After everything I've gone through with the "breeding-edge" Fedora on my old ThinkPad T40 (read here and here), I decided to go with something a little more "stable" for a new laptp, ThinkPad T43. (No offense to Fedora - I still love it in many ways.)
What I chose was CentOS. CentOS 4, one of the popular "Red Hat clone" distributions, is basically a free recompilation of Red Hat Enterprise Linux (RHEL) 4. The structure of the distribution is more or less similar to Fedora Core 3, as RHEL 4 was being developed in parallel with FC3. (Therefore, there is a good chance that an RPM package for FC3 is compatible with CentOS, which comes handy.)
Below is my setup memo. I hope this to be useful for others, but I make no guarantee of any kind whatsoever. Please do everything at your own risk.
Unlike the previous models of ThinkPad in the past few years, T43's partition for the system recovery doesn't seem to be "hidden". I have no idea what happened, but apparently they (I mean, IBM or Levono) went back to the method they were originally using in older machines; the system recovery partition appears to be a FAT partition at the end of the disk. If you want to do dual-boot, I recommend to be careful not to delete it until you first make a backup to DVD or CD media.
TODO list
- Suspend/Hibernation
- On-screen display
- Modem
- Bluetooth
- Fingerprint detection
Work done
- BIOS
- Installation
- KDE
- Wireless LAN
- Trackpoint scroll
- Emacs
- OpenOffice.org 2
- IBM ThinkPad ACPI Extras Driver
- Doing a presentation
- Software Mixing
- Other minor issues
- Upgrading from 4.3 to 4.4
- Upgrading from 4.2 to 4.3
BIOS
I did nothing special in the BIOS setting specifically for Linux, except I disabled screen expansion in an attempt to use an external display for doing a presentation, but it didn't seem to mean much anyway (see here.)Installation
Instal disk image for CentOS 4.2 consists of four CDs or one DVD. I ended up burning three CDs, as I didn't need to install anything in the fourth CD initially. You need a BitTorrent client to download a DVD image.Installation was very easy. I did custom installation with graphical mode, manually created partitions, and selected packages to install. I chose to disable SELinux. I chose "general LCD 1400x1050." After reboot, I successfully got a graphical login screen. Most devices (including trackpoint/UltraNav, USB, ethernet, audio, and volume buttons) worked out of the box. The only mystery was that my IDE disk (Toshiba MK1032GA) was recognized as a scsi drive (/dev/sda).
The first thing I did after installation was to run "yum update" as root to install the update modules. You could also use 'up2date' or 'apt-get' for this purpose. It is also easy to add third-party repositories so that you can install the packages not included in the official CentOS repository through these tools. For example, you can add a file named /etc/yum.repos.d/*.repo to make yum access a third-party repository. (You may also have to do 'rpm --import' to import a GPG key.)
KDE
The default desktop environment of CentOS 4.2 is GNOME. I changed it to KDE by rewriting /etc/sysconfig/desktop to DESKTOP="KDE". This is just a matter of preference.Wireless LAN
My T43 comes with the Intel PRO/Wireless 2200BG adapter. Although the CentOS kernel is built with ipw2200 and ieee80211 driver modules, wireless doesn't work after initial installation. You need to install the "firmware" provided by Intel. The easiest way is to download and install the firmware RPM available here (choose the latest package for Red Hat Enterprise Linux 4 i386). Alternatively, you can download the files from the SourceForge site and put them in /lib/firmware (The syslog in /var/log/messages indicates that CentOS 4 kernel needs# /sbin/rmmod ipw2200 # /sbin/modprobe ipw2200
Note: kernel-2.6.9-42.0.2.EL had a problem with ipw2200 driver. I'm forced to stay with kernel-2.6.9-34.0.2.EL until this is resolved. It also prevents me from upgrading to CentOS 4.4:( If you're interested in this problem, you might want to watch this bug in the Red Hat Bugzilla.) 10/08/06: The issue has been fixed in kernel-2.6.9-42.0.3.EL.
You can check syslog to see if the driver is loaded correctly. Once this is done, you should be able to setup the wireless connection manually, with standard tools like /sbin/iwconfig etc., or a graphical configuration tool (/usr/sbin/system-config-network).
More detailed and useful setup information can be found the project page. For example, the document says you may need to do:
# echo 100 > /sys/class/firmware/timeout
to load the firmware correctly (In my case, I didn't have to do this). It also provides newer versions of driver/firmware than what CentOS 4.2 kernel contains. If you have some problem, you may want to delete existing modules and install newer ones. As far as I believe, the "firmware" has nothing to do with what's written into the hardware EPROM, so testing a newer firmware doesn't affect anything when you are running a different kernel or a different OS.
Trackpoint scroll
While the trackpoint/touchpad works right after installation, there are several features missing. One of them is the "scrolling using the trackpoint", which allows the trackpoint to be used like a scroll wheel when the center button pressed. Since I heavily depend on this functionality, it was important to make it work.As far as I know, there are three possible approaches. The first one, which is simplest, is just changing the "InputDevice" section in /etc/X11/xorg.conf as follows.
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "yes"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "EmulateWheelInertia" "50"
EndSection
After restarting X (logout and login again, or just reboot), the trackpoint scroll should work. Unfortunately, this isn't the perfect solution. It does make the scrolling using the center button work, but the center button no longer works for clicking. (That's why "Emulate3Buttons" is necessary - you need to press left and right buttons simultaneously to paste on X.)
The second approach is to use tp-scroll (see here for the detail of how to set it up.). I have used it for Fedora for a while, but I haven't tried it on CentOS either. Basically it uses a FIFO created as a dummy mouse device, and the tp-scroll program, which works as a proxy to the real mouse device, tranforms mouse "signals" to realize trackpoint scrolling. It's a great program.
The third approach, which I chose to take, is to use this patch, and recompile X.org from the source code. Then the following setting in /etc/X11/xorg.conf works (notice the new option "EmulateWheelClickToo").
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "IMPS/2"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "no"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "EmulateWheelInertia" "50"
Option "EmulateWheelClickToo" "true"
EndSection
Here's how to recompile the X.org RPMs from the SRPM package and the patch. Since I didn't want to "contaminate" the system directories for this task, I did it as a non-root user.
- Download the following files: xorg-x11 SRPM, patch for trackpoint scrolling, and patch to the spec file. (I have adjusted the original patch so that it fits the source code of the CentOS.)
- Set up the RPM build environment. I assume you build everything in the ~/rpmbuild directory as a non-root user. (The technique to use rpmbuild as a non-root user was borrowed from here.)
$ cd ~
$ cp -a /usr/src/redhat/ rpmbuild
$ echo '%_topdir %(echo $HOME)/rpmbuild' >> .rpmmacros
$ echo '%debug_package %{nil}' >> .rpmmacros
- Install the SRPM file into ~/rpmbuild, and copy the patch file to the source/spec directory
- Patch the spec file and build the RPM
$ cd ~/rpmbuild/SPECS/
$ patch < xorg-x11*.spec.patch
$ rpmbuild -bb xorg-x11.spec
- If everything goes well, the RPM files are created in the ~/rpmbuild/RPMS/i386 directory. Install them as root.
$ su
# rpm -Uvh --force *.rpm
- After restarting X, you should be able to use both clicking and trackpoint scrolling with the "EmulateWheelClickToo" option. Delete the build file and directory (you could save the RPM files for later if you want, but you can always rebuild them.)
$ cd ~/
$ rm -R rpmbuild
$ rm .rpmmacros
$ rpm -ivh xorg-x11-6.8.2-1.EL.13.20.src.rpm
$ cp xorg-x11-6.8.2-emulate-wheel-click-too.patch ~/rpmbuild/SOURCES/
$ cp xorg-x11.spec.patch ~/rpmbuild/SPECS/
Emacs
For certain reasons, I'm using the latest version of emacs on the CVS. Due to the exec-shield of recent Linux kernels, you need to use 'setarch' to avoid crashing during make.$ export CVS_RSH="ssh" $ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co emacs $ cd emacs $ setarch i386 ./configure $ setarch i386 make bootstrap $ su # setarch i386 make install
OpenOffice.org 2
CentOS 4.2 comes with OpenOffice.org 1.1.2. Unfortunately, OpenOffice.org 1.1.x has many limitations, and it's almost unusable for me. (The biggest problem is its inability to open a large spreadsheet.) I have used OpenOffice.org 2 and knew it's much better, but with the nature of CentOS (i.e., that of RHEL), it is unlikely that major update release is provided. Therefore, I obtained the RPM package from the OpenOffice.org project page and installed it. Since their package is for general linux environment, I had to take the following steps to fit it to CentOS. The version I installed is 2.0.1.- Uninstall OpenOffice.org 1.1.x. (It turns out that version 1.1.x and 2.0.1 can co-exist, as they are installed in completely different places. However, you may have to configure which application is invoked in the desktop setting. I just decided to uninstalled the old version completely, as I knew I never use it.) The following command:
$ rpm -qa | grep openoffice
will display the currently installed rpm packages for OpenOffice. You may want to take a memo so that you can remember which packages were installed in case you really need to reinstall them. As a root, run:# rpm -ev openoffice.org openoffice.org-i18n ...
where "..." are the all relevant packages names. (The list depends on your environment.) In my case, it was# rpm -ev openoffice.org openoffice.org-i18n openoffice.org-kde openoffice.org-libs openoffice.org-pyuno
If you have used OpenOffice.org 1.1.x, you may also want to delete the files in your home directory, such as ~/.openoffice-install-log, ~/.openoffice-lock, etc. manually. If you don't have to keep the setting of the old version, you can also delete the ~/.rhopenoffice1.1 directory. Otherwise, you may wait to delete this directory until you transfer the setting (see below). Logout and re-login so that the desktop icones for the old version disappears. - Go to http://www.openoffice.org/ and download the latest version of the package file (in my case, OOo_2.0.1_LinuxIntel_install.tar.gz). Extract the files, and install the RPM files as follows.
$ tar zxvf /opt/build/openoffice/OOo_2.0.1_LinuxIntel_install.tar.gz $ cd OOA680_m1_native_packed-1_en-US.8990/RPMS/ $ su # rpm -ivh *.rpm desktop-integration/openoffice.org-redhat-menus-2.0.1-1.noarch.rpm
You may want to select the RPM files to install if you don't need all functions. (I don't know enough about the dependency among those RPM files.) - Logout and login again to enable the updated desktop application information. (The 'kde-config' command may be useful if you have a problem with it.) In my case, I further had to manually change the KDE desktop settings: (1) Set the icon shown in Konqueror. Open the Control Center and go to "KDE Components" -> "File Associations". From the list, choose "application" and click "msword", "msexcel", and "mspowerpoint". Click the icon button and choose something like "openofficeorg-20-*". (2) Add the application launch buttons by right-clicking on the task Panel. (I'm not sure if you need similar settings in Gnome too).
- Start the application from the menu. Alternatively, if you haven't configured the desktop, the OpenOffice.org 2.0.1 is installed under the /opt/openoffice.org2.0 directory, so run:
$ /opt/openoffice.org2.0/program/soffice
If the installations is successful, the setup window is displayed. If you accept the license agreement, you'll be asked whether you want to import the settings from the old version, and whether you want to register. Now you should be able to use OpenOffice. - If some Microsoft Office documents are displayed uglily, the cause is most likely a font problem. Since TrueType fonts such as Arial, Times New Roman, etc. do not exist in CentOS, the documents using these fonts can be shown with incompatible fonts. You can go to "Tool" -> "Options" -> "OpenOffice.org" -> "Fonts" to manually define font replacement table, but unless you have appropriate fonts it's not very helpful. (I remember the CentOS version of OpenOffice.org 1.1.x was showing these fonts with better look, but I wasn't able to look into why anymore as I had uninstalled it already.) A solution is to install "alternative fonts". There are many freely available fonts you can find on the internet (see here for example). Put the extracted font files in /usr/share/fonts (you can create any sub-directories), restart the font server and re-login (or just reboot the system).
IBM ThinkPad ACPI Extras Driver
I have installed the ibm-acpi driver for ThinkPad ACPI. The ibm-acpi driver is now part of kernel 2.6.10 and later, but as of today, the version of CentOS kernel (i.e., RHEL 4 kernel) is still 2.6.9-x. Among other things, I needed to install this driver to be able to disable screen expansion when doing a presentation (see here). I expect It will be useful to setup suspend/hibernation, although I haven't tried it yet.Since the RPMs found in several sites were either too old or seemed incompatible with Red Hat-based distributions, I just downloaded the source code from the project page and compiled it according to the README document. (This must be repeated when you update the kernel.)
$ tar xzvf ibm-acpi-x.y.tar.gz; cd ibm-acpi-x.y $ make $ su # export PATH=$PATH:/sbin # make install
Then run '/sbin/modprobe ibm-acpi' and you will be able to access the driver via /proc/acpi/ibm. The final step is to load the driver module automatically. I added the following line at the end of /etc/rc.d/rc.local.
/sbin/modprobe ibm-acpi
Of course you could run modprobe by hand every time you boot the OS, or if you want to do something more sophisticated, it would be easy to write an init.d script to make modprobe/rmmod easier.
The version of KDE (3.3.x) included in CentOS has the "IBM Thinkpad Laptop" menu in the Control Center, but unfortunately it doesn't seem to work with this ibm-acpi driver.
Doing a presentation
Sometimes I do a presentation with an external projector. The LCD of my T43 is SXGA+ (1400x1050 pixels), but no projector that I can use supports such a high resolution. An ideal situation would be to show low-resolution image (like XGA, 1024x768) while keeping SXGA+ display on the LCD, but I have had no clue how to do it. The more practical way is to switch to a low LCD resolution when doing a presentation. KDE can change the display resolution in a "Window-ish" way (right-clicking on the desktop and choosing the "Configure desktop" menu), and this is acceptable for me.However, there's still a problem. Even if I reduce the LCD resolution to XGA, the external RGB output is still corrupted if the LCD screen expansion is enabled. Worse yet, even if I disabled the screen expansion on BIOS (and the config tool on Windows XP), the screen expansion is still enabled on CentOS. I haven't figured out how to turn of on X (or KDE, I don't know). The only solution I've had so far is to rely on the ibm-acpi interface, and manually disable the screen expansion when necessary. (I don't know how to obtain the current screen expansion mode.)
$ echo expand_toggle > /proc/acpi/ibm/video
I hope to automate this (or a cleaner solution) and make it work through the Fn+F7 key in the future.
Software Mixing
Traditionally, Linux applications directly access the sound device (/dev/dsp), which means only one application can play the sound at one time. While this may be good for high-fidelity playbacks, I really wanted to play some music, listen to the sounds from Flash on Firefox, and hear the notification from KDE all at the same time. To do this, we have to use a mechanism for software mixing, and make applications go through a "sound server" instead of accessing the bare sound device. There are several ways to achieve this. Some sound servers are closely coupled with desktop environments like KDE or GNOME, while others are independent of them. If you are interested, try googling arts, esd, jack, sdl, etc.The approach I chose to take was dmix, which is a native plugin for ALSA (Advanced Linux Sound Architecture), because it was easy to use, and it seemed to cause fewest side effects. This page contains the overview of the necessary settings, and here's what I have actually done. It's mostly based on this page (written in japanese).
- Save this file as /etc/asound.conf. This file is read by /etc/alsa/alsa.conf. If you want to limit the configuration to one user, it is possible to put this file as ~/.asoundrc instead of /etc/asound.conf.
- Install alsa-oss to use the aoss command. Aoss is a wrapper script to allow non-supported applications to force using ALSA. You can go to here, download the latest release and install it. Instead, I downloaded the SRPM package from here and compiled it.
$ cd ~ $ cp -a /usr/src/redhat/ rpmbuild $ echo '%_topdir %(echo $HOME)/rpmbuild' >> .rpmmacros $ echo '%debug_package %{nil}' >> .rpmmacros $ rpm -ivh alsa-oss-1.0.10-1.src.rpm $ cd rpmbuild/SPECS $ rpmbuild -bb alsa-oss.spec $ cd ~/rpmbuild/RPMS/i386 $ su # install -ivh alsa-oss-1.0.10-1.i386.rpmIf you can find a alsa-oss RPM package for RHEL4 or Fedora3 somewhere else, it will probably work too. - Change application configurations to use ALSA.
- KDE: In the Control Center, go to "Sound & Multimedia"->"Sound System"->"Hardware" and select "Advanced Linux Sound Architecture".
- MPlayer: create a file ~/.mplayer/config and add 'ao=alsa'.
- XMMS: open the preferences window and choose ALSA as Output Plugin.
- Firefox: create a wrapper script.
#! aoss /usr/bin/firefox "$@"
Then make it executable and put it in a location listed in the execution path. For example, you can put it in the ~/bin directory and add this directory to the $PATH environment variable. (Another approach is to create an alias like "alias firefox='aoss /usr/bin/firefox'".) - Play: add "alias play='aplay'".
Other minor issues
- The default paper size of dvips is A4. US users may want to change it letter (see here).
- To use tpb for onscreen display, you need to install xosd RPM. Old version of xosd had an issue when it is used together with VMWare (tpb randomly freezed when VMWare or VMPlayer was running). xosd-2.2.14 or later works fine. (You may have to create a device file /etc/udev/devices/nvram manually if your RPM file doesn't include it. The RPM package for RHEL4 does contain the device file. try 'rpm -qf tpb' and see what files are included.) Finally, to run tpb as a normal user, you need to edit /etc/udev/permissions.d/50-udev.permissions and edit the line for nvram to something like 'nvram:root:root:0666'. You could directly changing the permission of /dev/nvram, but then that's only effective until you reboot the system.
Upgrading from CentOS 4.2 to 4.3
With the release of the Red Hat Enterprise Linux 4 Update 3, the CentOS 4.3 has been made available. On my system, the yum command automatically attempted to connect a new repository. (To prevent this from happening, you can modify /etc/yum.conf and the files in /etc/yum.repos.d so that yum can access to the version 4.2 tree instead of the latest version 4 tree.)It is often unadvised to jump to a new release if the stability has the highest priority. However, I took a risk and just ran 'yum upgrade'. After a reboot, the system seems to work fine as before. (Since the X packages are updated, you need to rebuild the X packages to re-enable the center-button click if you are using the same approach as I do.)