[OUTDATED] Modern Debian Linux on a 1998 PowerBook G3 (Wallstreet) in 2023

NOTE: THIS GUIDE IS OUTDATED. IT WILL ONLY WORK WITH OLDER LINUX KERNELS (6.1 and earlier) WHICH ARE NO LONGER IN THE DEBIAN REPOSITORY.

I recently got out my 25 year old PowerBook G3 Wallstreet and attempted to install a period accurate Linux distribution on it for a video. This didn't work; the system froze at installing glibc and never finished installing. However, while old Linux wouldn't work on this PowerBook, there was nothing inherently about modern Linux that would make it not work. For this reason, I decided to try Debian PowerPC, a mostly unmaintained yet up-to-date version of Debian unstable for PowerPC Macs. Debian for PowerPC has gone through years-long periods where installation would fail no matter what computer you were using, but with Debian 12, it seems most of the bugs that existed in the past (e.g. boot loader installation failures) have been fixed. Despite it being mostly unmaintained, it works surprisingly well on the Wallstreet despite it being a quarter of a century old. However, getting to the point of installing Debian is a major pain, so this is a guide on how to do this. This guide might also be helpful as an outline for other OldWorld Macs, but some things will be different. 

How well does it run?

All the basic hardware, like the screen, keyboard, hard drive, etc work on Debian, with the extremely annoying exception of the CD-ROM drive. I'm not sure when this broke, but it sure doesn't work in kernel 6.4, making on-device installation impossible (without either a Cardbus USB card or a SCSI CD-ROM drive or hard drive). Sound also doesn't work. Performance is better than I expected but by no means good (it takes about 3 minutes to boot to the login prompt). 

Prerequisites

To install Debian on a PowerBook G3 Wallstreet, you'll need:

- A modern PC running Linux with qemu-system-ppc installed

- An IDE to USB adapter

- A Mac OS 9 install disc (I used the one from WinWorld)

- A large-ish IDE hard drive (I'd say 30GB minimum)

Your PowerBook should also have at least 200MB of RAM for a smooth experience. 

Installing Mac OS 9

After installing the hard drive into your PowerBook, insert your Mac OS 9 install disc into the CD-ROM drive. Hold down C after powering on to boot to the setup. If you get prompted to initialize any disks before getting to the desktop, click Cancel; we'll do this later. 

Now that you're at the desktop, there should be a Finder window with the contents of the CD-ROM. Navigate to Utilities and open Drive Setup, then select the ATA drive and click Initialize -> Custom Setup.

For the custom setup, you're going to need 4 partitions: one for Mac OS 9, one for Linux root, one for Linux swap, and one for GRUB (you won't be booting with GRUB, but the partition is required to prevent the Debian installer from complaining.) The Mac OS 9 partition should have the type "Mac OS Extended" and should be at least 500MB, but if you plan on using Mac OS at all I'd recommend going higher than that. The Linux root partition should have the type "A/UX Root" and should be at least 10GB in size, although it can be bigger or smaller depending on how much software you want to run on Linux. The swap partition should be at least 512MB in size and should have the type "A/UX Swap," and the GRUB partition should have the type "Mac OS Standard" and be at least 384MB. 

An example partition layout for a 40GB drive.  

From here, you can install Mac OS 9 as usual onto the first HFS+ partition (probably called untitled). You can add and remove components as you wish, or install an extremely minimal build of Mac OS, but in my experience doing that has prevented the CD-ROM drive from working, so I wouldn't recommend it. Once Mac OS is installed, reboot the computer into it.

Installing BootX

BootX, a Linux boot manager for OldWorld PowerPC Macs (not to be confused with BootX, the official Mac OS X boot loader for NewWorld PowerPC Macs) can be downloaded from Macintosh Garden. This can be done through the browser on your PowerBook or another computer. If you are doing this on another computer, transferring it over to the PowerBook is a pain, so I prefer to just hook up the PowerBook to Ethernet and downloading it. Once BootX is downloaded, extract the archive with Stuffit Expander, copy "BootX App" to the hard drive -> System Folder -> Control Panels, and copy "BootX Extension" to the hard drive -> System Folder -> Extensions. Once that is done, shut down your PowerBook and remove the hard drive.

Starting Debian

The easiest way to install Debian is through the use of QEMU, an emulator for various CPUs including PowerPC. Using QEMU is the fastest and easiest way to install Debian on a PowerPC Mac. Connect the hard drive to a modern PC running Linux (any distro is fine) using an IDE to USB adapter. You'll need to install QEMU (it's available in most distribution repositories, but on Debian/Ubuntu you'll also have to install the qemu-system package) and download the Debian 12 PowerPC ISO from here. Now open a terminal window and type this command:

sudo qemu-system-ppc -m 512 -hda /dev/sdX -cdrom /path/to/debian-12.0.0-powerpc-NETINST-1.iso -boot d -M mac99

Let's break down what this command does.

sudo: Required because we're writing directly to a device in /dev.
qemu-system-ppc: The emulator we're using.
-m 512: Assign 512MB of RAM to the emulated Debian system.
-hda /dev/sdX: This will be the path to the PowerBook's hard drive (you can probably figure out what the X in reality is using the lsblk command).
-cdrom /path/to/debian-12.0.0-powerpc-NETINST-1.iso: This is the path to the ISO file you downloaded earlier.
-boot d: This ensures the emulated PowerPC Mac boots from the ISO instead of the hard drive.
-M mac99: Sets the emulated machine to a 1999 Mac to prevent any issues with installing Debian.

If you did everything right, a QEMU window should appear, and you should see a (very broken) GRUB screen. 


Select "Default install" and follow the installation instructions until you get to the partitioner.

Partitioning the drive

When you get to the partition manager, select "Manual." You should see a partition layout with the first 5 to 8 partitions named "Apple", "Macintosh" or "Patch Partition", all under 1MB in size. Do not touch these partitions; they are used by Mac OS 9 to boot. After those partitions you should see an HFS+ partition named "untitled" (this is your Mac OS 9 partition), an "A/UX Root" partition, a "Swap" partition, and an HFS partition named "untitled 4".


The partitions we care about are the last 3; that is where Debian will live. You need to set the "A/UX Root" partition to an EXT4 partition with a mount point at /, the Swap partition to a swap area, and the final HFS partition to a partition with the type "Hierarchical File System" and a mount point at /boot/grub (you'll have to specify it manually). It's also very important to remember the partition number for your / partition (in this screenshot it's 7, but it'll probably be 10 for you); we'll need it later. Once your last three partitions look like the image below, finish the partitioning and follow the rest of the installation steps.

When prompted, disable both "Debian desktop environment" and XFCE; we can optionally install a desktop environment later. When the emulated system reboots, quit QEMU and mount both the Linux and Mac OS 9 partitions on your host system (them appearing might require you to unplug and replug the hard drive).

Now we need to copy the kernel and initrd files from the Debian /boot directory to the Mac OS System Folder. There will probably be 2 kernel versions in the /boot directory; pick the most recent version of both vmlinux and initrd.img. Once the two files are copied, rename the "vmlinux-<kernel version>" file to simply "vmlinux" and "initrd.img-<kernel version>" to "ramdisk.image.gz". This is done to allow BootX to autodetect these files. With that done, unmount and unplug the hard drive and insert it back into the PowerBook.

Setting up BootX

When you boot your PowerBook again, you should see the Happy Mac, followed by "Welcome to Mac OS" and a boot menu. Don't click "Linux" just yet, bad things will happen if you do. Instead, uncheck and check the "No video driver" option (it should be checked by default, but if it isn't, it should be) to stop the automatic boot timer. You now need to set up the kernel arguments for Debian.

The ATI video drivers have long had the problem where they cannot correctly autodetect the resolution and color depth of displays on OldWorld PowerPC, causing extremely corrupted images on the screen. The 12.1" Wallstreets used an 800x600 display with 32 bit color, while the 13.3" models used a 1024x768 display with 32 bit color. For the 800x600 models, add this to the kernel arguments box:

video=atyfb:vmode:10,cmode:32

For 1024x768 models, add this to the kernel arguments box:

video=atyfb:vmode:14,cmode:32

For more information on what these video modes mean, see this ancient article about PowerPC Linux.

We also need to add the root partition number to the path. Remember that number I told you to remember? You need to add the following to the kernel command line, regardless of screen size:

root=/dev/sdaX 

where X is the partition number.

Select "Options" and ensure that "Used specified RAM disk" is checked and ramdisk.image.gz is chosen. Select "Save to prefs" so that you don't have to enter the arguments every time you boot your PowerBook, and we're finally ready to boot Linux!


A bunch of logs will scroll down the screen, but eventually you should see "Welcome to Debian GNU/Linux trixie/sid!" scrolling, with systemd starting from there. A minute later, you should be at that good old fashioned login prompt. You're done!

Extras: Installing a desktop environment

On my PowerBook, I was able to get LXDE working without much hassle. I just ran:

 sudo apt install lxde xinit

and then ran startx to start the desktop. LXDE ran slowly, but it was functional right out of the box without using any xorg.conf (I think it was running on fbdev, but still!) If you do this, make sure to run sudo systemctl disable lightdm to prevent lightdm from launching every single time you load Linux.

Other desktops should work, but LXDE is faster than basically anything else. I do want to try NsCDE some day though.

Comments

  1. Very cool. I installed Wheezy and Jessie on my 266mhz Wallstreet a few years ago, as well as MintPPC based on Wheezy. I accomplished these by creating an oldworld boot CD for each distro, and had to remove the drive and copy the kernel over from another machine. I ran Openbox on all of my installs (that I obviously customized), and used an xorg.conf that the maintainer of MintPPC had put together. This was all years ago, and I remember the performance wasn't great, but wasn't too bad either.

    For fun, I later got the Ubuntu 12.04 live CD to boot using BootX, but it took a good 10 minutes to get to the desktop, and I had to use a weird kernel argument to do so. I think I posted about it on the Macrumors PowerPC forum at one point...

    ReplyDelete
  2. Is there any updated guide?

    ReplyDelete
    Replies
    1. I can't seem to find up to date information on installing Linux on OldWorld Macs online anywhere, except here.

      Delete

Post a Comment

Popular posts from this blog

Linux on a MacBook6,1 (White) - Full Documentation

My thoughts about Apple removing the charger from new devices