LiveUSB on PPC

Requirements
Not all PPC machines will be able to boot a LiveUSB. First, a PPC machine must use Open Firmware. Second, the version of Open Firmware must support recognition of a USB disk.

Most Apple machines built from mid-2000 and newer support this, starting with the Graphite G4, slot-loading iMac, and white iBook G3. The Blue & White G3, clamshell iBook, and bondi blue / five flavors iMac and all older machines are generally unable to boot from USB.

Linux Name of USB Device
The Linux device name is neededof the USB flash drive to partition, copy the ISO... In the Terminal:

And plug in the drive. This should tell what the device name is in Linux.

Mine is but other common names are  and.

Testing if a LiveUSB will Boot
To test whether a LiveUSB will boot on the system, a direct transfer of a Linux distribution's ISO to a flash drive is least complicated. This method will use the entire flash drive and nothing else will be able to be put on it but it is good for testing.

There are several good choices of Linux distros ISOs. I used Gentoo's Minimal Install CD another good choice is the PPC Rescue CD.

Skip to Boot from Open Firmware

Manually Installing ISO
Manually creating a LiveUSB will create an additional partition that will allow files to able to written to.

Partition the Disk
Initialize the disk with "i" Enter the value the initialization discovers for the block size of the device. These commands setup the partition map but don't actually write to disk.

Changes to the disk will not be written until the write command "w" is executed and confirmed at the end of this process.

Print the partition map with "p". A partition map has already one partition (Apple_partition_map) that is necessary for the drive to be recognized. Now create a partition where the ISO will be installed.

Create the second partition to work around the minimal cd's use of HFS support via modules instead of built in.

To write the partition map and quit

Sometimes there will be glitches. If it freezes up on you (it does at times), unplug the USB flash drive and do the process again.

Format the Partitions
In Gentoo, the hfsutils package is required to format HFS. Apple's Openfirmware (which loads the live usb) only supports HFS and iso9660. As iso9660 is for CD-ROMs and is thus read-only, HFS is used here.

Format the partition where to put the ISO on:

Format the remain partition will be stoging files:

Mount the ISO and USB partition and transfer the files:

We create two (2) copies of the files due to work around the lack of built-in HFS support in the gentoo minimal cd (it needs to load a module to get hfs support). The Apple Openfirmware implimentation only supports HFS and iso9660 filesystems, while the kernel does not have HFS builtin.

It should be possible to place the 'boot' and 'etc' folders on the HFS partition and the 'livecd' and 'image.squashfs' files on the vfat filesystem, but this has not yet been tested.

Unmmount the flash drive:

Bless the System Folder
This is an archaic Mac definition but it still applies. Open Firmware looks for a file with a special attribute that defines how the system will boot. The file is called the chrp-script and all PPC ISOs have it but you may have to look for it as it can be called anything.

Define the device/partition the chrp script is on:

Define the folder with the chrp script:

Change to the chrp script directory:

Tag the chrp script and unmount:

Boot from Open Firmware
The most difficult aspect with LiveUSB is failure to get the correct yaboot installer paths for usb.

Restart the system with the LiveUSB connected and boot to the Open Firmware prompt (Apple-Alt-O-F).

Type or  and look through the device information:  Find the USB devices and find one with that appends "disk".

Example:

usb0  /pci@f2000000/usb@1/disk1

If the usb devices don't list "disk" then Open Firmware can't see it and won't be able to boot it.

Open Firmware descriptions can vary a lot depending on the computer being used.

The device can be scanned for files on a device/partition to test if it is the correct device (substitute you device here). Also try different partitions if it doesn't show them:

dir usb0/disk@1,\\:tbxi dir usb0/disk@1:,\\:tbxi dir usb0/disk@1:1,\\:tbxi dir usb0/disk@1:2,\\:tbxi dir usb0/disk:2,\\:tbxi

Next, we need to fix the 'cd' alias for use with yaboot. When you have determined your usb drive, do the following. This is an example from a G4 IMac. Note that it does not appear that using 'usb1' (for example) in place of the full disk path will work.

To boot use 'boot' followed by the device path and partition. As we have changed the devalias for cd, just do

If all goes well the LiveUSB will boot. Sometimes it will take some time before yaboot appears. Be patient.

Troubleshooting
A few tips or workarounds that can help install or boot a USB flash drive on PPC.

Open Firmware Device Name
If having trouble determining the partition or device name in Open Firmware these might help.

Look at the device tree:
may also help find USB information:

Patch ofpath
A patch has been written to (a tool used by yabootconfig to determine the boot media to automatically generate a yaboot.conf to add support for USB.

I've uploaded the patched ofpath to save time locating the older version of yaboot, patching that version, and then adding the ofpath patch.
 * patched ofpath

Thanks
Thanks guys for the tips. Sodki, in the Gentoo forums kindly pointed me in the correct direction and gave some good insight. And thanks to pxwpxd in the Ubuntu Forums his patch and detailed explanations.