This is the first extensive post I will make from my old IBM Thinkpad
570e. New hostname: hooptie.
Prologue
I have decided, George Foreman-like, that I am not gonna spend
a lot on a laptop, and to that end, I bought this lappy cheap. This is
the first time in my life that I was able to get actual IBM hardware, so
I was pretty excited. Having been a little kid back in the day when
personal computers were still advertised as "IBM-compatible," IBM always
stood for hardware that was almost impossibly out of reach. Heavy-duty
clicky keyboards, thick steel cases with mottled battleship gray paint,
glowing phosphorous monochrome CRTs.
Getting hooptie up and running properly has been a bit of a
struggle.
This is a rather unconventional installation report; if
you want hard technical information, you might be disappointed. But if
you're at all interested in how Linux runs on a Thinkpad 570e in the era
after Debian Potato, well, read on, brave reader, read on.
Goals
The main goal for this project is a lightweight notebook. By
"lightweight," I mean both in terms of actual physical
mass--hooptie tips the scales at just under 2 kg when detached
from its docking station--and in terms of software setup.
This computer can and does (occasionally) run X, but I envision it as
mainly a text-mode computer. I'm reasonably comfortable operating in
the console, and with no fancy X server gobbling up system resources, I
figure I might be able to squeeze a few more seconds or minutes out of
my battery life. Moreover, I'm hoping that keeping my ugly 80-column
terminal look will deter any campus thieves.
From a purely aesthetic standpoint, running a minimal install is a
rebuke to the bling-is-king aesthetic that projects like
beryl have brought to the desktop Linux
world lately. I am going against that. This laptop is about
keepin' it real.
Preliminary Setup
For hooptie to be a useful portable, it was going to need some
sort of power management. I already knew that this series of laptops
handled power-management using APM, and that hibernation (i.e.,
suspend-to-disk), was going to require a special hibernation partition.
While there is a Free Software hibernation-partition creation utility
(tphdisk, written by the redoubtable Andrew "Tridge" Tridgell),
I hadn't had much luck with it. Instead, I wimped out and went for the
disk
image provided by IBM, which worked very well for me, as we'll see
later. This created a suitable hibernation partition at /dev/hda1.
Enter the Dapper Badger
Of course, there were a few quirks. . .
It's Not a Big Truck (or, how I get my internets)
I've been an enthusiastic
Ubuntuuser since the Warty Warthog release back in 2004. The current version
of Ubuntu, in the standard year-month version number scheme, is 6.10,
"The Edgy Eft," while the current super-stable, long-term release
version is 6.06.1, "The Dapper Drake."
Any of these will work with the Thinkpad, but because my only network
connection for this computer is a Linksys WPC-11 v.3 PCMCIA wireless LAN
adaptor, I have a bit of a problem. See, the adaptor uses the
orinoco driver, which up until recently, was probably the
best-supported wireless device driver in all of Linux. Totally Free
Software, no pesky FCC-mandated closed-source firmware, plug-and-play in
the kernel. Enough to make Stallman absolutely ecstatic, right? Except
that as far as I was able to make out, orinoco seems to be
broken in all kernel versions greater tha 2.6.12; either it doesn't
work at all (wrong modules are loaded) or it loads the right modules but
works badly (DHCLIENT fails).
Hard and Soft Options
Consequently, I was forced to go to the Ubuntu release based on a
2.6.12 kernel-- version 5.10, "The Breezy Badger," released (as you
might have guessed from the name) in October 2005.
Naturally, since I wanted the barest minimum install, I went with the
'server' install option. Once it was all over, I was left with a
gloriously bare Linux install with a perfectly running 2.6.12 kernel.
I also wanted slightly more current applications than were available
for Breezy, though. So I executed an apt-get dist-upgrade to
the Dapper, while apt-pinning the kernel. Now I had Dapper's userland
on Breezy's kernel, making my own freakish Ubuntu, "The Dapper
Badger."
I wasn't done with kernel shenanigans, yet. I wanted APM, but
Debian (thus, Ubuntu) kernels tend not to enable APM by default. So to
the default kernel options in /boot/grub/menu.lst I had to
append acpi=off apm=on.
Mr. Pogi in Userspace
Time to aptitude install me some software. In keeping with
my goals for this project, installed a number of command-line programs:
irssi for IRC, mutt for mail, slrn for
usenet. . . as well as an X server and my favorite lightweight window
manager--fluxbox. All set, right?
Run Silent, Run Deep
Not quite yet. There is the matter of getting my power management up
and running. The crucial packages to get here are laptop-mode
and apmd. apmd allows me to interact with the apm
system to learn important things like how much time I have left on my
battery. laptop-mode is a series of scripts that allow me to
spin down my hard drive and system fan in an effort to reduce power
drain. In order to take advantage of both, I had to write a little
script:
#!/bin/bash
# A spindown script. Run this as root, foo!
hdparm -S 4 /dev/hda
laptop-mode start
Executing this script as root (or with sudo) will invoke laptop-mode,
which causes the computer to run silent. . . and deep. I'm not sure how
much power it actually saves me, but it sure as hell shuts the fan up,
and gives me a much quieter computer. I am pleased.
Pimp this Hooptie!
I know. I said at the beginning that this whole project was supposed
to be an antidote to the pimp-my-desktop beryl ricer aesthetic. But
there were a few things I needed to get to first.
A Font for Sore Eyes
I have lately become a fan of the terminus font family for console
work, so I installed the relevant terminus font packages from the
repositories with aptitude. Now the problem was, how to set it?
Debian (and thus Ubuntu) keep their default console settings in
/etc/console-tools. /etc/console-tools/config deals
with global console configuration issues. The last line sets the
default console font. All I had to do was edit it and replace it with
the appropriate font name from /usr/share/consolefonts.
Easy!
Keys to the Kingdom
So much for prettification. Now on to actual useful stuff.
I'm a vim user. I'm writing this on vim right now,
as it happens. And, while the 570e has an otherwise awesome keyboard
for a laptop, its Escape key is tiny and hard to reach. I needed
something different.
To remap keys on your keyboard in Ubuntu, you have to edit
/etc/console-tools/remap
which is nothing more than a script that runs sed on the output of
dumpkeys. The example script turns the capslock key into a control
key, which doubtless will bring great joy to all you dumb terminal guys
and emacs zealots out there. *I*, however, modified it
suitably to give me the escape key that I wanted there.
The config files in /etc/console-tools are called by the
init script at /etc/init.d/console-screen.sh, so to reflect any changes, we have to
sudo /etc/init.d/console-screen.sh restart
Ubuntu Dapper, for some reason, does not run
/etc/init.d/console-screen.sh at startup. So, we have to make it do so.
I ended up adding a line to /etc/rc.local to make it load on
startup.
In X, we have to run xmodmap at start. First, we create
~/.Xmodmap, filling it with the following:
! Esc on caps lock
remove Lock = Caps_Lock
keysym Caps_Lock = Escape
Now all we have to do is run xmodmap at a
suitable time, either by calling it in .xinitrc or by otherwise
executing it before the X session gets underway. I ended up adding a
line to ~/.fluxbox/startup that ran xmodmap. Now I
have my preferred key bindings in both console and graphical
environments.
Summa Total
I'm quite pleased at how this has all turned out. The laptop is lean
and mean. Battery life (even with 'new' batteries) is a bit
underwhelming, but then the original battery benchmarks didn't take into
account the (likely considerable) current draw of a PCMCIA device with a
radio transmitter. I'm sure I could lock this down and squeeze more
milliamperes out of it (especially for train commutes) but at the
moment, things are pretty much as I want them to be.
The next step will be for me to learn how to use LaTeX more
effectively, so I can take my notes in vim and use LaTeX to produce
beautiful study guides.