Tuesday, April 18, 2006

It's Alive: Turning a rev.a 1998 iMac into a Kubuntu box

The situation: Single mom in her early 30s has a hand-me-down first-generation G3 iMac with OS X 10.1 and IE 5.2 still on it. No suitable FOSS that's compatible with 10.1.

Bad news: Oldest iMac ever (tray-loading, IR port on front, no DVD, CD-ROM only). OS X refuses to recognize a partition larger than 8Gb. Internal clock battery died years ago. The infamous round single-button mouse.

Good news: previous owner pimped drive up to 16Gb, RAM to to 512Mb and original 233MHz G3 to Sonnet Harmoni 500MHz G3 upgrade which also included FireWire. The original Apple iMac service manual is available online. Prognosis: an acceptable candidate for desktop Linux.

After backing up all the original data (which consisted of OS X, a slew of ancient Classic Adobe applications and a dog's breakfast of MP3s), it was time to figure out if the box could actually run a modern Linux distro for PPC.

PowerPC leaves you with few choices for distros, and they all divide between Debian and RedHat variants. The latter are provided by Yellow Dog Linux, and my feeling is that spending money on a port of a free x86 distro rather than RHEL is money not well spent.

The "customer" doesn't know OS X deeply and doesn't need to. The behavior she expects is that when she turns it on, the machine boots and logs in for her, no password needed. For this reason, I chose Kubuntu. Ubuntu because of its OS X-like single-user mode, and Kubuntu because KDE's behavior is a smaller learning curve for someone coming to Linux from Win/OS X. In a moment of stupidity I chose Dapper Flight 6, but later reinstalled Breezy 5.10.

Ironically, the Ubuntu PPC installers are peaches and cream compared to their liveCD counterparts which have issues with recognizing some less popular hardware. OS X's 8Gb maximum partition nonsense is a limitation of 10.1 on these iMacs, not Open Firmware, so it was a joy to let the partitioner blow away the entire HD and redo it as one large ext3 partition and a few tiny swaps. Breezy went from booting the CD to first GUI desktop login in less than 60 minutes. Realistically the only shorter install time I've had is from the install DVD and it isn't dramatically so.

Now, the real work. Since the user is not a computer expert and has no reason to become one, the interface needs to be finessed back to what she expected from OS X. KDE's defaults (and Kubuntu's) are well-intentioned, but not ideal for a switcher. What I won't be doing is theming the distro to an imitation of OS X. Nor will I try to move all the menus back to the top of the screen a la OS X's implementation of Fitts' Law. Gnome apps might comply with that setting, but many others don't, and this is a KDE installation. The other KDEisms need tweaking, though.

UI behavior. By default, Kubuntu uses single-click to open icons (as does Knoppix), and its UI leaves scrollbars with both arrows at one end (which is configurable in OS X but not usually default). These are reset.

As an experiment, I replaced KDE's use of DejaVu Sans everywhere with a generic TrueType version of Lucida Grande (OS X's system font), only to discover it looked too tiny and the letterspacing was too wide. Moreover, DejaVu Sans is the master Unicode font for Kubuntu the way Arial Unicode MS and the "real" Lucida Grande are for Win/OS X respectively. Back to DVS.

Single user mode. Into User settings, the single user was set to the default login, "no login" mode. I hear you pulling your hair out there; you can stop now. In order to change any setting or install any software, she will have to first enter her password into a dialog (a la OS X), which the other members of her household will never see. sudo without the CLI.

Real world interoperability. This reminded me; a basic desktop user really can't thumb their noses at the base Microsoft fonts if they expect to share office documents. On x86 platforms, this is usually a matter of installing the msttcorefonts package from your choice of apt manager. Enter adept, Kubuntu's alternative to synaptic. As it so happens, OpenOffice.org is smart enough to detect that you've installed the MS core fonts and quietly resets its default fonts to Times and Arial.

Media players need to be configured to permit browsers to handle embedded movies. mplayer is my weapon of choice here, and fortunately Breezy makes its installation less painful than Dapper's. A blog entry explains that an "ugly" gstream library makes it possible for rhythmbox to play MP3s and it's installed without incident.

Core apps. Regionalization was fine tuned, time servers pointed at, a network printer created and tested, and now it's time for the apps Kubuntu forgot to install: GnuCash, Gimp, Inkscape, Firefox, vlc. The Ubuntu team ships OOo with ambiguous, indistinct application icons for reasons I don't understand but assume are similar to Firefox being installed with the generic Deer Park logo. Those of you who point out that Kub has bitmap versions of the correct logos are advised to consider what happens when you put apps with those bitmaps on the Kicker and mouse over them: a grainy lo-res version appears in the tooltip. Bad marketing, no finesse.

We can fix that by getting SVG versions of those application logos. Doug Schepers redrafted the classic Jon Hicks Firefox logo in Illustrator and exported it to SVG. Downloaded and sudo mv'ed to a new /usr/share/icons/ directory, we can choose it as the K menu icon and then drop it into the Kicker. OpenOffice was a more troublesome beast: finding SVG versions of the apps logos eventually yielded a single SVG with all application icons in one document. If it weren't late at night I'd probably have found them in separate documents somewhere, but I couldn't, so I used Inkscape to split them into individual compressed SVGs and moved them to the same custom /usr/share/icons/ directory.

vlc is a more problematic beast, which surprised me considering the number of x86isms that mplayer requires and vlc doesn't, but it should be done soon. Flash is a problem because Macrodobe isn't shipping a PPC plugin for Linux yet and may never do so at this rate. Development of OSS SWF players has stagnated.

Summary: if you want to switch a user, make them comfortable first and preach FOSS later. This means the following:
  • Crap-ugly Bitstream serif fonts are a non-starter. Get fonts they're familiar with, because they'll be working with them sooner or later.
  • A basement-dweller's conception of what makes a better default UI is alienating. Single-clicks to select, double-clicks to open. If I wanted to sell GNOME, I'd install Ubuntu not Kubuntu.
  • Installers don't get everything right. Clean up font smoothing, check localization, make icons familiar. Set energy saver modes and put in a basic screen saver.
  • Install media players and hook them up to the browsers.
  • Pretest their hardware. Put in the most obscure music CD you can find and see if it plays and if the OS can guess what the title is. Repeat with DVD. Burn a data CD with K3B, then an audio CD. Check onboard microphones, IR, wireless, Bluetooth, etc.