Mark Alford's Red Hat 6.2 GNU/Linux on an IBM Thinkpad 600E (2645-5AU)

Last modified 6 May 2001

  1. Installation
  2. Enable all your memory
  3. Power Management: suspension and hibernation
  4. PCMCIA Ethernet/modem card (Linksys)
  5. Connecting to another computer using serial ports
  6. Getting the sound card working
  7. Miscellaneous: Streaming web audio, presentations using external projector, Japanese characters in LaTeX, system logs, HOWTO docs, extra RPMs, proper job scheduling, proper TeX search paths, etc.

I found much of what I needed to know on the Linux on laptops page, especially the amazing Thomas Hood's Thinkpad page

Notation: I use '----' to mark the beginning and end of bits of text that go in files.

1. Installation

I got the $9 (incl postage) RedHat6.2 + Packages Galore CD-ROMs from Cheapbytes. In the U.K., try Linux123.

It will make future reinstallations much easier if you create /home and /usr/local partitions, separate from the root partition / and/or /usr. That way you can reinstall the operating system, while leaving users unmolested and keeping most the special customizations you have introduced.

Boot with RH6.2 CDROM in DVD drive
English
US
Local CDROM
Custom
Disk Druid
delete hda5, the 4G windows partition, 
leaving a 2G partition (hda1) for Windows 98.
mount hda1 on /dos
Add / (2000M) Linux native   hda2
Add /home (500M) Linux native   hda6
Add /usr/local (500M) Linux native  hda7
Add /storage (970M) Linux native  hda5
Add Linux swap, grow to fill (about 125M)
Format: all of them
Bootloader: /dev/hda   
  let it boot Win98
Lilo: all defaults OK
Hostname: whatever
Mouse: Generic PS/2
Hardware clock: GMT
  US/Eastern
Root password:  whatever
Accounts:  add yourself
Use shadow passwords and MD5
Packages:  a long job
Make bootdisk
Monitor: LCP Panel 1024x768
  probe fails
  do not specify clockchip
  2M video RAM
  1024x768, 16 bit color
  X -probeonly works OK
Start X at boot?  No

2. Enabling extra memory

I have 128M, and Linux only detects up to 64M, so we need to include an 'append' command in /etc/lilo.conf, and rerun lilo. You look at how much memory is reported in the top left hand corner of the screen at boot time. In my case that is 130496k. The relevant part of lilo.conf should therefore be edited to look something like this
image=/boot/vmlinuz-2.2.14-5.0
    label=linux
    read-only
    root=/dev/hda2
    append="mem=130496k"
Then run lilo
> lilo
And reboot. Now you should have all the memory you paid for. To find out how much Linux is seeing, run "top", or
> more /proc/meminfo

3. Make power management work

Recompile the kernel:
> cd /usr/src/linux
> make mrproper
> make xconfig
xconfig lets you change kernel parameters. Alter the following settings in General Setup:
Parameter Setting
APM BIOS? y
Ignore user suspend? n
Enable PM at boot? y
Make CPU calls when idle? y
Enable console blanking by APM? y
Power off on shutdown? y
Ignore multiple suspend? y
Ignore multiple suspend/resume cycles? y
RTC time in GMT? y
Allow interrupts during APM BIOS calls? y
Save the config as as apm_kernel_config, just in case.
> make dep
> make clean  # not usually necessary
> make bzImage
> make modules |& tee /root/make_modules_output # just to have a record
> make modules_install
edit lilo.conf to add the new kernel, calling it 'fresh':
----
image=/usr/src/linux/arch/i386/boot/bzImage
	label=fresh
	read-only
	root=/dev/hda2
    append="mem=130496k"
----
> lilo
reboot and type 'fresh' at the lilo prompt. If it works, make the new kernel the default:
> cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.2.14-5.0_thinkpad
include it in lilo.conf:
----
image=/boot/vmlinuz-2.2.14-5.0_thinkpad
    label=linux
    read-only
    root=/dev/hda2
    append="mem=130496k"
----
rerun lilo
> lilo
Now the ability to suspend and hibernate is in the kernel. We need to be able to do it on demand. For this you need TPCTL, which requires ncurses-devel. ncurses-devel-5.0-11.i386.rpm is on the RedHat CDROM.

TPCTL utilites (for hibernation and much more)

Get Thomas Hood's tpctl ("thinkpad control") and install it in /usr/local/src:
> make all
> make install
> make clean
> ldconfig
( Somehow tpctl fails to run ldconfig after it modifies /etc/ld.so.conf)
> tpctl --help | more
Now, you have commands to
standby:    tpctl --standby
suspend:    tpctl --suspend  or apm --suspend
hibernate:  tpctl --hibernate
To allow users to suspend or hibernate the machine, all you have to do is give them write permission on /dev/thinkpad. Now you can suspend/hibernate just like in Windows by the Fn+F4 and Fn+F12 key combinations, or
> apm --suspend  # hold down blue "Fn" key to un-suspend
and
> tpctl --hibernate # turn on power switch to un-hibernate
Note that hibernate will fail reporting a BIOS error if the AC power cord is plugged in and there is a PCMCIA card in.

To make PCMCIA card come back to life after hibernation: edit /etc/sysconfig/apmd, and set PCMCIARESTART="yes". If your display tends to come back with lots of horizontal black and white lines, edit /etc/sysconfig/apmd and uncomment the line that says CHANGEVT="7"

4. Linksys PCMCIA ethernet/modem card

I have a PCMLM56. To make it work I just had to follow Thomas Hood's instructions, and modify
/etc/isapnp.gone
/etc/sysconfig/pcmcia 
/etc/pcmcia/ide.opts  
/etc/pcmcia/config.opts
Since the ethernet and modem are on the same card, ethernet (eth0) is automatically brought up when you plug in the card. This can sometimes interfere with modem connections that use PPP. I found that if I connected from home via modem & PPP to places on the network that I usually connect to from the office via ethernet, I was denied access. Running /sbin/route told me that eth0 was active even when I was doing PPP via the modem. The solution is to create /etc/ppp/ip-up.local, containing
----
/sbin/ifconfig eth0 down
----
And make it executable. This kills eth0 when PPP starts. You could create a similar /etc/ppp/ip-down.local to bring eth0 back up again when PPP disconnects.

5. Serial connection to another computer

I wanted to share files between my thinkpad and my desktop at home, without having to buy an ethernet card for the desktop. The solution is a serial port to serial port connection via a null modem cable.

To enable Thinkpad serial port:
In windows, under thinkpad config, disable the internal modem first, to let the serial port get COM1
Reboot in DOS mode and type

> ps2 ser on
> ps2 sera enable
to switch on the serial port. In linux, check that it is detected:
> setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
> tpctl -rsx
resource state:                                       current
   serial port 1:                                     enable  0x3f8 IRQ4
   serial port 2:                                     disable 0x0   IRQ0
If you get messages like these, all is well. Connect the two serial ports with the null modem cable.

To make a ppp connection over the link:
Local machine:

> stty -F /dev/ttyS0 115200
> /usr/sbin/pppd local noauth xonxoff 10.1.1.1: /dev/ttyS0 115200 &
> ifconfig ppp0 10.1.1.1 netmask 255.0.0.0
Remote machine:
> stty -F /dev/ttyS0 115200
> /usr/sbin/pppd local noauth nodetach xonxoff 10.2.2.2: /dev/ttyS0 115200 &
> ifconfig ppp0 10.2.2.2  netmask 255.0.0.0
To ssh back and forth, you will need to have installed the ssh rpm on both machines (see Miscellaneous below).

6. Sound

No need to download anything. The 2.2.14-5.0 kernel can do it.
In DOS,
> ps2 audio enable
And note down the settings that it tells you. Now follow the advice given on IBM's web page "TP 600E Guide to installing Red Hat Linux". In Linux, as root,
> /usr/sbin/sndconfig --noprobe
crystal 4332
Port:530, IRQ: 5, DMA1: 1, DMA2: 0, MPU IO: 330, MPU IRQ: 9
(those were the settings you noted down). You should hear the test sounds OK, as long as the volume is turned up [Fn+PgUp]. Create the following file, as /etc/rc.d/init.d/cs4232
----
#!/bin/bash 
# chkconfig: 345 84 16 
# description: Starts/stops the CS4232 driver at boot time and shutdown 
HOME=/etc 
case "$1" in 
start) 
echo "Starting CS4232 driver" 
rmmod cs4232 
modprobe cs4232 
;; 
stop) 
echo "Stopping CS4232 driver" 
rmmod cs4232 
;; 
restart) 
$0 stop 
$0 start 
;; 
status) 
echo "Status (NO-OP)" 
;; 
*) 
echo "Usage: cs4232 {start|stop|status|restart}"
exit 1 
esac 
 
exit 0 
----
Create some links to this file, to run it when runlevel changes:
> cd /etc/rc.d/rc3.d/ 
> ln -s /etc/rc.d/init.d/cs4232 S83cs4232
> cd /etc/rc.d/rc5.d/ 
> ln -s /etc/rc.d/init.d/cs4232 S83cs4232
Now do a reboot, and test:
> play /usr/share/sounds/info.wav
> play /usr/share/sounds/startup3.wav
Now you can listen to streaming audio on the web, via Real Player.

I still see error messages in /var/log/messages:

  kernel: ad1848: Interrupt test failed (IRQ5)  
but everything seems to be working. If sound stops working, reload the module:
> rmmod cs4232; modprobe cs4232
To make this happen automatically after hibernation, which always seems to screw up the sound, edit /etc/sysconfig/apmd, and set RESTORESOUND="yes", RESTORESOUNDPROGS="no", SOUNDMODULES="cs4232" .

7. Miscellaneous

Real Player (streaming audio from the web)

There is an RPM file made available by the generosity of Real Networks. If you try to install it you find it conflicts with /usr/share/mimelnk/audio/x-wav.kdelnk from kdebase-1.1.2-33. Move that file out of the way, and force the install
> mv /usr/share/mimelnk/audio/x-wav.kdelnk /usr/share/mimelnk/audio/x-wav.kdelnk.orig 
> rpm -ivh --force rp7_linux20_libc6_i386_cs1.rpm
Now listen to something worthwhile. Try The Connection.

Presentations using an external projector

You don't need Powerpoint to make laptop presentations. I use Latex (seminar package) and xfig to create PostScript slides. These can be displayed full-screen using gv -spartan -ad ~/gv_full.txt filename.ps where gv_full.txt is this gv options file:
----
! This file is gv_full.txt
! For filling the screen:
! gv -spartan -ad ~/gv_full.txt
GV.scale:      2
GV.minimumWidth:  1090
GV.minimumHeight: 850
GV.swapLandscape: 1
! right mouse button to move image
! CTRL downarrow  to move forward
----
You need to vary the slidewidth and slideheight lengths in Latex to get the slides to fill the screen exactly.

I had trouble getting the X-window system to produce output to the "external monitor" socket. The solution was to edit /etc/X11XF86Config and modify the device section to allow external displays:

----
# Device configured by Xconfigurator:
Section "Device"
    Identifier  "My Video Card"
    VendorName  "Unknown"
    BoardName   "Unknown"
# add this:
    Option      "extern_disp"
    Option      "intern_disp"
# end addition
    #VideoRam    2048
    # Insert Clocks lines here if appropriate
EndSection
----

Correct job scheduling with anacron

Since your system is not up most of the time, you want to have anacron controlling your job scheduling. Just follow the instructions in /usr/doc/anacron:
comment out daily, weekly, and monthly entries in /etc/crontab
in /etc/cron.daily create an executable file called anacron, containing
----
anacron -s
----
add this line to /etc/rd.d/rc.local:
----
anacron -s
----

TeX tips and tricks

Using TeX/LaTeX you can create LaTeX documents that include Japanese characters, and use LaTeX to make laptop presentations. It is helpful to set up the TeX search paths in a sensible way.

Assorted rpm files

Install rpms for ssh and other useful/updated things
go to rufus.w3.org and get the ssh rpms:
ssh-extras-1.2.26-4TL.i386.rpm
ssh-server-1.2.26-4TL.i386.rpm
ssh-1.2.26-4TL.i386.rpm
ssh-clients-1.2.26-4TL.i386.rpm          
KDE battery monitor is on Cheapbytes "packages galore" CDROM,
kcmlaptop-0.82-3.i386.rpm
Updates
gnuplot-3.7.1-5.i386.rpm
transfig-3.2.3-2.i386.rpm

HOWTO documentation

Download it from Linux Documentation project:
find the link for multiple pages, all howtos
download and untar in /usr/local/doc/HOWTO/
also get HOWTO index, save it in /usr/local/doc/HOWTO/index.html
get mini-HOWTOs, and unpack them in /usr/local/doc/HOWTO/mini/
To unpack:
mkdir /usr/local/doc/tarfiles
foreach file (`ls --color=never *.tar.gz`)
  tar zxf ${file}
  mv ${file} /usr/local/doc/tarfiles
end
foreach file (`ls --color=never *.html.gz`)
  gunzip ${file}
  mv ${file} /usr/local/doc/tarfiles
end

Altering your timezone

In /etc, look at existing file localtime. It should be a link to or copy of something in /usr/share/zoneinfo
> diff localtime /usr/share/zoneinfo/US/Eastern 
To change it:
> cp -f /usr/share/zoneinfo/Europe/London localtime
You do not want a link if /usr and / are different partitions, since localtime should work even if /usr is not mounted. You can try running tzselect to get the right zone.

Make system logs readable

> cd /var/log; chmod +r messages
On my desktop I keep a window running tail -f /var/log/messages.


Mark Alford's home page

alford(at)physics.wustl.edu

Valid HTML 4.0!

revalidate