darkness

Sunday, 24 November 2002

Catch-up (part 3: the laptops)

darkness @ 15:48:15

[You would be wise to read the previous entry to figure out what’s going on here.]

This past weekend (I think) my laptop started locking up. I can’t tell if the entire laptop is locking up, or just the screen is freezing. I think the whole thing is locking up, though. It hasn’t happened in a while, but when it was happening it happened two or three times in a row, usually after five or so minutes of being booted. It was reminiscent of my last laptop on which the backlight would go out randomly after a few minutes of being booted. I didn’t really care to troubleshoot the laptop much; it was falling apart already, with the screen splitting apart, along with numerous other things going wrong with it.

So I finally get a hold of my boss on Wednesday and tell him about my predicament. He instructs me, as I hoped he would, to just get a new laptop and put it on the corporate AmEx. When I threw the range of “$2000-$2500″ at him, though, he said something like “no, they’re not that much, Best Buy has some for like $1400 I think.” He obviously didn’t realize that those are probably shit laptops. I was looking for either a Dell, ThinkPad, or Powerbook. So I say whatever, and go searching. I really only looked at the ThinkPad T30 and the bottom of the line Powerbook 500MHz. BTW, I don’t find the Apple store intuitive to navigate, really. It doesn’t help that what people always refer to as a “tibook” is actually a titanium Powerbook. Bastards.

So I find that the Powerbook and the T30 are right in the same price range. I eventually settle on probably getting the T30. As much as I have longed for some non-x86 gear, the facts are that I know it well, I’m not sure I’ll like OS X, running Linux on one might be a huge pain, and I thought I would just generally be able to do more things that I’m used to doing on x86. I phone boss back incessantly starting at like 1655 until 1930 or something. When I toss $2300 at him, he then says “uh, let me call [my partner] and I’ll call you right back.” (I was putting such a rush on this because I was just going to overnight the thing.) He calls back a few minutes later and says something like, “There’s a Powerbook on my floor, can you just put Linux on that and use it? If not, that’s cool, we’ll just have to buy you a laptop. If so, though, we’re trying to save money to give you a big bonus at the end of the year.” “Fine,” I said to him. I went to work and picked up the Powerbook. If I don’t see a big bonus, I’m going to be potentially livid.

The Powerbook is a Powerbook G3 (I think). It’s called “Powerbook Firewire” on Apple’s site but “Powerbook Pismo” elsewhere. Apparently released in 2000, has a 500MHz processor and 128MB RAM on board (as near as I can tell), 12GB hard disk (around there; maybe 11GB or 10GB). I’ll discuss what I’ve done to this poor thing kind of out of order now.

I managed to dig up a PC100 128MB SO-DIMM at work. To put it in I first undid all the Torx (I think) screws on the bottom (I think I used a “T8″ bit? I hope that’s right) and tried to lift the bottom off. The Powerbook wasn’t having this. I took the battery and CD-ROM out too (the bay the CD-ROM goes in to is cool; I bet I can stick another battery in there too) but still no luck. Then I fished around on the web and found out that it was under the keyboard I needed to go. Indeed, instead of removing five screws or something like that, all I had to do was use my hands and push down (towards the trackpad) on two tabs between F4-F5 and F8-F9, then lift up. The ribbon cable that connects to the keyboard is pulled out from the motherboard, just tug on it, it’s apparently OK… at least, mine still works. Then you need to unscrew the two screws that are holding on the “radiation shield” which is about horizontally center and vertically (bad terms, I know) towards the top of the keyboard. Under this there is on SO-DIMM slot. When I saw the slot through the heat shield, and other pictures on the Internet, I panicked because I was sure I only had one slot, and thus needed a 256MB DIMM to increase my memory. When I took off the shield, though, I saw the empty slot and cheered. Put in the memory as usual, closed it up, turned it on, and all was well. And here I was afraid this thing would be loaded with proprietary Mac hardware of some sort.

The Powerbook originally had OS9 on it, and boy did that seem slow. I booted it up once, played around with it. Saw a program called “Airport” and ran it hoping it would tell me I had an Airport card already in here. Alas, my system is apparently only “Airport ready.” euphorik said he thinks it means the laptop has an antenna in it; I say I think it’s a marketing term which means “we have a PCMCIA slot.” (Only one BTW. Yick!)

Now I’m out on the Internet looking for Linux distributions for PPC. There’s the well-known Yellow Dog Linux, but I didn’t really want that. I was trying to grow fond of Debian, and it seemed they had a well-maintained PPC port. Plus I could do a net install, which I normally don’t like but in this case was great for instant gratification (no 650MB ISO to download). I later found that SuSE and Mandrake both have PPC distributions, but they seem like they’re not real up-to-date. Pity, that. Had Red Hat still had a PPC distribution, I probably would have used that from the start.

I used these Debian boot images for PPC. I had a bit of trouble getting the Powerbook to boot from CD-ROM at first. Holding down C at boot didn’t help, nor did some other weird combination someone told me about. I ended up getting into Open Firmware with Option+Command+O+F held down while booting, then issued boot cd:,install\powermac\yaboot as per the Debian installation manual for PPC. Yaboot, BTW, is apparently like LILO for PPC. The instructions were pretty easy and the installation pretty quick. About the only thing I can remember getting caught up on was the fact that in mac-fdisk, swap partitions have the same type as your root partition. No worries; it was eventually found in the manual.

Got it up and running, and everything seemed well. Good ole’ pretty familiar Debian. I’ll go ahead and take this time to talk about the Powerbook keyboard compared to the PC-104 keyboard you’ll find on PC laptops. The Powerbook is flat out missing some keys that I’m used to, such as insert and delete. Additionally — and I really love this one — you have to hold down the Fn key by default to get to the function keys! That’s right, hit the key marked F4, for example, and if you didn’t press Fn first, you just turn up your sound card volume. To add to this mess (for PC users) pressing something like Fn+Alt (Option)+F2 to go to VC 2 (tty2) didn’t work! I had to press the Fn immediately before the F2 key; with the Alt in the middle it didn’t work. It took me a long time to figure this out. Oh, and while I’m talking about missing things, the trackpad only has one button. Surprising? No. Irritating? Yes.

So now I apt-get install x-window-system. Everything goes reasonably well. X would like r128.o (apparently DRI kernel module for the ATI video card in here) but is happy to go on without it. I ran the server in 1024×768, though Apple’s site seems to indicate it can go higher. However, I get twm instead of Gnome or KDE right off the bat. I eventually track this down to the need to do update-alternatives --config x-session-manager and update-alternatives --config x-window-manager. (Also, check out /etc/alternatives/, though you’re not supposed to tinker with that directly AFAIK.) I have to use tasksel to get Gnome, too, which also gives me KDE. apt-get install gnome didn’t work, at least not from stable. I think.

I’ve got X running now and Gnome starts up. What? This looks quite old. No gnome-terminal? I don’t know why I want it over xterm, but… damnit. I guess I need to go to testing. I find these directions for going stable to testing, and though they talk about going from Potato to Woody (go-woody doesn’t seem to exist in Woody, unsurprisingly, but there doesn’t seem to be a go-sarge either) it still seems to work. I still can’t apt-get install gnome though. It seems I have to go to unstable for that. Fine, apt-get -t unstable install gnome spits out something, at least, indicating I have unmet dependencies. Namely, gnome-applets requires ACPI, but I don’t have that. Silly dependency. So I give it a bit of dpkg -i --force-depends and it’s installed. Note that, at the time, this somehow worked without apt-get telling me to run apt-get -f install; I couldn’t duplicate this workingness later. Now I re-run apt-get -t unstable install gnome and I’ve got Gnome! Yay!

Wait. Gnome won’t start. Oh, look: Gnome 2 is broken in Debian as of just a few days ago. Fuckers. Argh! Try KDE; find out it’s 2.2.2, which is old, and on top of that I don’t want KDE, I want Gnome. It’s not that I don’t like KDE, but that I don’t care to learn it. I want Gnome, damnit.

Combine this with some other things about Debian I wasn’t happy with, and this leaves darky out looking at other distributions. I end up downloading YDL (Yellow Dog Linux) 2.3 ISO and starting it up. Wait, what’s this? YDL 2.3 is based on Red Hat 7.2? Oh happy days!

The installer is much different, and a bit watered down I’d say. Indeed it reminds me more of the Debian installed, but graphical. Still, though it seemed to hang at times, it finishes without incident. Upon boot *gasp* it looks like Red Hat! Oh joy! (BTW, before I forget again: to boot off the YDL 2.3 CD, boot cd:,install\yaboot from Open Firmware prompt IIRC.) It’s installed all my development packages and such (which Debian did at request, too) and I’ve got X and pmud — which, BTW, is what you use on PPC instead of apmd it seems. Without pmud you’re missing stuff like trackpad and the ability to snooze by closing the cover (or at all, actually).

Rather than discuss all the trials and tribulations I’ve had getting this thing set up right, let me discuss the configuration changes I made in no particular order. PCMCIA wasn’t working right; I would get lovely messages like:

Nov 23 14:00:32 localhost kernel: cs: unable to map card memory!

As it turns out, this is because the pcmcia service wasn’t even starting. For whatever reason, /etc/sysconfig/pcmcia had PCMCIA=no in it. Now this is what my /etc/sysconfig/pcmcia looks like:

PCMCIA=yes
PCIC=i82365
PCIC_OPTS=do_scan=0
CORE_OPTS=
CARDMGR_OPTS=-f

After this I think everything started to work. BTW, RH 7.2 (or at least YDL 2.3) will let you configure wireless cards from you usual ifcfg-* scripts in /etc/sysconfig/network-scripts/. Here’s an example from my /etc/sysconfig/network-scripts/ifcfg-eth1:

NAME=darkbook
DEVICE=eth1
BOOTPROTO=dhcp
ONBOOT=no
ESSID=myessid
KEY=s:mykey

That’s like doing iwconfig eth1 essid myessid key s:mykey AFAIK. Now my card comes up at boot. I suppose you could still use the other way with pcmcia-cs schemes; I think that’s in /etc/pcmcia somewhere. Kind of requires modifying files that might be replaced in an upgrade, though, so perhaps not a good idea. On a side note, the built-in Ethernet card works out of the box on YDL 2.3. Here’s how it’s identified:

eth0: Sun GEM (PCI) 10/100/1000BaseT Ethernet 00:30:65:ab:cd:ef 

Wow, gigabit? That’s news to me. I’ve never actually checked for this before. (Note: MAC address changed to protect the guilty.)

X worked fine. Here’s my Powerbook’s /etc/X11/XF86Config-4. One of the chief problems I had through all this messing around with the Powerbook was the lack of insert and delete keys. I don’t use delete much, but I use shift-insert to paste into xterm’s (gnome-terminals — ha!) frequently. First, check out my /etc/sysconfig/mouse:

# Mouse Setup
# Run yimouse to re-configure this file
TYPE=adb
DESC="Apple Desktop Bus (ADB)"
GPM=imps2
X11=IMPS/2
DEV=/dev/input/mice
EMULATION=no
EMU_BUT2=87
EMU_BUT3=88
TRACKPAD_OPT=drag

TRACKPAD_OPT=drag allows you to tap and track with the trackpad. Apparently Mac users don’t use this, at least not by default perhaps? Weird. Further, I went out and bought a Microsoft Trackball Optical 1.0 USB which is not so bad to use (if a bit bulky, and the ball comes out real easily) so I didn’t need EMULATION=yes which was the default. By default, this makes F11 button 2 and F12 button 3 on your mouse. BTW, check out files in /proc/sys/dev/mac_hid too, but modify them permanently with the settings in /etc/sysconfig/mouse. It also seems that, as long things look at /dev/input/mice for their input, you can plug or unplug the USB trackball as much as you want and everything keeps working. I can use the trackpad and the trackball at the same time.

Now I’m on to the keyboard. showkey shows me that the console is getting distinct scan codes for just about every key on the keyboard – and the power button! However, in X, using xev shows me less distinct scan codes. I pulled apart the X server sources some (check out programs/Xserver/hw/xfree86/common/xf86KbdLnx.c) and found that the mapping of scan codes to X key codes is seemingly hard-coded. For whatever reason, though, I put Option "CustomKeycodes" in /etc/X11/XF86Config-4 and lo, I was getting more key codes, at least. I also had to comment out the Option "XkbLayout" and put in Option "XkbModel" "powerpcps2". Now I switched the Command and Option keys around, since I’m more used to hitting the key right next to the space bar for Alt. I use the enter key right near the space bar for insert, and Fn plus that enter key for delete. Note that I think the delete binding blows away keypad enter, which I never use. Here’s my ~/.Xmodmap which is loaded with xmodmap when your X session starts:

keycode 104 = Insert
keycode 109 = Delete
keycode 124 = Super_R

remove Mod1 = Alt_L Alt_R
remove Mod4 = Super_L Super_R
keysym Alt_L = Super_L
keysym Alt_R = Super_R
keysym Super_L = Alt_L
keysym Super_R = Alt_R
add Mod1 = Alt_L Alt_R
add Mod4 = Super_L Super_R

Now everything works pretty acceptably with my keyboard. Fn+6 appears to be num lock, despite the key marked Num Lock (F5) on the keyboard. That num lock key seems to actually make it so you can use the numeric keypad overlayed with the regular keyboard without hitting Fn before each keypad key. Perhaps useful, though I would never really use it unless I had an application which specifically wanted me to hit that key.

One last note about the keyboard: there is a program distributed with pmud in the contrib directory called fnset. This useful program lets you make it so you don’t have to hit Fn to use your function keys. Very, very useful, and I can’t figure out why YDL didn’t package it to begin with. Anyway, here’s my pmud SRPM with fnset. For those of you new to RPM, you can just do rpm --rebuild pmud-0.10-1b.1.src.rpm and then rpm -Uvh /usr/src/redhat/RPMS/ppc/pmud*rpm, or something to that effect. (I bet I just got someone into trouble with that.) It also appears that fnset’s changes are automatically persistent; I suspect they’re written into NVRAM or something similar. fnset -h is your friend for usage instructions.

The default desktop is KDE. I wanted Gnome, as I already said, and I kind of wanted it to be the default. Lo, /etc/sysconfig/desktop has the answers: set DESKTOP=GNOME and you’re set. I’m now running with “graphical login” which I call “runlevel 5″.

I still have some issues with sound. For starters, I want to get rid of the “startup bong” (props to Ellen) but I suspect there isn’t a way to do that in Linux. So much for quiet startups, unless I jam something in the headphone port first. My sound volume settings aren’t being persisted, either; I should probably attack them with aumix. I also haven’t tried playing, say, an MP3 on this thing; I’m just hoping it works and sounds decent. I think the port on the back marked “S Out” is actually an S-Video output. This laptop is much cooler than my Intel P3 500MHz and doesn’t seem any slower (though I was thinking it would be faster, actually; I worry the IDE hard drive/IDE controller isn’t up-to-snuff compared to my PC laptop). Plus it has a working battery. My old laptop ate batteries: supposedly if I were to put a brand new battery in it, it would destroy the battery within an hour or two. I’m not sure if, when the laptop is suspended (snoozing?) it’s still running or not. I should close the cover and try to ping or ssh in to it.

So that’s the big laptop story. Using the Powerbook is fun, but I think I’m still leaning towards an x86 for my next machine. Who knows, maybe darky will switch?

In other news, I did the install of six firewalls for our client in Columbia, SC this past Friday. I actually only got four installed; two more go in Monday. One is a DSL, so that might not be much fun. I stayed up late on Wednesday and Thursday getting the T1 firewalls ready, though, and they were absolutely beautiful: plug them in, plug in serial console, watch ‘em boot, and the line just came up. First time, no futzing with the telco or anything. Glorious. Hopefully Monday will be the same. After that I get to string ‘em together with FreeS/WAN. Then next Friday I install the other six or so in Charlotte. That’ll be easier perhaps, since at least I won’t be 1.5h from home (and civilization; not to say anything about Columbia, but more the space in between Charlotte and Columbia). Then at some point it’s back to working on my Wiki.

Oh! I got a a new bed from ardent. That is, it’s new to me. I spent $750 on bed sheets and a comforter and a duvet from Bed, Bath & Beyond. (No serial comma there, but it doesn’t look right in front of an ampersand. Plus, I think that’s how they write it, and it’s a proper noun. So nyah.) It’s a queen sized bed. We got some “100% Pima Cotton” sheets (two full sets), a synthetic down comforter, and a heavy-ass duvet to go on it. I would have liked a lighter duvet, but I wanted black and they didn’t have much besides this. They had velvet, which I figured would be an even bigger pain to take care of, so I just stuck with the heavy-ass black duvet… which still isn’t machine washable. People have speculated I overpaid, and they’re quite possibly right. I’m not terribly concerned, though; I just pushed off vacationing a bit further, which is fine with me.

I loaded five new maps onto the TFC server yesterday. I haven’t seen them yet. I’m worried non-standard maps is going to drive the average server population further down than it already has been lately.

1 Comment »

  1. I know this has nothing at all to do with the discussion at hand but I thought you might not mind my posting…
    I tried emailing you about the last discussion but it was returned..grrr.
    I have spent days looking for an extended soundtrack for DD and alas, I do believe that you may be my last hope. Please contact me if you are interested in sharing.

    Comment by bec — Saturday, 13 December 2003 @ 22:27:49

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress