Home Wiki > SDB:Install openSUSE on an Apple PPC computer
Sign up | Login

SDB:Install openSUSE on an Apple PPC computer

tagline: From openSUSE

Installation of openSUSE Factory to Apple PPC/PowerPC machines.

Tested

  • XServe G5, PPC970fx 2×2.3 GHz, 3 SATA diskbays & 1 CD-ROM.

It seems that the XServe G5 SATA controller does not like disks with 4K sector size. A practical test has shown that a Western Digital WD5000BPVT is rejected; the drive bay blinks the blue LED. A WD5000BEVT (with 512b sectors) is accepted, however. Both 2.5-inch and 3.5-inch disks are acceptable.

Serial console

When no keyboard is attached, the OpenFirmware prompt will automatically be redirected to the serial console. The G5 OFW (and possibly other Apple models) operate the serial port using 57600,8n1.

yaboot will output to the VGA card only.

Linux's fbcon will also replicate console messages on VGA, if available.

The serial port, should you choose to somehow make use of it, is /dev/ttyPZ0. Keep in mind that if nothing else is specified (e.g. console=ttyPZ0,57600 boot parameter), Linux's boot phase will set it to 9600.

Boot from CD-ROM

The Apple XServe G5 usually ships with a CD drive, so no DVD. Grab a netinstall image at http://powerpc.opensuse.org/ports/ppc/tumbleweed/iso/ .

From the OpenFirmware prompt, issue `boot cd:\boot\ppc64\grub2-ieee1275\core.elf` to start (with recent openSUSE) or with path to yaboot with older releases. Simply booting from the CD without specifying the path, as is the case when using `boot cd`, or the front panel keys or the keyboard (Option_key+C), may not work.

If you want to get your CD out again, you can use `eject cd` at the OFW prompt. (Observed: There seemed to have been a lack of the CD-ROM driver in openSUSE 11.3 — the PPC images featuring kernel 3.x have the pata_macio module and load it, and the drive is usable.)

Boot from Network

Prepare a typical TFTP server environment, and make the following files from the ISO image available in the tftp directory: yaboot, yaboot.cnf, yaboot.conf (hardlink to yaboot.cnf), yaboot.ibm, yaboot.txt. Pick yaboot as the file to execute.

subnet ... {
    ...
    filename "/yaboot";
}

At the OFW prompt, issue `boot enet:0,yaboot`.

There is a limitation with the Apple firmware — it only supports downloading images from the network up to a certain size (reports say around 6 MB). Sun SPARC firmware has a similar limitation (10 MB there), which means images larger than this cannot be downloaded using the OFW primitives that the bootloaders (yaboot, SILO on sparc) are using.

Suggested alternative: prepare the hard disk with an MSDOS partition table (easiest) and an ext2 partition (yaboot can read this) containing the installation kernel.
(Details to be added).

linuxrc

Despite a potential VGA card, linuxrc will not start in ncurses mode, but fallback to the (even lighter) serial CLI-style prompt. Live with it :-)

The location for powerpc is http://download.opensuse.org/ports/ppc/factory/repo/oss . No ftp.

Partitioning

By default, yast will propose to make an MS-DOS partition table, which may work for IBM PPC, but not so for Apple PPC. You will need to manually do partitioning using the pdisk(8) utility, available from the rescue system or the install system (i.e. another local VGA VT while yast is running showing you the license screen). You can do that anytime you find yourself a shell prompt.

N.B.: It seems that pdisk(8) is not exactly the same as mac-fdisk(8), based upon the observation that, for example, pdisk does not have a "b" command to create a bootstrap partition automatically.

134:~ # pdisk /dev/sda
Edit /dev/sda -
Command (? for help): i
((do you want to reinit? [n/y]: y))
Command (? for help): p

Partition map (with 512 byte blocks) on '/dev/sda'
 #:                type name        length   base      ( size )
 1: Apple_partition_map 'Apple '        63 @ 1        
 2:          Apple_Free 'Extra ' 312581744 @ 64        (149.1G)

Device block size=512, Number of Blocks=312581808 (149.1G)
DeviceType=0x0, DeviceId=0x0

Create the new table using "i". Get an overview with "p". The base and length numbers are in units of 512 byte blocks. Unlike x86, the partition table itself is counted as a partition entry, as is the free trailing space.

The Apple boot process requires a bootstrap partition, which is commonly given 800 KB in size, but for rounding fun and much-sought 4096-byte alignment these days, I will just pick 1 megabyte (= 2048 blocks).

Command (? for help): C
First block: 2P  (equivalent to 64)
Length in blocks: 2048
Name of partition: bootstrap
Type of partition: Apple_Bootstrap
Command (? for help): p

Partition map (with 512 byte blocks) on '/dev/sda'
 #:                type name           length   base      ( size )
 1: Apple_partition_map 'Apple    '        63 @ 1        
 2:     Apple_Bootstrap 'bootstrap'      2048 @ 64        (  1.0M)
 3:          Apple_Free 'Extra    ' 312579696 @ 2112      (149.0G)

Device block size=512, Number of Blocks=312581808 (149.1G)
DeviceType=0x0, DeviceId=0x0

The notion "2P" means to take the start of the 2nd partition (which is block 64 at this point), and nP may be used for further entries. The name is freely choosable, but the type must be "Apple_Bootstrap".

Next you will need(?) a ext2 partition, because yaboot can only read certain filesystems.

Command (? for help): C
First block: 3P
Length in blocks: 327680
Name of partition: boot
Type of partition: Linux

The size of 160 MB has proved itself to be a good choice, as it has enough room to store a few kernels, plus the openSUSE netboot initrd files (your way to a rescue system when there is no CD and no TFTP server around).

Command (? for help): C
First block: 4P
Length in blocks: 262144
Name of partition: swap
Type of partition: Linux_Swap

Swap if you need it (or maybe not), and finally, our root volume, for which we will have to look at the length column for the free space to figure out how large it can be, since "Length in blocks" is not smart enough to take "max" or so for an answer.

Command (? for help): p

Partition map (with 512 byte blocks) on '/dev/sda'
 #:                type name        length   base      ( size )
 1: Apple_partition_map 'Apple '        63 @ 1        
 2:     Apple_Bootstrap 'bs    '      2048 @ 64        (  1.0M)
 3:               Linux 'boot  '    327680 @ 2112      (160.0M)
 4:          Linux_Swap 'swap  '    262144 @ 329792    (128.0M)
 5:          Apple_Free 'Extra ' 311989872 @ 591936    (148.8G)

Device block size=512, Number of Blocks=312581808 (149.1G)
DeviceType=0x0, DeviceId=0x0

Command (? for help): C
First block: 5P
Length in blocks: 311989872
Name of partition: root
Type of partition: Linux

Now, complete yast as usual, until you get to the "Suggested Partitioning" dialog. This will likely propose to remove some partitions and add others - ignore it. Choose to edit the partition setup instead. The Expert Partitioner dialog coming up will initially show nonsensical partitions and sizes (sda is not 1 GB but 160 GB, where's sda5's size, sda6 and sda7 don't even exist).

Available Storage on g5.site
┌────────────────────────────────────────────────────┐
│Device   │     Size│F│    Enc     │Type            ││
│/dev/sda │  1.05 GB│ │            │HITACHI-HDS7216S││
│/dev/sda2│  1.00 MB│ │            │Apple_HFS       ││
│/dev/sda3│160.00 MB│ │            │Linux native    ││
│/dev/sda4│128.00 MB│ │            │Linux swap      ││
│/dev/sda5│        F│ │ Linux swap │Swap            ││
│/dev/sda6│  1.31 MB│F│            │Linux native    ││
│/dev/sda7│        F│ │Linux native│Ext4            ││
└├────────────────────────────────┤──────────────────┘
[Rescan Devices[Import Mount Points...][Configure...↓]

Choose "Rescan Devices" now, such that the Expert Partitioner forgets about the formatting proposal entirely and so, will leave the partition table alone. The sda and sda5 sizes are still nonsense, but at least it got the numbers right. Formatting (aka mkfs) the partitions itself poses no issue — that which had to be done outside yast we already did.

Available Storage on g5.site
┌────────────────────────────────────────────────────┐
│Device   │     Size│F│Enc│Type            │FS Type│L│
│/dev/sda │  1.05 GB│ │   │HITACHI-HDS7216S│       │ │
│/dev/sda2│  1.00 MB│ │   │Apple_HFS       │       │ │
│/dev/sda3│160.00 MB│ │   │Linux native    │       │ │
│/dev/sda4│128.00 MB│ │   │Linux swap      │       │ │
│/dev/sda5│786.80 MB│ │   │Linux native    │       │ │
└├────────────────────────────────┤──────────────────┘

From here, edit sda3, sda4 and sda5 as usual, that is, call "Edit" on these items. For sda3, format with ext2 and assign to mountpoint /boot. sda4 will be my swap, and sda5 be ext4 (or btrfs if you like) for /. Finally, accept and exit from the Expert Partitioner dialog and return to Suggested Partitioning, which should now look like

Suggested Partitioning                           
 ┌──────────────────────────────────────────────────────────────┐
 │ *  Format partition /dev/sda3 (160.00 MB) for /boot with ext2│
 │ *  Format partition /dev/sda4 (128.00 MB) for swap           │
 │ *  Format partition /dev/sda5 (148.77 GB) for / with ext4    │
 │                                                              │
 └──────────────────────────────────────────────────────────────┘

It seems it got 148 GB right at least this time.

Proceed with the installation as usual.

yaboot

In our scenario, /dev/sda2 will be formatted with HFS, and it is on this partition that yaboot will be placed. The Apple OFW can only read a few filesystems, so the bootloader needs to be on one that it understands. (It is not known to us whether the Apple OFW would support booting off an MBR post-partition bootstrap code like on x86 and SPARC.) Since yaboot itself only knows a handful of filesystems, /boot, too, may be required to be its own partition — in cases like where / is a btrfs.

Curious trivia: /etc/lilo.conf is the authoritative copy of boot entries. The "lilo" utility is afterwards used to update yaboot in the HFS partition, the latter of which probably should not be mounted during that time, or even in general.

grub =

Since around Leap openSUSE uses grub instead of lilo emulation on top of yaboot. All the same yaboot stuff applies except grub itself can understand pretty much any filesystem once you get it to load.