christners.net
  christners.net - home  |  gallery  |  jokes  |  linux on my thinkpad   merle & evie  |  jay & carissa  |  rob & elizabeth  |  teresa & sheldon    
 

rob & elizabeth


 

  Fedora Core 1 on my IBM Thinkpad T40p

Check out my Fedora Core 3 (2.6 kernel) page.


Contents


Disclamer

I realize the reasons for refering to GNU/Linux as GNU/Linux, and I wish to give GNU, the Free Software Foundation, and all the software contributer's the credit they deserve, but for simplicity I will refer to GNU/Linux as just Linux for the remainder of the page. This page is meant to document my fun with getting Linux to run the way I like it on my machine. I hope that it will help other people as well, but it is by no means comprehensive. I also do not pretend to be any type of Linux "guru", so it is quite possible that there are better ways of doing things than how I have them documented. But, this is what worked for me.


Resources

These few websites were helpful to me, and most of them offer a more complete description of getting some type of Linux working on a T40.


Hardware

IBM Thinkpad T40p (2373-G1U)
Added 512MB of memory, see Memory Problems below.


Distro

Since I've been using Red Hat for awhile, and they recently have gone the route of Fedora for their testing grounds I decided to use Fedora Core 1. Most of the things I discuss here should also work in recent versions of Red Hat (i.e. 8 and 9). Plus, since I'm a grad student at NC State and my office is next door to the Red Hat corporate headquarters, I feel a sort of kinship with them. :)


Partitioning

Even though it isn't free (as in beer or speach), my favorite partitioning tool is Partition Magic. Version 8 supports formatting ext3 partitions, so it is very convenient. I used it to partition my 40 GB hard drive to around 20 GB for Linux and 15 GB for Windows. Partition Magic didn't see the IBM Predesktop area so I didn't have to worry about it, except that I only have 35 GB of useful space.

I made the mistake of moving my NTFS partition to the end of the drive and installing Linux before it. Doing it this way makes the partition table messy, because the partitions are no longer numbered in order. Windows XP needs to have the partition number of its NTFS partition correct in its boot.ini file or it will not boot. So if some other program looks at your partition table, and tries to correct the partition numbers, your screwed. Linux is easy to fix, just change /etc/fstab. In order to fix boot.ini in Windows you need to use the recovery console and run bootcfg /rebuild. Instead, shrink your NTFS partition down, but leave it as the first partition. Install linux after it, and in the MBR. Oh, and use grub as your bootloader. It is better IMHO.


Install

Smooth. The only problem I had was the loss of mouse control (trackpoint, since I disabled the trackpad in the BIOS because it annoys me) during the firstboot setup agent. After navigating through that with the keyboard, the mouse returned.


Memory Problems

I, many of my colleagues, and many other users according to other web resources, have had issues with installing a second 512 MB memory module from Crucial in T40s. After surviving a few spontaneous reboots, I tested the memory with memtest86. It showed several errors in the upper 512 MB of my memory (the add-on module). I returned the module to Crucial and tried a replacement…it failed also. I returned that module and bought an Infineon module off of Ebay (IBM part number 10K0033) It works flawlessly. Normally, I am a large advocate of Crucial memory, and they didn't question my returns, but I would stay away from them if you have a T40. I've had many other modules from Crucial in the past and never had any problems with them. I think there is just some compatability issue with these modules and T40s.


Console Framebuffer

Although Fedora goes to a graphical X console very early in the startup sequence, I wasn't satisfied. I used the kernel boot parameter vga=792 to specify a framebuffer for the entire console...start to finish.

Update (1/15/04): I've since changed this to get a 1400x1050 resolution at 24 bit color. See /boot/grub/grub.conf for details.


APM

APM is enabled by default in the Fedora kernel and it seems to work fine to just close the lid to go to suspend. The Fn-F4 key combo does not work well without some further configuration. The screen goes black, but just moving the mouse brings it back, the suspend light never comes on. I'm still working on getting suspend/resume to work for real. I've tried going to ACPI, but even in the 2.6 kernel things are still not quite right.

Update (3/01/04): I've changed my /etc/syconfig/apmd slightly to make suspend/resume work better. It is working now to use Fn-F4 as well as just closing the lid. The Volume Control applet needs to be restarted on resume because sound gets restarted. Also, it works better to shutdown the network devices manually ahead of time with ifdown <device>.


Thinkpad Specific Stuff

To get the Thinkpad functions keys and volume controls to work I had to install the tbp (http://www.nongnu.org/tpb) package from Fedora. Once installed, I changed a few settings in /etc/tpbrc to make the OSD a bit prettier.

APM         ON
OSDFONT     -adobe-helvetica-*-r-*-*-14-*-100-100-*-*-*-*
OSDCOLOR    Red


I then installed the kernel-module-thinkpad, tpctl, and configure-thinkpad packages from the DAG apt repository (http://dag.wieers.com/home-made/apt/). I created a thinkpad group to give access to /dev/thinkpad. Also, I added some lines to /etc/modules.conf. I know the rpm does some of this for you, but I don't remember exactly what.


Centrino

Well, Pentium M anyway (see Wireless below). The default kernel version with Fedora Core 1 supports the 1MB cache (in /proc/cpuinfo), but doesn't support the speedstep technology to stepdown the processor when the power adapter is unplugged. The processor speed is stepped down (via the BIOS) if the adapter is unplugged before the T40 is powered up. Previous versions of the 2.4 kernel also had some IDE (DMA) problems that slowed the machine way down. I have not seen any issues like that. Eventually I am planning on trying a 2.6 kernel, which will hopefully fix the speedstep issue.

Update (11/18/03): I was wrong, the kernel does support speedstep for Centrino. To enable automatic stepdown for the processor speed when the power adapter is unplugged I did the following. (This is a shameless copy from http://slog.dk/~jensen/inspiron8200/inspiron_rh9.0.html#cpufreq.)

I loaded the Centrino module

modprobe speedstep-centrino

I added these two lines to the end of /etc/sysconfig/apmd.
CPUFREQ="yes"
[ "x$CPUFREQ" == "xno" ] || [ -e /proc/cpufreq ] || modprobe speedstep-centrino

Then I restarted the apm daemon with

/sbin/service apmd restart

To test this, I used the information provided in /proc with

cat /proc/cpuinfo
cat /proc/cpufreq

The frequency values in these files changed when I plug and unplug the power adapter.

To load the speedstep module during the bootup sequence I created a file /etc/rc.modules and added the line

modprobe speedstep-centrino

This file is executed in Fedora and Red Hat distributions during the initiallization sequence, specifically in /etc/rc.d/rc.sysinit. Since it is executed and not just sourced, the file needed to be executable. (chmod +x /etc/rc.modules)

Update (2/26/04): A much better way to do this is to just install the cpufreqd rpm from DAGs apt repository (I'm starting to sound like a commercial). See my /etc/cpufreqd.conf for how to configure it for use with APM. You can then remove the added line at the end of /etc/sysconfig/apmd, but just leave CPUFREQ="yes". You also don't need to create the /etc/rc.modules file because the cpufreqd daemon loads the module for you.


Graphics

Without any changes to the default Fedora kernel (2.4.22-1.2149.nptl) and XFree86 (4.3.0-42) 3d direct rendering (DRI) works fine for my Ati Mobility Fire GL 9000. I was getting around 1200 FPS with glxgears (in the original window size, not full screen) and the standard XFree86 Mesa drivers. Out of curiosity I installed the fglrx Ati proprietary drivers from http://www.schneider-digital.de/html/download_ati.html. glxgears showed an improvement to around 1600 FPS with these drivers. Since I really only use OpenGL in Linux for tuxracer and the like, I didn't think this was really worth "tainting" my kernel for. So I'm going back to the free drivers. You can look at the Ati version of my /etc/X11/XF86Config-4 file if you want to go that route. I've also included the default /etc/X11/XF86Config file for reference.

Note: I also have an Ati Radeon 9500 Pro in my desktop, and the only way I could get 3d support was to install the fglrx drivers. And since my desktop has a Via KT400 chipset, I had to even hack (though a very simple one) the provided agpgart driver to get it to recognize my AGP aperture size from my motherboard. Long story short...don't get an Ati card if you want to play games in Linux. Go with nVidia (the lesser of two evils), they have better drivers for Linux (though still proprietary).


Wireless

I didn't have a choice on my wireless option (I guess I could've bought another card, but then what would I do with my old one?). I have the IBM Atheros a/b minipci card (thus making my system non-Centrino...Ah man, what ever will I do!). Currently there isn't good Linux support. I have tried the latest version of Linuxant's driverloader to no avail. I'm in the process of getting the latest CVS version of the madwifi atheros driver (the madwifi faq site is best viewed with a Mozilla type browser).

Update (11/10/03): I got the CVS (11/10/03) madwifi driver to work (sort of). I had trouble with getting it to successfully use the WEP key, so for the time being (until I have enough free time to look into it further) I'm just not broadcasting my ssid. I have basic functionality, but I haven't tried to do anything fancy. This is what I did (as well as I can remember).

  1. Checked out the latest CVS copy of madwifi

    cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi

  2. Followed the directions for installing in the README

    as root

    make all
    insmod wlan/wlan.o
    insmod ath_hal/ath_hal.o
    insmod driver/ath_pci.o
    make install


  3. add this line to /etc/modules.conf

    alias ath0 ath_pci

  4. I think I rebooted at this point and kudzu found the ath0 device on the next startup and asked me to configure it. I tried that, but I think it failed for some reason (probably some confusion with eth0). Anyway, it created an ifcfg-ath0 file for me, but I had to modify it (see next).

  5. I modified /etc/sysconfig/network-scripts/ifcfg-ath0 to be the following (the redhat-config-network program didn't see the ath0 driver, so I couldn't use that).

    DEVICE=ath0
    ONBOOT=no
    BOOTPROTO=static
    IPADDR=192.168.1.3
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.1
    WIRELESS=yes


  6. I never got certain things to work on bootup (e.g. associating with a certain access point), so I created a few very rudimentary script files that I run depending on if I'm at home or at school/work (I will be merging these into a single script with some options eventually). The scripts basically just run these commands in order.

    # bring up the interface
    ifup ath0

    # set ssid to "my essid"
    iwconfig ath0 essid "my essid"

    # set access point to hardware address of the access point you
    # want to connect to, in the form FF.FF.FF.FF.FF.FF
    iwconfig ath0 ap "my access point"

    # non-adhoc mode
    iwconfig ath0 mode Managed

    # use 802.11b only, don't even try the others
    iwpriv ath0 mode 2


  7. To find the access point hardware (MAC) address to connect to, I have to use the commad

    iwlist ath0 scan

    This gives a list of the APs that the device can "see". I just pick the one with the best signal and run

    iwconfig ath0 ap FF.FF.FF.FF.FF.FF

    with the new AP address accordingly. I tried to have the driver (or Linux tools, whichever) discover the best AP, but that didn't work for me. Sometimes I have to bring the device up and down a few times before things start working. However, once it is up it stays that way. I haven't tried any benchmarks or anything yet. I'm just happy that it works.


So it took some fiddling, but wireless works for what I need it to at the moment. Thanks to the guys who help out with madwifi. I also use some network applets that let me see what's going on at all times. With the version of madwifi that I am using the GNOME wireless link monitor applet works fine. In addition I like the net-speed applet, so I know how well my DSL is working.

Update (1/14/04): I found that the driver works the best if used with DHCP. So I configured my /etc/sysconfig/network-scripts/ifcfg-ath0 file accordingly. I also found that the driver does a pretty good job of autodetecting the access point in this configuration, so all I really need to do to start up wireless is run (as root)

ifup ath0

Update (1/15/04): DAG made some rpms of a CVS version of this driver and he made them available in his apt repository (http://dag.wieers.com/home-made/apt/), so I unistalled mine and used his instead. They work the same.


IBM USB Memory Key

To get my IBM USB memory key to work I added the following to /etc/updfstab.conf

device usbkey
{
    partition 1
    match hd "Memory Key"
}


then in /etc/security/console.perms under #device classes I added

<usbkey>=/mnt/usbkey*

and under #permission definitions I added

<console> 0600 <usbkey> 0660 root.disk

Alternatively, it should work to just add match hd "Memory Key" to one of the devices already listed in /etc/updfstab.conf.defaults (e.g. flash or diskonkey).


Compact Flash PC Card Reader

I also had to add

match hd "SanDisk"
match hd "TOSHIBA"

to the device listing for flash in /etc/updfstab.conf.defaults for my PCMCIA card reader to work with my Canon (SanDisk) and Kingston (TOSHIBA) CompactFlash cards. To find the string values to use for these cards I plugged them in and looked at /proc/scsi/sg/device_strs.

Now when I plug any of these devices in, a corresponding directory (mount point) appears in /mnt and in /etc/fstab. I can then mount the device with

mount /mnt/[device]

where [device] is either flash (for the CF cards) or usbkey (for the memory key). I can do this as any user also. I don't have to be root because of my changes to /etc/security/console.perms.

To remove the device I must first

unmount /mnt/[device]

then physically remove it.


Config Files

 

  

This site is maintained by Robert K. Christner <robonline at christners dot net>.