Excellent Adventures with Redhat 7.3 on a Thinkpad 600 Laptop



Excellent Adventures with Redhat 7.3 on a Thinkpad 600 Laptop

by Steve Grubb

Orignal version March 2003; most recent update Feb '05
This article describes setting up a Thinkpad 600 with Redhat 7.3 (kernel 2.4.18) for use by my family (who are not too computer-savvy). Planned uses are for me to work from home, and for everyone to do web browsing, email, word processing, etc. This exercise involved configuring and troubleshooting PCMCIA modem, PCMCIA net card, PPP, suspend/resume, and so on. This writeup is a summary of my observations. My background is as a Unix software developer (eg. ploticus) with some SunOS sysadm experience from ~ 10-15 years ago, and no Linux setup experience.

  • documentation / info
  • versions
  • boot up
  • shutdown
  • reset button
  • battery
  • bios
  • irq
  • clock
  • color display, x11, gnome
  • mouse, cut / paste
  • keyboard, useful keystrokes
  • cd, floppy
  • networking
  • modem
  • pcmcia
  • ppp
  • dialers - kppp
  • alternating between network and PPP
  • email clients and browsers
  • making it easy to use
  • apm - suspend & resume
  • printing
  • USB camera
  • USB flash drive
  • Java2 runtime environment plugin
  • sound
  • misc


  •         This page hosted by: SourceForge Logo




    Documentation / info

    My general approach was to read the various writeups on the web then use Google Groups searches, often using keywords redhat 7.3 thinkpad followed by specific key words or specific error message text.

    On the laptop itself there is no one central place to look for documentation. man(1) pages exist for some commands but not others. The info(1) command is available but seems rather lame. There's /usr/share/docs to explore. I also get the feeling there are several other documentation "systems" present that I don't know about. Sometimes the docs reference file and command names that exist for some other flavor of linux (or an earlier RedHat version) and are different in redhat 7.3. In general, you have to be ready to use all of these various approaches, and muddle through.

    Helpful links

  • Thinkpad webring
  • Tom Hood's page
  • The official redhat linux reference guide
  • Linux for newbies
  • Linux on Laptops
  • redhat-basics (but the PPP writeup is out of date)
  • IBM mwave page
  • isapnp  
  • tpctl thinkpad utilities for linux
  • PPP howto


    Buying the Thinkpad 600

    I purchased it from a company called Linux Certified, Inc for $549 plus $28 shipping. It came preloaded with redhat 7.3 (kernel 2.4.18-3) and was advertised as "configured and supported by our linux experts" with "all core components .. correctly configured." Apparently the vendor's idea of "all core components" doesn't include networking, the modem, or PPP.

    Versions

    Red Hat 7.3
    Kernel: 2.4.18-3
    gcc 2.96
    pcmcia 3.1.22
    pppd 2.4.1, pppd generic driver 2.4.2
    
    XFree86-4.2.0-8
    glib-1.2.10
    glibc-2.2.5-34
    gtk+-1.2.10-15
    libstdc++-2.96
    


    System messages

    are logged in /var/log/messages. These should be scrutinized (as root) often. There's also the dmsg command.

    Power up

    The system came preloaded and there were no problems with disk, display, keyboard, mouse, X11, gnome. It booted up as localhost. I started up a terminal window, su'ed to root, and added a nonprivileged login using the adduser program. I used the nonprivileged login whenever possible. I set the time from Pacific to EST using the date command as root.

  • Occasional problem: On power-up it started failing the POST with error 937 (motherboard / cooling fan). This turned out to be fixable by replacing the CMOS RAM RTC battery (about $10) .. it can be ordered from IBM parts dept (IBM part # is 02K6502). Easy to replace.. open the panel on the bottom.

  • Occasional problem: sometimes get a POST error code of 167 and 177, which simply means that the OS time doesn't match the hardware time. Just click thru the hardware tester. This can be avoided by using the hwclock command after setting the date.

    Shutdown

    Use the Gnome "Log out" menu selection (but the "Reboot" option hangs) If gnome isn't available you can use /sbin/shutdown -h now as root to shutdown and halt, or just /sbin/shutdown now to go to single user mode.

    Reset button

    I crashed and/or hung the Thinkpad several times during my adventure. The on/off switch doesn't always respond in these situations. There is a reset button on the TP 600 to the left/below the on/off switch .. it's a hole where a paper clip end can be inserted to do a reset. This usually did the trick but there was one crash where even the reset button didn't respond (and the power cord light wouldn't light), so I had to turn the unit over, remove the battery, then put it back in, then it came back fine. This is one area where the unit seems too smart for its own good.

    BIOS

    Thinkpad BIOS can be accessed by holding down F1 during power-up. There doesn't seem to be a whole lot you can do from the Thinkpad BIOS user interface.

    Battery

    My unit came with a battery at the end of its life-cycle.. on battery power we would go about 15 minutes, then power level plunged abruptly to 5%. New LIon battery ($100) fixed the problem.

    IRQ

    May be listed by doing cat /proc/interrupts. I noted that the PCMCIA net card took IRQ 3 and the PCMCIA modem card took IRQ 9. The sound card seemed to be set for IRQ 5.

    Clock

    To set the system clock, use a command like this as root: date -s "June 6, 2003 3:15pm" To copy the system time to the hardware clock, use the hwclock command (this avoids 167/177 POST errors at next boot-up). To set the timezone, copy the appropriate file from the /usr/share/zoneinfo tree to /etc/timezone, and also change the timezone entry in /etc/sysconfig/clock to eg. US/Eastern.

    Color display, X11, Gnome

    Nothing unusual to report. The browser fonts don't look the best. I verified that the screen was running at the advertised resolution (1024 x 768) by making a full-screen terminal window then using xwininfo. Screen saver kicked in properly.
    Problem: X11 and gnome fall apart if the /etc/sysconfig/network HOSTNAME doesn't agree with a line in /etc/hosts.

    Mouse, and cut paste / copy paste

    Thinkpad has a red dot that positions the pointer by pushing on it in various ways. There are three buttons below the space bar.. the two smaller ones are "left" and "right", and the larger one is "middle".

    Copy/paste is buggy in gnome-terminal (esp. to/from other apps such as galeon), so I switched over to using Konsole, and copy/paste works fine (to paste use either the [Edit] pulldown menu or the middle mouse button.

    Occasional disappearing mouse pointer noted after RESUME (see suspend/resume section below).

    Keyboard, useful keystrokes:

    • Command retry/history (bash): control p or the up arrow key
    • To mute the speakers: Fn backspace
    • To turn off bell: Fn PgDn
    • To completely kill X session and get a character-based login prompt (or restart X): ctrl alt backspace (this seems to leave things in a somewhat unstable state however).


    CD, floppy drives

    Haven't had a chance to try them yet.

    Network

    Initially I wanted to connect to the network at my office to download some things. The PCMCIA network card was inserted at the factory into the lower slot.

    Here I ran into first snag: in /etc/rc.d/rc5.d network services are started before pcmcia. So, I renamed the pcmcia file so that it came just before network services.

    To set the hostname I did a hostname tricorder
    then edited /etc/sysconfig/network to say:
    NETWORKING=yes
    HOSTNAME=tricorder
    
    and edited /etc/hosts to say:
    127.0.0.1	localhost.localdomain	localhost	tricorder
    193.23.456.34	tricorder.jax.org	tricorder
    
    Our IT department informed me that they use DHCP for dynamic hostname setting, and they told me to modify /etc/sysconfig/network-scripts/ifcfg-eth0 to read:
    DEVICE=eth0
    BOOTPROTO=dhcp
    ONBOOT=no
    
    To bring eth0 up or down I use the GUI network config app. If you need to hardcode IP addresses you can do so via the GUI app.

    Occasional failure to connect with DHCP server.. PCMCIA net card seems stuck in a wierd state, likely related to suspend/resume. Fix by issueing the commands cardctl eject 1; cardctl insert 1 (1 is for the lower slot, use 0 for the upper slot).

    Problem: X11 and gnome fall apart if the /etc/sysconfig/network HOSTNAME doesn't agree with a line in /etc/hosts.

    Modem

    The Thinkpad 600 has a built in 56k winmodem called mwave. IBM has made mwave linux drivers available. Mwave drivers are apparently included in 2.4.19 kernels (and up), but my Thinkpad was shipped with 2.4.18-3.... At my request the vendor sent a 38k PCMCIA modem card, which I will use instead. (Rumor has it that my local telco switch cannot achieve speeds over 32k anyway).

    The included PCMCIA modem was a USRobotics 38k. It has a sideways RJ8 jack that pops out when you push on it. Initially there were some PCMCIA-related problems.. I tried powering down, inserting the card, and booting, but it hung during boot-up. Then I tried inserting the card while the system was up, and listening for the beeps and monitoring the last lines in /var/log/messages (see cardmgr man page). Eventually I got this to work by narrowing down the address and port ranges (see below). This hint came from several helpful postings found via Google Groups. When I finally got two high-pitched beeps (indicating success) cardmgr was nice enough to set up a /dev/modem link to ttyS4, and update its internal database with the modem card's parameters. It indicated that it was using IRQ 9.

    I tried minicom, expecting to be able to type ATZ and get back an OK but this didn't work. However, invoking: kppp & and going to the Setup/modem section, it found the modem and was able to excercise it, so I knew I was home free.

    PCMCIA

    During the process of getting the modem to work, I had to edit the file /etc/pcmcia/conf.opts to say:
    include port 0xc00-0xcff
    # removed the range 0x100-0x4ff
    
    include memory 0xc0000-0xfffff
    include memory 0x60000000-0x60ffffff
    # removed the range 0xa0000000-0xa0ffffff
    
    ...
    


    Problem: I tried ejecting the PCMCIA network card while the system was up, thinking that cardmgr would handle this, but the system crashed immediately - so hard that I had to disconnect/reconnect the battery to get it to reboot! See "RESET BUTTON" above..

    Useful commands:
    • cardctl useful for troubleshooting, eg. cardctl config, cardctl ident, etc. Also useful if network card or modem card seems hung, eg use
      cardctl eject 0; cardctl insert 0
    • cardmgr monitors the slots for insert events.. operates at a lower level than cardctl.. after initial configuration haven't needed to mess with it.


    PPP

    The main debugging tactic was to try something then look at the last 20 lines of /var/log/messages.

    I determined that my kernel had PPP. However there was no ppp0 module in /lib/modules/*/kernel/drivers/net, just ppp_generic and a few others. At first I tried alias ppp0 ppp_generic but didn't get anywhere. Then I saw a posting with correct (?) /etc/modules.conf settings:
      #pppd
      alias tty-ldisc-3 ppp_async
      alias tty-ldisc-14 ppp_synctty
      alias char-major-108 ppp_generic
    


    The ppp0 interface still didn't seem to exist and I wasn't sure how to create it by editing various files. It turned out the way to do this is via the GUI Network Config tool by "Adding" a dial-up interface. This ends up creating a wvdial entry that you won't see if you use kppp.

    So I was at the point where I could dial and connect to the PPP server at my ISP. I had the ISP info (DNS IP address), login, and password. However, I was not able to do any TCP/IP activity. In the log I was seeing the message

    pppd: not replacing existing default route to eth0..

    This turned out to mean that eth0 was active and creating conflict. eth0 was coming up automatically with boot. So that it would not in future, I edited /etc/sysconfig/network-scripts/ifcfg-eth0 and changed it to say ONBOOT='no' Then PPP worked.

  • Occasional problem: "Modem busy" message in KPPP when clicking on "Connect". Rebooting solves the problem; another possibility is that the port was left in a wierd state.. try cardctl eject 0; cardctl insert 0 (my modem is in PCMCIA slot 0, the upper slot).

    I'm still seeing some "Cannot find interface ppp0" messages, and other various "assuming" and "cannot find" messages in the error log, but PPP is working fine so apparently they're spurious.

    Dialers

    KPPP seems like the best candidate for wife/kids use. I made it stop demanding root password by editing /etc/pam.d/kppp and commenting out the first line and add the second as:
    #auth   sufficient      /lib/security/pam_rootok.so
    auth    sufficient      /lib/security/pam_permit.so
    
    I don't know a thing about PAM (see /usr/share/docs) but this worked.

    I made kppp easilly accessible using a control panel launcher.

    Alternating between network connection and PPP

    Alternating between home (ppp0) and work (eth0) basically works fine. At home the laptop functions as a PPP client via modem, and at work as a host connected directly to the campus ethernet LAN. On start up the system defaults to eth0 not active. When I take the laptop to work, I plug the network cable into the network PCMCIA card (uses a supplied adapter) then use the GUI network config app to activate eth0 (and to deactivate when back home, so PPP works). No fiddling with files is needed now.

    When at work I routinely issue cardctl eject 1; cardctl insert 1 before connecting, to be sure the PCMCIA net card is ready to go (suspend/resume seems to leave it in an unusable state).

    Email clients and browsers

    I prefer rlogin and pine for email.

    For the rest of the family, a GUI email client app is called for. Everyone in the family will share one email account. So this is an IMAP situation rather than POP3. Netscape is pre-installed on the Thinkpad, and has a fairly nice GUI interface, so we'll try Netscape mail first. A step-by-step guide for setting up Netscape mail w/ IMAP.

    One issue with IMAP is that it requires that we tie up the phone line while reading and composing messages. Of course we can always compose long messages in a local editor, then connect and copy/paste into Netscape.

    Also tried balsa, which seems to be better at handling large chunks of non-wrapped text, but a little trickier for naive users to get started with.

    Have seen good things written about Sylpheed email client but it's another monster.

    The Thinkpad comes with Mozilla, Galeon, Netscape 4.7x, and Konquerer, all of which seem good. Netscape 4.7x is getting dated with regard to players and plugins which the kids ask for.



    Making it easy to use

    In order to have internet access / web browser / email client all launched with one menu button, I packaged the kppp command and netscape command into a shell script, and created a menu button launcher to invoke that script. The script utilizes getgui which is a lightweight xlib utility I wrote that can get user responses via GUI buttons, and write the result to standard output. This script also addresses the issue of users pressing the launch buttons repeatedly when nothing seems to happen immediately (kppp must be huge.. it takes up to 10 seconds to get started). Here's the script:
    #!/bin/sh
    #
    # start kppp, browser, and email client.
    #
    # try to start each app, but don't start if already active..
    
    browserans="Yes"
    
    N=`ps -u root | grep " kppp" | wc -l`
    if [ $N -gt 0 ]; then
    
      browserans=`getgui -prompt "Commlink already started.. 
      click on the 'KPPP' box 
      at bottom center.
    
      Start web browser now?" -buttons "Yes,No"`
    
    else
      ans=`getgui -prompt "Connect to internet?" -buttons "Yes,No" `
      if [ "$ans" = "Yes" ]; then
    
        kppp -c "jackson lab internet" 2>> /home/family/.internet_err &
    
        browserans=`getgui -prompt "Accessing internet..
    
        Start web browser now?" -buttons "Yes,No"`
    
      fi
    fi
    
    if [ "$browserans" = "Yes" ]; then
       galeon &
    fi
    


    Suspend & resume

    To be able to put the computer to sleep / wake it up, use apm to suspend the machine. This avoids having the computer ON all the time, and avoids the long shutdown and boot-up processes. I defined a menu button to launch a shell script that invokes apm --suspend along with a getgui dialog box. The apm executable had to be made setuid root in order for this to work. I also put in a kppp -k command to hangup any active kppp session. Here's the script:
    #!/bin/sh
    #
    
    ans=`getgui -winsize 6,3 -prompt "When you press OK, the computer
    will go to sleep.  After it goes to sleep,
    shut the lid.  Don't touch the on/off switch.
    When you come back tomorrow, just open the lid, 
    and the computer will wake up." -buttons "OK,Cancel" `
    
    if [ "$ans" = "Cancel" ]; then
      exit 1
    fi
    
    # kill any existing connection..
    kppp -k
    
    # kill balsa since it hangs when we resume..
    BALSA=`ps -u family | grep " balsa" | awk '{ print $1 }' `
    if [ "$BALSA" != "" ]; then
      kill -9 $BALSA
    fi
    
    # go to sleep..
    apm --suspend
    

    The Thinkpad resume is triggered by the action of opening the laptop lid. The resume operation completed in seconds and everything seemed just as it was left, including kppp and netscape. Users must know to just open the lid rather than utilize the on/off switch.

    We noticed that when running on battery power, using apm --suspend hung the machine.. all a user really needs to do when on battery is shut the lid. So I made a change to the above script to just exit when running in battery mode (you can tell by running apm with no args).

    A problem that came up when first getting suspend to work, was that PPP no longer worked after resume. The modem dialed and connected, but no network actions could be done. I was getting this message in the log again:

    pppd: not replacing existing default route to eth0..

    This indicated that resume was starting up eth0 which conflicts with ppp. To fix this I edited the file /etc/sysconfig/apmd to read NET_RESTART="no". This fixed the problem, and everything worked well.

  • Occasional problem: Several times now the mouse pointer is gone following a resume from apm.. CTL-ALT-backspace (which aborts the current X session) fixes it. Seems to be some kind of gnome-centric problem (?).

    Printing

    We got a used HP DeskJet 350C printer on Ebay, connected it to the Thinkpad printer port (/dev/lp0) using a centronix cable, and configured it using the RedHat Printer Config GUI tool. Be sure to click on the little triangles when selecting printer. I selected the hpijs driver. It works fine. We use lp/lpr as the print spooler. Applications should be set to send PostScript to lp. Best practice may be to keep the printer turned off until needed... I noted that the printer went thru some strange gyrations and light blinking when I "woke the computer up" (apm resume) with the printer connected and switched on. I noted that the internal system uses ghostscript to get from postscript to HP printer commands, and involves something called foomatic.

    USB Camera

    (Jan 11 '05) This Linux version (Redhat 7.3 kernel 2.4.18) is ready to go for USB 1.0. I didn't have to do any modprobes at all. I connected a Nikon Coolpix camera to the USB port (a few lines are logged to /var/log/messages when a USB device is connected). Then as root did this: mount -t vfat /dev/sda1 /mnt/camera. The camera's jpeg files were accessible by going into /mnt/camera. Copying them to the Thinkpad's hard drive seemed reasonably fast.

    Next I modified /etc/fstab so that any user can do the mount / unmount (I added user to the comma-delimited option list in field 4 for the /mnt/camera line). Now any user can do mount /mnt/camera.

    I've set up a little photo workflow system on the Thinkpad, involving a shell script that automates the copying process.. it copies photo files from the camera to my pictures directory on the Thinkpad, and runs jpgtn to make smaller versions of each (big) photo image. It only copies over photo files that haven't been copied already. It also builds some html photo display files. We view the smaller versions of photos using the web browser. We'll keep the full size images around for a while, but then eventually remove these. The small versions look fine on the screen, are more convenient, and occupy much less disk space. (I have discovered that when it comes to workflow-type applications I like to build my own solution by combining familiar building blocks.. and with workflow apps I like to have complete control over everything... that's why I do it this way rather than using a ready-made solution).

    There's another shell script that goes through the most recent batch and lets me fire up xv to do rotates or color adjustments for each photo.

    Managing photo files can be challenging.. digital photography is so much fun that you'll take gobs of pictures, then not want to delete many of them.. Care needs to be taken in order to avoid having multiple copies of all these big files laying around. If you're going to do a processing pass you need to keep track of where you left off so you don't repeat yourself, and care must be taken to avoid overwriting already processed images. Backups also need to be considered... we know someone who went on an international trip, loaded lots of nice pictures onto her Mac, then the disk crashed and she lost most of it.

    USB flash drive

    (Feb 5 '05) Since this Thinkpad didn't come with a CD burner, we decided to get a USB flash drive for keeping selective backup copies of important data, and maybe to move data around. This Linux version seems ready to go for USB activity; I didn't have to do any modprobes at all. Bought a Lexmark-type 256MB flash drive for $29. Wanted one with "no drivers required" and no complications. When I plugged it into the Thinkpad's one USB port it was assigned to /dev/sdb (found out by checking the end of /var/log/messages). Apparently the flash drive was given "b" because the USB camera had previously been hooked up and gotten sda. Will the flash drive always be assigned to sdb, even if I reboot and then connect it before connecting the camera?

    Before using the brand new flash drive it needs to be "formatted". First as root I ran /sbin/fdisk /dev/sdb (it's an interactive program), asked it to print out the existing partition table, and asked it to remove any existing partitions. Then I asked it to create one new partition (#1). Next I asked it to change the new partition's type to Windows 95 FAT32 in case I ever want to use it with a win32 machine. The last step is to write the new partition table out, then quit.

    Next, I built a vfat file system on it using: mkfs -t vfat /dev/sdb1. Finally I added an /etc/fstab file as with the USB camera, with user. If you want read/write access to the flash drive don't use the ro option. I also as root did this: cd /mnt; mkdir flashdrive

    Now any user can access the flash drive by plugging in the flash drive and entering the command mount /mnt/flashdrive.

    In /etc/fstab I removed the kudzu option because on subsequent flash drive connects the /etc/fstab entry (and /mnt/flashdrive directory) were being automatically removed, which I didn't want. I guess I don't fully understand hotplug, kudzu, updfstab, etc.

    Java runtime environment plugin

    (Mar 29 '05) We wanted to use a website that requires the java runtime environment plugin (javavm). The standard Netscape plugins download page was a dead end.

    After searching around for a while I found Blackdown Java for Linux and downloaded JRE 1.4.2. My system met all the lib requirements (etc.) except that I needed Mozilla browser 1.0+. There seems to be a nuance here involving gcc versioning. I have gcc 2.96 so I downloaded the JRE version for gcc 2.9x. But then it wasn't completely clear which mozilla version to take.. Firefox was out because of outdated libs & kernel; the later Mozillas (1.4 and up) seemed to require gcc 3.x but there were contradictions in the release notes (libstdc++5 ???). I finally settled on Mozilla 1.0.2 ... the download and release notes were still available (see the very bottom of this page). Downloaded the tar.gz file, installed it, and made a soft link to the java plugin, and it seems to work.



    Sound

    (Mar 31 '05) Someone sent me sound parameters that worked for him (thanks!). I tried /sbin/sndconfig with no luck. I also tried entering this command as root:
    modprobe cs4232 io=0x530 irq=5 dma=1 dma2=3 mpuid=0x330 mpuirq=10.
    still without results. Then I tried firing up the gnome audio mixer app... and the overall volume level was locked at 0 (!) After raising this level sounds could be heard. I then was able to use the KDE kaboodle app to play a .WAV file. Another thing to try would be sure that MUTE is not on (Fn+PgUp and Fn+PgDn keys).

    However, there are still problems.. somehow the artsd (analog real-time synthesizer daemon) was started... and I found I couldn't suspend the machine until artsd was killed. There are also other undesired interactions between sound and suspend, such as sound not working correctly after system resume. So the above modprobe command won't be installed in a permanent location.. but I might set something up where sound can be turned on/off manually.




    Misc info



    Red hat configuration

    Happens mostly in /etc/sysconfig. Apparently this is "red-hat-centric". These configuration files are documented in /usr/share/doc/initscripts-*/sysconfig.txt

    Modules

    Available kernel modules are located in /lib/modules/2.4.18-3/.

    My /etc/modules.conf file looks like this:
      alias parport_lowlevel parport_pc
      alias usb-controller usb-uhci
      alias eth0 pcnet_cs
      #pppd
      alias tty-ldisc-3 ppp_async
      alias tty-ldisc-14 ppp_synctty
      alias char-major-108 ppp_generic
    

    Useful commands:
    • /sbin/lsmod list loaded modules
    • /sbin/modprobe -c
    • /sbin/modinfo show info on a certain module
    • rpm -qa show all installed packages
    • uname -r prints kernel version number
    • cardctl eject 0; cardctl insert 0 - restart a PCMCIA card and drivers .. useful when a PCMCIA card seems hung.. (use 0 for the top card, 1 for the lower card). cardctl also has informational options that may be useful.
    • for dealing with ppp0 and eth0:
      • service network restart (etc.)
      • ifconfig -a
      • route -n or netstat -r
      • ifup ppp0
      • ifdown ppp0
      • ifup eth0
      • ifdown eth0
      • ifconfig network up (etc)


    The /proc structure

    This is described in the official redhat linux reference guide