SDB:Install openSUSE on an Apple PPC computer

Jump to: navigation, search

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://download.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 USB stick

A PowerMac G5 will be able to boot off an USB stick. Just make sure to format/delete it using Apple Partition Map and then use a tool like BalenaEtcher to flash a install image onto it.

From the OpenFirmware prompt, issue `boot ud:\boot\ppc64\grub2-ieee1275\core.elf` (instead of cd) to start (with recent openSUSE) or with path to yaboot with older releases.

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).

Personal experience by Letterus: As of Tumbleweed snapshot 20210105 I am stuck at this point, because parted/the kernel (?) are not able to read the Apple Partition Map (anymore). I get an error and no partitions are displayed at all. It is said the last PowerMac G5 do support GPT/GUID partition tables, but letting Yast create a GPT layout did not work for me.

It seems this issue is tracked over there: https://bugzilla.suse.com/show_bug.cgi?id=1079435 End of note.

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.

NVidia GeForce 6600

If your PowerMac G5 uses a GeForce6600 your screen will fade after showing the "udev" boot message while booting up installation. Graphics drivers are not load correctly at that time. Disable modeset to fix this for installing the system. At the bootscreen of grub hit 'e' to edit the boot configuration and add the following at the end of the linux/kernel line:

 nomodeset i915.modeset=0 nouveau.modeset=0

As this is a NVidia card only using "nomodeset" will not work. You will need to set nouveau as well at least. Use ctrl-x to boot the configuration.