On Thu, Apr 05, 2001 at 02:15:23AM -0600, Nate Duehr wrote: > [Of course, I have no idea if I can even help much yet which is why I > was using anonymous pserver access -- I want to get familiar with the code > first, and don't know how long that'll take. There's probably little > chance I'll be able to get this into Potato, but one never knows... > I am somewhat familiar with the boot process on the newworld ppc machines > now that I have a new iMac in my little Debian family, but wouldn't say > I'm an "expert" by any means... but might as well give it a shot. Worst > that can happen is that I'll learn something while hopefully not wasting > too much of anyone's time.] OK here is the deal with NewWorlds: they have no form of bootblock/bootsector whatsoever, so one has to be made by creating an 800K type Apple_Bootstrap partition at the start of the disk preferably (so it will be used by default instead of any present MacOS partitions). this is currently fully the users responsibility along with the rest of the partitioning. i think it would be helpful to yell at the user if they forget to create the bootstrap partition correctly, since if they don't there is no way for `make bootable from disk' can ever work. dbootstrap needs to know the following: * which partition is the bootstrap partition, i imagine this should be found by looking for a type Apple_Bootstrap partition on the disk and confirming the choice with the user. (somewhat similar to the MBR location choice in lilo) * the disk being installed on (already known) * the root partition (already known) * the partition number of the root partition (ie the 3 from /dev/hda3) * the OpenFirmware device path to the root disk. this can be found by executing `ofpath /dev/hda` at this point dbootstrap can do one of two things: 1) run mkofboot passing all of the above information to it via command line switchs/arguments. mkofboot would then generate a minimal config on the fly to be installed into the bootstrap. this config however is ironically not complete enough to be used as an /etc/yaboot.conf and is not saved on the filesystem anyway (i am open to changing this behavior) 2) generate a /target/etc/yaboot.conf and execute `mkofboot -f -C /target/etc/yaboot.conf` i tend to think the second option is more appropriate, but an alternative to that is to fix mkofboot to generate a complete yaboot.conf and have an option to save the file somewhere, say --save /target/etc/yaboot.conf. i am not terribly enthusiastic about this idea but not totally opposed to it. mkofboot when provided the above information takes care of everything required to make the disk completely bootable, it installs the yaboot bootloader, the yaboot.conf file and a auto generated OpenFirmware script into the bootstrap partition and performs all necessary witchcraft to make OpenFirmware boot it from factory settings (assuming the bootstrap partition is the first bootable candidate on the disk) additionally mkofboot will explicity set the OpenFirmware boot-device variable to the bootstrap partition guarenteeing it will be booted on the next reboot. from the above information dbootstrap needs to know here is an example /target/etc/yaboot.conf that would need to be generated: in this example bootstrap = /dev/hda2 root = /dev/hda3 boot=/dev/hda2 device=hd: partition=3 timeout=20 install=/usr/lib/yaboot/yaboot magicboot=/usr/lib/yaboot/ofboot image=/vmlinux label=linux root=/dev/hda3 read-only root=/dev/hda3 can be moved to the global section if that is preferred. note that this is only going to work on a NewWorld PowerMac, Oldworlds need quik and they need some significant witchcraft and unholy incantations shot into the OpenFirmware configuration before they will even think about booting in many cases. i think we need an entire utility written to detect the particular oldworld model and determine what OF configuration and nvramrc patches are required (these patches are unfortunatly non-free) frankly i think a `make bootable' step that works on oldworlds is a pipe dream, its unlikely to ever be all that reliable given that oldworld OF is sooooooo b0rken. the other major powerpc sub arch is the IBM machines, they have a bootstrap partition where yaboot is simply dded to it, ybin 1.0 will do this as well now. but it currently does not have ofpath support for these, or nvram reconfiguration (which may not be needed anyway) we don't even have working boot floppies for these atm anyway. anyway if you or anyone else wants to persue this that would be great, feel free to ask me any questions, i am pretty much the resident expert on PowerMac bootloaders. i am also the upstream maintainer of ybin (mkofboot and ofpath are part of ybin). -- Ethan Benson http://www.alaska.net/~erbenson/
Attachment:
pgpmOiRbNVpln.pgp
Description: PGP signature