Search:  
Gentoo Wiki

LiveUSB_on_PPC

Creating a LiveUSB is a good alternate method to creating a LiveCD. A LiveUSB, like a LiveCD, is good for booting a temporary OS to do system maintenance, install a new operating system...

Note: I use a model (original iBook) that cannot boot a usb disk (see requirements below), but I did a good amount of research and this should work. Please fix what needs to be and REMOVE this warning if this guide works.

Contents

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.

Linux Name of USB Device

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

tail -f /var/logs/messages

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

Mine is /dev/uba but other common names are {commandline|/dev/hda}} and /dev/sda.

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.

dd if=name.iso of=/dev/uba

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

mac-fdisk /dev/uba

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.

C               # create a new partition with type
2p              # second partition
60M             # size of partition, check the ISO size
GentooMinUSB    # name of the partition
Apple_HFS       # partition type

Extra - The rest of the space can be used to store files on.

c               # create a new partition without specifying type
3p              # third partition
3p              # uses remaining free space.
Data            # name of partition

To write the partition map and quit

w
q

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.

Note: The partition needs to be a HFS filesystem!? Both guides I saw were formatting as such. See [ /#References References]

Format the partition where to put the ISO on:

hformat -l LiveUSB /dev/uba2

Format the remain partition will be stoging files:

mkfs.ext3 /dev/uba3

Mount the ISO and USB partition and transfer the files:

mkdir /media/LiveUSB
mount -t hfs /dev/uba2 /media/LiveUSB
mkdir /media/ISO
mount -t iso9660 -o loop,ro name.iso /media/ISO
cp -a /media/ISO/* /media/usbstick

Unmmount the flash drive:

umount /media/LiveUSB

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 ISO's 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:

hmount /dev/uba2

Define the folder with the chrp script:

hattrib -b :boot

Change to the chrp script directory:

hcd boot

Tag the chrp script and unmount:

hattrib -c UNIX -t tbxi :ofboot.b
humount

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 devalias or dev / ls and look through the device information: Find the USB devices and find one with that appends "disk".

e.g.

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

To boot use boot followed by the device path and partition. Again use the partition discovered from above.

boot usb0/disk@1,\\:tbxi

Also the full string can be used, though the generic name (usb0, usb1...) should do.

boot /pci@f2000000/usb@18/disk1:1,\\:tbxi

If all goes well the LiveUSB will boot.

Boot Strings That Have Worked

Please state the computer and model and the boot string that works:

Name - Model

boot usb0/disk@1:1,\\:tbxi

PowerMac G4 - Sawtooth 450MHz

boot /pci@f2000000/@d/usb@8/disk@1:2,\yaboot\yaboot

Troubleshooting

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

Open Firmware Devive Name

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

Look at the device tree:

find /proc/device-tree -name name | grep usb

lshw may also help find USB information:

sudo lshw

Patch ofpath

A patch has been written to ofpath (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.

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.

References

Retrieved from "http://www.gentoo-wiki.info/LiveUSB_on_PPC"

Last modified: Fri, 26 Sep 2008 04:50:00 +0000 Hits: 1,610