This is the second part of a previous article about getting Linux installed onto an old Mac. You can read the first part here.

Inspired by the upcoming #RetroComputerWeek I had tinkered around and got my Apple IIgs connected to Dropbox. It worked but I started wondering if I could find a better way. The method I used was rather roundabout and required far too many computers.

About a month ago I rescued a couple of PowerMac 7200 computers from destruction. I thought that if I could get Linux running on one of them then maybe it could handle both LocalTalk and file serving in one. A little digging and it appeared that the latest Debian 6.0.7 squeeze supported a Mac of this era.

Well of course it wasn't going to be that easy. What I thought would be a couple of hours of installing onto supported and tested hardware turned into a challenge that took several days to complete. It's been a long time since I messed with a Mac this old, and I had forgotten just how stubborn and difficult they are to get to do what you want. Everything I tried caused the Mac to throw up another obstacle in my way.

After the first couple of days I was feeling like Hero Boy from Freakazoid. What the Mac wasn't expecting though was that I am much more stubborn than it is. In the end it was forced to submit to my will and run a modern version of Debian.

Small steps

Late Sunday I managed to figure out the install sequence to get Debian 3.0 woody to boot and run the installer. I got the hard drive partitioned the way I wanted and started doing the install. Something made it refuse to mount the install CD, even though the drive works and the CD looked fine in another computer. Instead of using the CD, I let it download everything from a Debian archive. Part way through it complained that it couldn't get a particular package and I thought I was going to have to try something else, but after retrying it got all the packages.

After getting everything on the hard drive the installer wanted me to setup the repositories. This part completely failed because apt would segfault during the step of reading the package lists. I was able to boot into it, but sources.list was empty and even if I manually added anything apt would segfault in the same place over and over. Even so, getting the Mac able to boot into a broken Debian 3.0 seemed like a small amount of success.

There was a possibility I could get to Debian 6.0 by upgrading step by step through all the in-between releases if I could somehow get apt to work. It seemed to me though that until I could get a 2.6 kernel working there wasn't much point in fighting to get apt working under Debian 3.0.

Going modern while remaining old

During all the trial and error to find out how to get Debian 3.0 to boot, I was pretty sure that the 2.6 kernel from Debian 6.0 was actually booting. If I didn't provide it with an initrd it would actually fill the console with messages and then panic because it couldn't mount a rootfs. However if I did give it an initrd, the kernel would hang trying to put the initrd into place long before it even started to boot.

I set out to see if I could build my own 2.6 kernel. I found a guide on how to cross compile a 2.6 kernel on an Intel system. After managing to get the kernel to build and copied onto the Mac, it immediately froze with a black screen. Clearly it wasn't going to be that easy.

I had to wonder how Debian did it, and after lots of searching I found the kernel config that they had used to build the kernel which I had seen sort of work. I rebuilt my kernel using their config and tried it on the Mac, and there were the console messages with a panic about not finding the rootfs! Progress!

I then started figuring out which drivers the Mac needs for the SCSI and the ethernet and had the kernel compile them in. I got it to boot and it would detect the hard disk and the partition with the previously installed Debian 3.0, but still it wouldn't mount. More looking for drivers in the kernel config and I discovered that ext2 and ext3 were modules too! I compiled them in and finally I had the Mac booted up with a 2.6 Linux kernel!

Ok, so now that I have a modern kernel, how can I get Debian 6.0 on there? I tried the apt under 3.0 and it still segfaulted. My kernel still had the same initrd problem as the Debian built one. I tried extracting the initrd and mounting it with NFS, but it caused a kernel panic because it would run out of RAM.

Then it hit me: debootstrap! I used debootstrap to create a powerpc install on the NFS server, and then booted the Mac up using that as the NFS root. I had the Mac finish the second stage, rebooted into the NFS root, and I had it up and running on Debian 6.0. I erased everything from the Debian 3.0 partition and copied everything from the NFS server onto it, rebooted and this time I was running Debian 6.0 off the HD!

After thoughts

I sort of wonder if the Mac had more than 56 megs of RAM if things might have been a little easier. But I had to work with what I had available, I'm certainly not going to drop any cash on this antique for a silly experiment that I only expect to mess around with for a short while.

For anyone who wants to reproduce what I've done, I'm providing the config I used and the kernel I built. You can download them below.