[GTALUG] Linux on ppc64 (G5) - distro support

Mike el.fontanero at gmail.com
Mon Dec 10 13:11:43 EST 2018

On 12/10/18, Stewart C. Russell via talk <talk at gtalug.org> wrote:
> On 2018-12-06 10:35 a.m., William Porquet wrote:
>> I have a similar boat-anchor Mac G5. Lubuntu PPC works quite well on it.
>> I can't upgrade from 16 to 18 yet, doesn't seem to be supported or the
>> distro isn't ripe yet.
> Good to know, thanks. I've installed Lubuntu 16.04 as powerpc64, but I
> can't get past yaboot. I hold Option (⌥) when powering up to get to the
> boot selection screen, choose the Linux HD (it even has a tiny
> penguin!), pick 'l' from yaboot … and I'm back at the boot selection
> screen again. Continue until patience runs out.
> Do you use the OpenFirmware boot? Did you stick with 32 bit?

I spent some quality time with OpenFirmware (a.k.a. OF) / yaboot /
debian on the G5.  Here are a few hopefully useful tidbits.

- /etc/yaboot.conf contains instructions to *both* linux "yabin" and
to yaboot itself.
- ybin is run under linux and takes *some* of the config items from
yaboot.conf and generates a script that OF runs, called ofboot.b.  It
also creates and populates a boot partition on the target disk.
- The rest of yaboot.conf, including kernel "image" specs, is used by
yaboot itself during boot.
- yaboot is executed *by* OF.

The approach I've taken is to allow the debian jessie installation to
generate a half-assed (= almost, but not totally broken) yaboot.conf,
but also useful  Apple_Bootstrap partition containing ofboot.b,
yaboot.conf, and yaboot.  I then experimented with modifying ofboot.b
and yaboot.conf *directly* on the HFS partition.  For example, this is
a typical sequence of update events:

# hmount /dev/sda2
# hls -l
# hcopy ./yaboot.conf bootstrap:yaboot.conf
# hattrib -t conf bootstrap:yaboot.conf
# hcopy ./ofboot.b bootstrap:ofboot.b
# hattrib -t tbxi bootstrap:ofboot.b
# hls -l
# humount /dev/sda2

Here are some salient fragments of the configurations I needed to poke
to make my setup work.  My original OSX is on /dev/sda3, and my Linux
distro is on /dev/sdb3.

In ofboot.b:

: .printf fb8-write drop ;
: bootyaboot " Loading second stage bootstrap..." .printf 100 ms
load-base release-load-area "
/ht at 0,f2000000/pci at 9/k2-sata-root at c/@ffffffffffffffff/@0:2,\\yaboot"
$boot ;
: bootmacosx " Booting MacOSX..." .printf 100 ms load-base
release-load-area "
/ht at 0,f2000000/pci at 9/k2-sata-root at c/@ffffffffffffffff/@0:3,\\:tbxi"
$boot ;
" screen" output

Note the horrible
"/ht at 0,f2000000/pci at 9/k2-sata-root at c/@ffffffffffffffff/@0:2,\\yaboot"
specification.  This is OF for "/dev/sda2", which is where my config
and yaboot reside.  This script, run by OF, tells OF that yaboot can
be booted from /dev/sda2, and that OSX can be booted directly from

Next, yaboot.conf:

# The device spec of the second hard disk (B, or the bottom slot)
device=/ht at 0,f2000000/pci at 9/k2-sata-root at c/k2-sata at 1/disk at 0
root="UUID=uuid of your root partition"



Note that if your linux partition is on the first hard disk, your
device spec would be:
device=/ht at 0,f2000000/pci at 9/k2-sata-root at c/k2-sata at 0/disk at 0
partition=<your linux root fs partition number>

I hope this isn't too scattered - Take a look at your own installation
(mac-fdisk -l /dev/sda etc.) and your installed ofboot.b and
yaboot.conf in light of the above. Ping back if you get stuck.


More information about the talk mailing list