Installing Debian on the Thinkpad X31

Installing Debian (testing) on my Thinkpad x31.

My X31 is the 2672-RHU model. I'm using the Lite On external USB DVD R/RW I mention on x31. This thinkpad boots off this with no problems. The install disk I'm using is Debian Netinst 3.1r1a.

Basic Installation

I hit enter at the prompt, then on the install screens I

  1. choose English
  2. United States
  3. Dvorak
  4. hostname: magnum
  5. domain: touretteskimo.com (not the real domain, but that doesn't matter)
  6. Erase entire disk: IDE1 master (hda) - 40.0 GB IC25N040ATCS04-0
  7. All files in one partition
  8. Finish partitioning and write changes to disk
  9. <Yes>
  10. Now I wait for it to install the base system. While we wait, I'll mention that I was kinda thinking about dual-booting Debian and FreeBSD, but really I'm so deep into Debian at this point and I just don't want to bother learning another distribution/operating system when it seems there are better things I could be doing with my time. (What they are, I'm still figuring out.) Also, if I really want to try something else, that's the perfect time to check out this virtualization thing everyone's been talking about.
  11. <Yes> to install the GRUB boot loader in the master boot record.
  12. Let the cd eject, hit <Continue>
  13. Watch it reboot.
  14. At the "Welcome to your new Debian system! blah blah blah" page hit <Ok>
  15. Yes to hardware clock set to GMT (even if it's not now, I'll do it later).
  16. time zone: Eastern
  17. set Root password: ******
  18. full name for the new user: Gabriel Farrell
  19. username: gsf
  20. password: ******
  21. Archive access method for apt: http (ethernet card already plugged in)
  22. United States
  23. ftp.debian.org
  24. no proxy
  25. wait for it to connect and download package lists, and install mdetect (it seems to be pausing to resolve the name -- maybe because of ipv6? okay, now it's stuck, waiting to download mdetect -- I try ^C, but it's a stubborn bastard. It gives up on mdetect and tries for read-edid. Now this is getting interesting. Can't connect to ftp.debian.org, even though it did a minute ago to download the package lists. I jump over to another virtual terminal with LeftAlt+RightArrow and ping ftp.debian.org and I get immediate pongs from debian-mirror.mirror.umn.edu. Maybe the mirror I got for mdetect and read-edid was busted. Doesn't matter, I'll be updating everything anyway.)
  26. leave nothing checked in Debian software selection -- I'll do that later
  27. wait while more core system stuff, like libc6, is downloaded and installed
  28. I get a prompt for Configuring Exim v4 (exim4-config) and select local delivery only
  29. root and postmaster mail recipient: gsf
  30. at Thank you for choosing Debian! hit <Ok>
  31. plopped down onto the terminal login, I log in and su to root (now comes the fun stuff)
  32. first thing to do is vi /etc/apt/sources.list and add matching testing lines for each line in the file, except the #deb file:///cdrom/ sarge main, which can be deleted. It's important to leave the sources pointing at stable because a few packages still reside only in stable, and upgrades are messier if you don't have that package list at your disposal. I could save myself some of these steps if I had a netinst cd for the testing distribution of Debian. I thought I had one lying around. Oh well.
  33. # aptitude, then u, U, and g. I check out everything to be upgraded, select a couple in the recommended area -- most importantly debian-archive-keyring, which will keep aptitude from thinking it's downloading unspecial packages. Hit g.
  34. Default answers to everything
  35. got errors about my locale not being set or something, and a bunch of packages didn't install (this is exciting!). Tried to do dpkg-reconfigure base-config but I was told it is broken, so I ran aptitude dist-upgrade, and had to say yes to downloading "unsafe" packages (since I haven't done an aptitude update with the new, safety-checking aptitude I just installed). Looks like everything installed okay this time. Along the way I was told to purge hotplug, so when it finished I did aptitude purge hotplug.
  36. Ran aptitude update again, and all looked good. That's the end of the basic installation. I'll work on getting everything else and configuring stuff like X and alsa and bluetooth and etc. tomorrow.

Making it Fancy

Now it's time to amp up the system and get a bunch of toys. Oh wait, but first, a couple more little things.

  1. Add blacklist ipv6 to the bottom of /etc/modprobe.d/blacklist to make the internet fast.
  2. In /etc/ssh/sshd_config change PermitRootLogin to no. This shouldn't ever really be a problem, but better safe.

Okay, on to the fun stuff. Going into aptitude again, I hit u and select the following packages for install (in the order I think of them):

  • vim (can't really live without this one)
  • linux-image-2.6-xen-686 (need to update that kernel, and I'm thinking about virtualization)
  • gpm (handy for selecting text on the console)
  • screen (can't much live without this, either)
  • xorg (for gui stuff)
  • xfce4 (ditto)
  • lynx (I'm just more used to it than w3m)
  • firefox (unfortunately, can't really live without that. No dissing firefox, it's amazing, it's design is good in a lot of ways (extensions++), but it's just such a monster. What with the web becoming Your Networked Operating System these days, I feel the need for options. I guess it's just not indie enough for me.)
  • backup2l (been using this to back up to the external and it works great)
  • cplay (the best music app I've found)
  • tpb (for the fancy osd)
  • wireless-tools (no-string-attached goodness)
  • bluez-tools (ditto)
  • xfonts-terminus (better fonts for x terminals)
  • xli (for pictures)
  • firefox-webdeveloper (that's a good one)
  • firefox-dom-inspector (another good one)
  • firefox-sage (what the hell, we'll try that too)

Okay, I'm sure I've forgotten a bunch, but that's plenty enough for now. Hit g and select a couple more from the suggested area.

  • a2ps (make sure I can print things)
  • menu (keep menus in sync in xfce)
  • python-id3 (for cplay to see id3)
  • sox (also for cplay, for wav files)
  • mpg321 (cplay, mp3)
  • sudo (need this for the gui shutdown in xfce)
  • vim-doc (I utilize the vim docs often)

Okay, hit g again and watch it go. Went with all the defaults when prompted. (Prompted for X stuff twice -- maybe because of xorg and x11-common?) (No, make that thrice. Huh.)

tpb told me to put users in the nvram group, so after I quit aptitude I addgroup gsf nvram. Now lets reboot to see what this new kernel image does for us.

Oh wait, it's not here, in the boot menu -- just the old 2.4.27 one. What did I miss? Go back into aptitude and check out linux-image-2.6-xen-686. It's installed, and so is linux-image-2.6.17-2-xen-686. Quit aptitude and lynx /usr/share/doc/ and look at the linux-image directories. Nothing there. Hmm. /boot contains the 2.6.17 files, but /boot/grub/menu.lst wasn't updated.

Looking around the web I see Joey Hess talking about the need for a Debian-specific guide for Xen and Julien Danjou talking about installing xen. My conclusion: wait on Xen and devote some days and separate posts to it later. So I installed good old

  • linux-image-2.6-686

Looks like it updated /boot/grub/menu.lst. Quit aptitude and reboot again.

And we're up. Looks good. Oh, for wireless we also need

  • ieee80211-modules-2.6-686

and I also want

  • ntp (for keeping the clock right)
  • comixcursors (the cursor theme I can't live without -- see my page on changing the mouse cursor)

Those installed without a hitch. I've noticed I keep hitting the Thinkpad back and forward buttons (by the arrow keys) to switch consoles, but they're not set up. I take a look at the thinkwiki help for setting the special keys to refresh my memory and add the following lines to /etc/console/boottime.kmap.gz:

keycode 158 = Decr_Console
keycode 159 = Incr_Console

Executing loadkeys /etc/console/boottime.kmap.gz shows it works.

While I'm at it, I'll vim ~/.Xmodmap as gsf and add

! Access IBM button
keycode 159 = XF86LaunchA
! Back button
keycode 234 = F19
! Forward button
keycode 233 = F20
! Fn button
keycode 227 = F35

Okay, let's try starting up X with startx (as gsf). Not a hitch! The display is good, we got the mouse cursor, the flashing xfce rodent, all right. First thing I do is some basic configuration. Move the clock to the upper right corner. Get rid of a couple separators and frames. For some silly reason the xterm icon is a speaker, so I'll change that. There's a bunch of other little configuration things that I do to xfce, but not worth mentioning. Easy enough to make it your own, however you want. Yay xfce. I will say I prefer the Prune style window manager and a blueish desktop. And for stuff like .Xmodmap and tpb to work you have to open a terminal and run

gsf@magnum:~$ xmodmap ~/.Xmodmap
gsf@magnum:~$ tpb -d

Oh, except tpb -d spits back

Unable to open device /dev/.static/dev/nvram: Permission denied

This happens because tpb was installed before we had moved to the new kernel and udev, so I do a aptitude reinstall tpb as root and rerun tpb -d as gsf and we're good to go. Also, open up Window Manager in the Settings Manager, hit the Keyboard tab, and change Next Workspace to the Forward button (should show up as F20 because of ~/.Xmodmap) and Previous Workspace to the Back button (F19). Um, also in Window Manager in the Advanced tab uncheck "Snap windows to screen border", "Display content of windows when resizing", and "Display content of windows when moving". The last two options are a big part of why I like xfce. It's so easy to enable wireframes for moving and resizing.

Day 3

Okay, so we've got xfce up and running and I can do most things that I like to do on my computer. I did an aptitude install subversion so I could check my articles out; now I'm editing this on the X31. Once I get markdown syntax highlighting for vim and my vimrc I get an even fuller editing experience. (More on that at the about page).

Okay, let's focus on getting it to hibernate. First thing I do is consult http://thinkwiki.org. Reading a page there called How to make ACPI work I decide to check out /boot/config-2.6.17-2-686 to see how the kernel's configured, and it looks like we've got ACPI support. I install acpid as they recommend, and get the following complaint:

Starting Advanced Configuration and Power Interface daemon: acpid: 
can't open /proc/acpi/event: Device or resource busy

I googled on that and found a thread on Powersaved complains acpid is not installed that suggested the use of lsof /proc/acpi/event. First time I've heard of lsof. Handy one, that. It told me

magnum:/home/gsf# lsof /proc/acpi/event
COMMAND    PID      USER   FD   TYPE DEVICE SIZE       NODE NAME
hald-addo 3906 haldaemon    4r   REG    0,3    0 4026532116 /proc/acpi/event

So it's a conflict with hald. But the very next google hit was Bug#380520: marked as done (acpid and hald conflict), which says it's fixed in the version of hal I've got. Hmm. Try a reboot.

Day 4

Okay, so day 3 was not so productive. We'll try to get more done today. On the reboot, acpid started up before hald, and no one complained, and now

magnum:/home/gsf# lsof /proc/acpi/event
COMMAND  PID USER   FD   TYPE DEVICE SIZE       NODE NAME
acpid   3947 root    3r   REG    0,3    0 4026532116 /proc/acpi/event

but still nothing happens when I hit the "little blue moon" suspend button. Well, not nothing. If run acpi_listen, then hit the blue moon, I get

gsf@magnum:~$ acpi_listen
button/sleep SLPB 00000080 00000009

So it hears the button, and knows what it is, but does nothing. Ah, well, there's the following line in /boot/config-2.6.17-2-686:

CONFIG_ACPI_IBM=m

So let's modprobe ibm_acpi. Hmm, no change. I'll stick it in /etc/modules anyway, just to be on the safe side. I found the acpi sleep command, echo mem > sys/power/state. It goes to sleep (little green moon lights up and all), so I know that's working. (I also did the radeonfb stuff that page suggests). I'm thinking I can put another script in /etc/acpi, but then I see the "if pidof powersaved" section at the top of /etc/acpi/powerbtn.sh, so I decide to install powersaved and see how that works. I would install tpctl, but it depends on thinkpad-source, and I don't want to build my own kernel here, having followed that path in the past and felt I was missing out on the easy upgrading involved in sticking with the stock Debian. After it's installed, I try a reboot.

Still no luck, but I notice I get complaints on tty1 about trying to suspend to disk and needing to set up a resume partition. I'm gonna fly by the seat of my pants and suspend to ram, so I edit /etc/powersave/events so that EVENT_BUTTON_SLEEP="suspend_to_ram". Now hitting the blue moon suspends to ram. Only problem is the screen stays lit, but I'll work on that another day.

Day 11

Okay, not really, but feels like it. Trying to get wireless to work, I modprobe ipw2100 and get:

FATAL: Error inserting ipw2100 (/lib/modules/2.6.17-2-686/kernel/drivers/net/
wireless/ipw2100.ko): Unknown symbol in module, or unknown parameter (see dmesg)

dmesg tells me

ipw2100: disagrees about version of symbol ieee80211_wx_get_encodeext
ipw2100: Unknown symbol ieee80211_wx_get_encodeext
ipw2100: disagrees about version of symbol ieee80211_wx_set_encode
ipw2100: Unknown symbol ieee80211_wx_set_encode
ipw2100: disagrees about version of symbol ieee80211_wx_get_encode
ipw2100: Unknown symbol ieee80211_wx_get_encode
ipw2100: disagrees about version of symbol ieee80211_txb_free
ipw2100: Unknown symbol ieee80211_txb_free
ipw2100: disagrees about version of symbol ieee80211_wx_set_encodeext
ipw2100: Unknown symbol ieee80211_wx_set_encodeext
ipw2100: disagrees about version of symbol ieee80211_wx_get_scan
ipw2100: Unknown symbol ieee80211_wx_get_scan
ipw2100: disagrees about version of symbol ieee80211_set_geo
ipw2100: Unknown symbol ieee80211_set_geo
ipw2100: disagrees about version of symbol ieee80211_rx
ipw2100: Unknown symbol ieee80211_rx
ipw2100: disagrees about version of symbol ieee80211_rx_mgt
ipw2100: Unknown symbol ieee80211_rx_mgt
ipw2100: disagrees about version of symbol free_ieee80211
ipw2100: Unknown symbol free_ieee80211
ipw2100: disagrees about version of symbol alloc_ieee80211
ipw2100: Unknown symbol alloc_ieee80211

I think maybe the xen kernel image I installed earlier might be the cause of these version disagreements, so I go into aptitude and purge

  • linux-image-2.6-xen-686
  • linux-image-2.6.17-2-xen-686
  • linux-modules-2.6.17-2-xen-686

Still getting the error, so try a reboot.

Back from reboot, still getting the error. aptitude reinstall ieee80211-modules-2.6.17-2-686. Still getting the error. Check http://bugs.debian.org/ieee80211-modules-2.6.17-2-686, looks like a similar problem there with ipw3945. Hmm, I might have to compile the kernel. Let's try aptitude remove ieee80211-modules-2.6.17-2-686 -- same problem. Reboot.

That fixed it! I can now modprobe ipw2100. So we don't need the ieee80211-modules. But the wireless still isn't functioning. This post on ipw2100 in etch suggests I might need the firmware. I'm gonna assum the driver in the kernel is after v0.55. Problem now is, where to put it so that it's loaded, used to be you put it in /lib/firmware and hotplug would just see it, but I'm not sure about udev, which has supplanted hotplug. I'll just try untarring it in there, add ipw2100 to /etc/modules, and reboot.

An lsmod shows ipw2100 is installed, but nothing shows up as wireless when I iwconfig. Not until this long-overdue point am I reminded by Debian on a T41 to check lspci, which tells me

02:02.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

Right! Now I remember why I couldn't use ipw2100 the last time around -- my X31 has the Atheros chipset, not Intel. So I think MadWifi is my only choice. Before I forget, I remove ipw2100 from /etc/modules and remove the ipw2100 firmware from /lib/firmware. By comparing Installing a WLan-Card with Atheros Chipset under Debian Linux with the MadWifi Debian pages and the MadWifi First Timer's Guide I decided to aptitude install linux-headers-2.6-686, then, as user gsf, I

gsf@magnum:~/svn$ svn checkout http://svn.madwifi.org/trunk madwifi
gsf@magnum:~/svn$ cd madwifi/
gsf@magnum:~/svn/madwifi$ make
[bunch of output, no errors]
gsf@magnum:~/svn/madwifi$ su
Password:
magnum:/home/gsf/svn/madwifi# make install
magnum:/home/gsf/svn/madwifi# modprobe ath_pci
magnum:/home/gsf/svn/madwifi# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

irda0     no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11b  ESSID:""
          Mode:Managed  Channel:0  Access Point: Not-Associated
          Bit Rate:0 kb/s   Tx-Power:0 dBm   Sensitivity=0/3
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Success! I think. I added the following to /etc/network/interfaces:

iface ath0 inet dhcp

and ifup ath0 seems to be looking for connections. There's also this:

magnum:/home/gsf/svn/madwifi# modprobe wlan_scan_sta
magnum:/home/gsf/svn/madwifi# wlanconfig ath0 list scan
SSID            BSSID              CHAN RATE  S:N   INT CAPS
dragonfly       00:0f:8f:4f:da:70    1   54M 12:0   100 EPSs WME
dragonfly       00:0f:8f:38:7a:70    6   54M 27:0   100 EPSR WME
dragonfly       00:0f:8f:4f:e0:30    6   54M 13:0   100 EPSR WME
dragonfly       02:02:6b:d1:bd:3a    5   11M 23:0   100 I
airportthru     02:fa:5a:c9:fd:a9   10   11M 18:0   100 I
dragonfly       00:0f:8f:4f:db:e0   11   54M  6:0   100 EPSR WME

So it's seeing Drexel's networks, and I've got some signal strength (under S:N). Plus, the little green radio tower is blinking. I think it's working well enough for me. Yay! Let's add ath_pci and wlan_scan_sta to /etc/modules.

A couple of quick superficial things now. As root, update-alternatives --config x-cursor-theme and select white regular theme, because I like that better, and xfce doesn't switch it via the gui mouse cursor selection settings window. Next, aptitude install gdm and at the login screen (reboot or quit X and /etc/init.d/gdm start) set to log in automatically. Then, following the steps outlined in How normal users shut down Linux, I visudo and add

gsf     ALL=(root)  NOPASSWD:/usr/sbin/xfsm-shutdown-helper

and the change is immediately visible when I click the "log out" button.

Screen blanking

Okay, so I never got around to writing this part, but the answer lies, as expected, at thinkwiki.org.

keywords: tech, Debian, GNU, Linux, IBM Thinkpad X31 created 2006-10-03 last modified 2010-09-13