[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Performing installer tests on PowerMac with USB sticks



Am 30.04.19 um 12:54 schrieb John Paul Adrian Glaubitz:
> Hello! I have dug out one of my iBook G4s now so I can perform
> installer tests on the PowerMac target. While the machine has a
> built-in optical drive, I would avoid having to burn CDs for every
> installation test run (even when using CD-RWs), so I was wondering how
> well booting from USB sticks works on these machines. Does anyone have
> experience creating bootable USB media for PowerMacs to install
> Debian? Adrian

Despite what others said, it should really work with every Macintosh
that has the NewWorld bootrom and thus at least Open Firmware 3.0, i.e.
starting with the iMac "Bondi" 1998 and the PowerBook G3 "Lombard" 1999.

And, it's all already written down in a nice way.[1] Don't read on when
you are happy with this official guide.

Or read this:
* http://hints.macworld.com/article.php?story=20060301112336384
* https://lists.debian.org/debian-powerpc/2012/08/msg00042.html
*
https://sites.google.com/site/shawnhcorey/howto-boot-apple-powerpcs-from-a-usb-drive-in-open-firmware


The long read: I wanted to share my own experience as well...

Apple did not provide an easy way, like holding a key for this kind of
boot selection. The possible keys are, a selection[2]:
* c – boot from CD-ROM (or any other /internal/ optical drive)
* d – forces boot from first hard disk drive (like it normally would anyway)
* n – network boot, looks for suitable BOOTP or TFTP network boot source
* r – (PowerBooks) resets stored screen size to internal default
* t – target disk mode
* mouse button held down – forces eject for media in internal optical drive
* option – shows Open Firmware boot selection

Sadly, Apple decided to include FireWire in the automatic search for
bootable volumes but to leave out USB. The capability is there
nonetheless, only that there is no key for it to press and hold, like in
easy, quick and comfortable...

The solution is to enter the Open Firmware (OF) command prompt by
holding Option + Command + O + F until you can read the Open Firmware
greeter on your monitor. Then you need to find the device and load the
boot file from there. In essence it is the manual way of what the other
options do for you automatically.


The syntax is like this:
> boot <dev>:<partition>,<file>


Examples for <dev>:
1) /pci@f4000000/ata-6@d/disk@0
2) /pci@f2000000/mac-io@17/ata-3@20000/disk@0
3) bridge/ACARD,6280M@4/@2

Only, on most Macs there are aliases for this long and complicated
device paths. So, for example, all of those above could be just:
1) hd (is set to the faster first HDD, should be the same as ultra0)
2) cd (set to internal optical drive, e.g. ide0)
3) ide0, ide1 (ATA bus)
4) ultra0, ultra1 (UltraATA bus)
5) usb0, usb1
6) ud0, ud1 – only on later PowerPC-Macs (like the Power Mac G5 or the
iMac G5, starting around 2003)

So, to replicate the boot from CD-ROM (holding the "c" key on system
start-up) from the default partition (automatic), you can use the
following from the Open Firmware prompt:
> boot cd:

To choose a specific partition, with a specific file as the initial
bootloader:
> boot cd:2,yaboot

To use the blessed bootloader on a specific parition, in this example
partition 3 from the hard disk drive:
> boot hd:3,\\:tbxi
The <file> "\\:tbxi" is not a real file, instead OF will look for the
one file that is blessed on this partition, that is the one file that
has specific attributes to it. For Mac OS X this will be bootx, for
Linux normally yaboot or grub2. To my knowledge this only works on a
partition with HFS.


So, now we want to boot from USB. First you need to identify the path of
the USB device you want to boot from. Then you need to know the
partition number. And, maybe, also the name of the bootloader (or try
:tbxi).

To find out what aliases your Mac already has defined, run the following:
> devalias

To see the full device tree without aliases:
> dev /
> ls

Other usefull commands in Open Firmware:
* lsdev
* .properties
* devalias, devalias <alias> <device-path>
* nvalias
* printenv, printenv <variable>
* set-env
* set-default <variable>
* set-defaults
* dir <devicepath or alias>:
* eject cd:
* mac-boot (will boot the standard)
* reset-nvram (same as Cmd+Opt+N+V)
* reset-all (will reboot)


If you somehow messed up your Open Firmware settings, you can always
reset/zap the NVRAM and the parameter memory (PRAM):
* Hold Cmd+Opt+P+R to zap the PRAM
* Hold Cmd+Opt+N+V to zap the NVRAM
hold the keys until you hear the startup chime. I always held the keys
until I heard the chime /again/ and /again/ 3 times in total. It's said
that it has to be done this way.


I think that on my Power Mac G5 (PowerMac11,2) from 2005 I was able to
boot from the USB drive with:
> boot ht@0,f2000000/pci@4/usb@b/disk@2:2,\\:tbxi
or
> boot ht@0/pci@4/usb@b/disk@2:2,\install\yaboot
I found some notes, this must have been last year or so.


I just tried 2019-04-24/debian-10.0-powerpc-NETINST-1.iso on my iBook G3
(original Clamshell, 1999) and it did not boot with:
> boot usb0/disk@1:2,\\:tbxi
I got "can't OPEN: cd:,\install\yaboot"
I then tried
> boot usb0/disk@1:2,\install\yaboot
and this worked.

BTW, in yaboot I get this warning:
> WARNING: Bootstrap partition type is wrong: "Apple_HFS"
>          type should be: "Apple_Bootstrap"


One more note on the USB boot front: I use one of those sticks that can
be write-protected by a physical slider on the side of the stick. WHEN
the stick is read-only, OF is unable to access it properly. Not even the
dir command works. Without write-protection everything works fine with
the same stick/same data on it.


For what it's worth, USB booting on a Power Mac is alwayy trial and
error. Write down what works. I heard that it should be possible to
define a new devalias somehow... Also, setting boot-device in nvram[4]
could make the boot selection permanent (until the PRAM is zapped or the
battery dies).

> setenv boot-device usb0/disk@1:2,\install\yaboot
Only, in the case of an external USB pen drive, I would advice against
it...But I can confirm that this also works!
> mac-boot
will then boot from the USB pen drive, as will every restart as long as
the stick remains plugged in.


Cheers,
Linux User #330250



[1]https://www.debian.org/releases/sarge/powerpc/ch05s01.html.en
[2]https://whircat.centosprime.com/startup-keys-boot-options/
[3]https://cdimage.debian.org/cdimage/ports/2019-04-24/debian-10.0-powerpc-NETINST-1.iso
[4]http://www.macfreek.nl/memory/Open_Firmware


Reply to: