oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

iBooks Love Linux

by Edd Dumbill

It feels a bit like a homecoming. After years wandering in the cranky wilderness of mix-and-match PCs I'm working again on a computer that feels like it has a soul. The reason I feel like this? The other week I switched from an Intel-based laptop to an iBook.

However, this is a different story to the recent Mac conversions you've heard about. My day-in, day-out operating system of choice isn't Windows, it's Linux. To be precise, Debian GNU/Linux. And on my new iBook, it's still Debian. This article tells the story of why I switched to Mac hardware, and how the installation process went. It includes some handy hints and tricks I picked up along the way and, finally, my verdict on the hardware.

If you're just interested in the high level details read "The Decision" and "The Verdict." If you want the gnarly details, and some hints that might help you if you intend to run Debian on an iBook, read the whole article.

The Decision

As both a writer and programmer, my needs are pretty diverse. I spend quite a lot of time travelling to conferences, and plenty of time working from my home office, too. For the last two years, my faithful companion in these activities has been a Dell Latitude CPiA laptop. Although not especially light, it's a compact, good-looking machine. For about a year and a half I've been using it with Debian GNU/Linux as its operating system -- running the GNOME desktop gave me a good environment to work in, for both writing and programming needs. Unfortunately, the Dell developed an awkward fault causing the screen to be unusable, so it was time to look for a new machine.

I spent a lot of time looking at options for replacing the ailing machine. Small size was an important factor, as was low weight. Unfortunately, it seems that to get that these days you must also pay through the nose. As a reasonable price was also very important, this made things difficult. One of the most frustrating things about current PC hardware is that it is overfeatured. Manufacturers are endlessly pushing the latest-greatest this or that into the machines, keeping the prices high, and bundling stuff you will never need. For a Linux user latest-greatest hardware is generally a bad sign: it more than likely means something won't work quite right for you.

I was complaining about how expensive small laptops were when a friend mentioned that he thought iBooks were cool. I'd never considered this before, but headed over to the Apple site to check them out. I speced out a 12.1" screen 500 MHz iBook with the sort of features I required, and it came out at a pretty favorable price compared to the Intel-based laptops I'd been looking at. There were several particularly attractive features: the small size, the long battery life, Apple's sane approach to memory pricing.

My interest was piqued, but I was still a little skeptical. I spent some days researching whether Linux would run on iBook hardware. In particular, I was pleased to find that my current OS, Debian, ran just fine on an iBook. Eventually I was satisfied and decided to order the machine. Friends were definitely surprised.

After all, a lot of the fuss about the new Mac centers on the beauteous Mac OS X as much as anything. Did I intend to run Mac OS X? No. Isn't that a little odd? Well, umm, I guess... it just turned out to be the best and most economic decision. It seemed odd to people that buying Apple was purely a hardware-based choice.

Partitioning and Bootstrapping

It took seven days from ordering my iBook (12.1" screen, 384MB, 30GB disk, CD/DVD, Airport card) until its arrival on my doorstep. I was slightly annoyed when it came, as it arrived at 3 p.m. and we had guests that evening. A lovely new toy and I wouldn't be able to play! Nevertheless I switched the computer on that afternoon.

Before I could do anything, I had to feed the machine four "system restore" CDs, which appeared to install a complete disk image onto the hard disk. That took about 45 minutes, after which I was free to start Mac OS X. As I knew I would shortly trash and repartition the hard disk, the wait was moderately frustrating. I had chosen to proceed with a network-based install of Debian. There are two other prominent PowerPC-based Linux distributions, Yellowdog and Suse, but as I've been a Debian user for some years it made sense to continue with a system I was familiar with.

I paddled around in Mac OS X awhile, not having time to do anything more. I could see why it is winning many converts. I was slightly amused by the vacuum-suction effect when you minimized a window, but in general found the system pleasant to use. It did what I needed -- finding a network connection -- quickly and without fuss.

When our guests had gone I avoided going to bed and decided to make a start on the Debian install. The best resource for this is Branden Robinson's Installing Debian 3.0 onto an Apple iBook page. Branden's page gives instructions for installing Debian in a Debian-only, Mac OS X and Debian, or Mac OS 9, Mac OS X, and Debian configuration. I knew I didn't need Mac OS 9, but thought that it might be handy to have Mac OS X around, so I pursued the second option.

The first thing to do was repartition the hard disk. This meant junking the current setup, and booting from the Mac OS X setup CD. You can then launch the disk configuration tool from the first screen of the install process. I set up a 20GB partition for Linux, and a 10GB one for Mac OS X. The Linux partition is a placeholder -- Mac OS X tools don't know about Linux file systems, so you just set up a partition to delete later and fill it in properly. I made both partitions of type "Mac OS X Extended." Branden suggests that using UFS for the Mac OS X partition might work too, but this caused problems for me later in the install process.

Debian on an iBook
Debian on an iBook

The final step was to install Mac OS X into its new home. I reflected at this point how wonderful it was to have a full install CD for the operating system, in contrast to the current trend from PC manufacturers to give you some poxy "restore disk"-only solution. Apple should be thanked for not trying to lock you out of using alternative operating systems on its hardware.

Typical Debian installations proceed by means of a bootstrap floppy disk that loads enough to get your machine on the Net; from there you can download the rest of the operating system. The iBook has no floppy disk. Instead, there's a nifty program called yaboot. You download the image of the boot floppy onto your Mac OS X partition, then you use the machine's Open Firmware to instruct it to start up from that image. I had no idea Open Firmware existed, but it can be entered by holding down a magic key combination at boot time. It reminded me of the boot managers of Sun Sparc workstations. Doubtless there are many magical and strange things it can do, but I stuck to doing what I was told!

Once you've booted into the Debian install image, things proceed more or less as they do when installing on x86-based machines. The only real difference is in using the partition editor. Before you can install Linux you need to create a boot partition, a swap partition, and as many Linux file system partitions as you need. Under Debian PowerPC there's a specialized tool for this, mac-fdisk. As Branden notes, this is a "cruel introduction to Debian." Happily, his installation notes enabled me to sail through this process.

The second quirk is that, rather than running the normal "make operating system bootable," you must drop into the command line to configure the yaboot boot manager for your machine. The effect of installing the boot manager is to give you a short menu screen when you switch your iBook on. You can hit "l" to boot into Linux, "x" to boot into Mac OS X, and "c" to boot into a CD ROM. If you hit nothing then the machine boots into your chosen default (for me, Linux) after a few seconds.

Pages: 1, 2

Next Pagearrow