Debian Linux on an iMac G5

Abstract

Having an old iMac G5 (PowerPC, 64-bit) standing around, I decided to install Debian Linux 9 "Stretch" onto it, using a netinst image (below in chapter 5, repeated with Debian 8 Jessie, rather do that instead). The hardest part was booting the USB stick, so I documented it here.

1 Hardware

How to proceed differs a lot with the Mac computer you have, because the firmware is different. An iMac G5 with ATI 9600 graphics card is a so-called "revB, New World, OpenFirmware". The list below is how it is defined for my case:

Model name: iMac G5
Model Identifier: PowerMac8,2
Processor Name: PowerPC G5 (3.0)
Processor speed: 2 GHz, CPUs: 1, L2 cache: 512 KB, Mem: 2GB, Bus: 667Mhz
Boot ROM: 5.2.5f1
Graphics: ATY,RV351

iMac G5
iMac G5, 2004

Related: [Bastian Pöttner]

2 Burning the Install USB Stick

One might be tempted to assume that the official Debian ppc64el image is the one you want, but... it isn't. Because "el" is for "little endian" and the iMac G5 has big endian, I ended up with Paul Glaubitz and his ppc64 image ports.

I inserted the USB stick into another computer, did not unmount it, used df -h to find out that it was /dev/sdb1, then put it onto USB stick with:

dd if=debian-9.0-ppc64-NETINST-1.iso of=/dev/sdb bs=1M ; sync

Then unmounted the stick and removed it.

3 Booting the USB Stick on iMac G5

There are a lot of options for multiboot, including pressing "C" or "Option" (Alt on PC keyboards) during boot, but these did not work for me. Neither did Ctrl+Alt+P+R (Cmd+Opt+P+R on Mac keyboards) for PRAM reset. The one booting method that did work was:

Insert the USB stick in the highest USB port on the iMac (later usb0). Press and hold the power button. A loud beep will sound; hold the button. The Mac chime will sound; hold the button. Fans will get loud, hold the button. Open Firmware prompt will appear. Release the button.

Now follow the OpenFirmware command discussion. Start with listing the devices of the iMac with:

dev / ls

Search for something like /ht@0/pci@2/usb@b/disk@1 for the USB stick. The "disk" indicates that it is your stick. Now there is a nifty list of aliases, get it with:

devalias

In it, usb0 should be /ht/pci@2/@b and if you are lucky, ud is going even further, pointing straight at your USB stick at /ht@0,f2000000/pci@2/usb@b/disk@1. Now on PowerPC, there is no grub, instead yaboot ("yet another bootloader") seems to be the standard. We need to target the second partition (:2) to boot yaboot:

boot ud:2,\\yaboot 

Note: On the ISO, the nearest thing to yaboot is an /install/yaboot binary and an /etc/yaboot.conf which somehow do the right thing. Anyway, we now arrive at a Debian boot: prompt, and can finally proceed with installing.

install

4 Installing Debian

Installation is mostly harmless, just some minor annoyances:

If, upon reboot, the boot: prompt reappears, but Enter presents you with: /ht@0,f2000000/pci@3/k2-sata-root@c/@0/@0:3,boot/vmlinux: Unknown or corrupt filesystem, then you have ext4 or another unreadable file system. Otherwise, it should boot just fine.

5 Adjusting Debian

Upon first apt-get update, you learn that the source is not supported, which is ok. Looking at /etc/apt/sources.list, the trunk is sid (another word for "unstable") instead of stretch, and that is ok also.

Well, so Firefox crashes constantly, and it seems that Stretch being unsupported is no joke. So we try Jessie (8.0) from the Debian archive. Then add contrib non-free to all sources in /etc/apt/sources.list, do apt-get update and then apt-get install firmware-b43-installer for the Broadcom wireless in the iMac. Reboot.

After that, iwconfig reveals that the wlan0 interface is indeed available, and lspci confirms the Broadcom 5430 chipset. However, the standard supported is only WLAN g (unclear whether WPA2, or only WEP), so have an old router ready.

Unfortunately, Firefox also crashes under Jessie. At this point, I gave up.

Hope you are having more luck. If you get Firefox to run, please let me know under kain at the above domain. Have a nice day!

EOF (Mar:2018)