Results 1 to 10 of 16

Thread: PPC - Yaboot - How to configure the PPC Bootloader - Multibooting

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Location
    Berlin
    Beans
    784
    Distro
    Ubuntu 10.10 Maverick Meerkat

    PPC - Yaboot - How to configure the PPC Bootloader - Multibooting

    This is a short how to, in order to understand how to fix your boot problems.

    1. ofpath is a utility to determine the OpenFirmware path of a device. If you want to know the OpenFirmware path of a device, e.g. /dev/sda3, just run
    Code:
    ofpath /dev/sda3

    2. A minimal PPC-Linux Partition Table (without any MacOS) on /dev/sda looks like this
    Code:
            #                    type name                  length   base      ( size )  system
    /dev/sda1     Apple_partition_map Apple                     63 @ 1         ( 31.5k)  Partition map
    /dev/sda2         Apple_Bootstrap bootstrap               1600 @ 64        (800.0k)  NewWorld bootblock
    /dev/sda3         Apple_UNIX_SVR2 myLinux               85852160 @ 1664      ( 40.9G)  Linux native
    /dev/sda4         Apple_UNIX_SVR2 swap                 8000820 @ 202238668 (  3.8G)  Linux swap
    You can edit a partition table in Linux with mac-fdisk
    Yaboot is on the second partition, the Bootstrap Partition. Do not mount it!


    3. There are three ways to install yaboot on a Apple_Bootstrap Partition:
    ybin
    ybin is the bootloader installer for PowerPC based machines
    ybin installs the bootloader according to the parameters in /etc/yaboot.conf
    ybin uses ofpath to find the path to the bootstrap partition and to any defined macos/macosx partitions.
    mkofboot
    is a symlink to ybin, with the difference that initializes the bootstrap partition prior to running ybin to install the bootloader on it
    yabootconfig
    Yabootconfig creates a default configuration file and then runs mkofboot to complete the bootloader installation

    4. The yaboot-configuration-file
    A simple /etc/yaboot.conf in a dual-boot system with Linux and MacOSX looks like this
    Code:
    boot=/dev/sda2
    device=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@0/disk@0:
    partition=3
    root=/dev/sda3
    timeout=100
    install=/usr/lib/yaboot/yaboot
    magicboot=/usr/lib/yaboot/ofboot
    enablecdboot
    macosx=/dev/sdb3
    
    image=/boot/vmlinux
            label=Linux
            read-only
            initrd=/boot/initrd.img
    
    image=/boot/vmlinux.old
            label=old
            read-only
            initrd=/boot/initrd.img.old
    boot= the bootstrap partition
    device= openfirmware path to the root partition
    partition= number of the root partition
    root= the device name of the root partition

    timeout= Sets a timeout in seconds for keyboard input. If no key is pressed for the specified time, the first image is automatically booted.
    enablecdboot
    macosx= device name of the MacOSX partition

    There are more interesting options (for a complete list see 'man yaboot.conf') such as
    macos= device name of the MacOS9 partition
    password= to specify a password for starting the system
    defaultos= to specify from wich os the computer starts
    enableofboot
    enablenetboot


    After any changes of the yaboot.conf file, in order to make yaboot aware of the new 'situation', you need to run always
    Code:
    sudo ybin -v
    5. MULTIBOOTING
    For any other Linux-OS you install, the yaboot installer specifies in the yaboot.conf file following parameters:
    Code:
    image=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@0/disk@0:4,/boot/vmlinux
        label=sda4-Linux
        root=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@0/disk@0:4
        append="root=/dev/sda4 ro quiet splash"
        initrd=/ht@0,f2000000/pci@7/k2-sata-root@c/k2-sata@0/disk@0:4,/boot/initrd.img
    image= the openfirmware path to the kernel-image (or to its symlink)
    label= the name of the Linux kernel to display at the second yaboot prompt
    root= the openfirmware path to the root partition
    append= any options to pass to the kernel before starting
    initrd= the openfirmware path to initrd

    When you start the computer, at the yaboot prompt, you can choose which OS you want to boot from (Linux, MacOSX, MacOS) or if you want to boot from a CD (if in yaboot.conf there is the option enablecdboot). After you choose to start from Linux, if you hit TAB, you will find a list of the different Linux-Kernels for each installed Linux Distro. With the option 'label' in the list above, you can specify the name for each of them.

    Usually you do not need to configure your yaboot.conf file. But it can happens, that the Linux Installer fails to detect other Linux Distros installed on the computer (for me, by installing Fedora 10, the installer did not detect my Debian and Ubuntu partitions).
    Since I never had a problem with the Debian Installer, if I want to install different Linux Distros, I run Debian after the Installation of the others - it detectes the other MacOS or LinuxOS's always correctly.


    6. In Ubuntu Hardy (8.04) ofpath fails to detect the correct openfirmware path in some PowerMac g5
    The problems for some PowerMac G5 come from the ofpath utility, because it fails sometimes to find the right openfirmware path (sometimes, not always: on my PowerMac G5 it works well).
    Even if you set in the /etc/yaboot.conf the right Open Firmware path, yaboot will not work correctly, because ybin and mkofboot need to run again ofpath (that is buggy)

    SOLUTION
    There is a fix for the ofpath, that you can download here:
    https://bugs.launchpad.net/ubuntu/+s...ot/+bug/122607
    (It was fixed in Ubuntu Intrepid 8.10 - thanks to PeterXw!)

    If you download the ofpath.gz on your Desktop run
    Code:
    zcat Desktop/ofpath.gz > Desktop/ofpath
    To overwrite the buggy utility with the fixed one just
    Code:
    sudo cp Desktop/ofpath /usr/sbin/ofpath
    Now you can test if you get the right Open Firmware Path
    Code:
    ofpath /dev/sda2
    You can now just run
    Code:
    sudo yabootconfig -b /dev/sda2 -r /dev/sda3
    The -b option specifies where the bootloader is, the -r option is the 'root' device.
    Change the bootloader and the root devices according to your Partition Map (actually you shouldn't need to specify the root device)
    Say yes, when you are asked, if you want to run mkofboot


    ·······
    USEFUL LINK
    http://www.alaska.net/~erbenson/

    ·······
    I hope I was quite clear (sorry, but english is not my first language). Feel free to suggest any corrections.
    Last edited by tiresia; May 17th, 2009 at 10:22 AM.
    PowerMac G5 Debian Squeeze - MacOSX Leopard / Lenovo 3000 N200 Debian Wheezy
    PowerPCFAQ, PowerPCKnownIssues, Booting the Installer on PowerPC, Yaboot - How to configure the PPC Bootloader

  2. #2
    pxwpxw's Avatar
    pxwpxw is offline Chocolate Ubuntu Mocha Blend
    Join Date
    Apr 2006
    Beans
    Hidden!
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: PPC - Yaboot - How to configure the PPC Bootloader - Multibooting

    I updated the launchpad entry with the ofpath.gz (previous attachment was full text script)

    I think it will need chmod +x to make executable ofpath.

    The Intrepid version yaboot package with the fixed ofpath is
    $ dpkg -l yaboot
    yaboot 1.3.13a-1ubuntu5 Yet Another Bootloader

    Attached is yet another gzipped copy of that ofpath.
    Attached Files Attached Files
    Last edited by pxwpxw; November 28th, 2008 at 01:35 PM.

  3. #3
    Join Date
    May 2008
    Location
    Peterborough, Ontario
    Beans
    190
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: PPC - Yaboot - How to configure the PPC Bootloader - Multibooting

    Very useful information, tiresia; thanks for posting this. I discovered on my own that not every distro does a proper job of configuring the yaboot menu, but Ubuntu and Debian do. Here's a question - what is /dev/sda1?

  4. #4
    Join Date
    Jun 2008
    Location
    Berlin
    Beans
    784
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: PPC - Yaboot - How to configure the PPC Bootloader - Multibooting

    In my example /dev/sda1 is the Apple Partition Map.
    Here some informations:
    http://en.wikipedia.org/wiki/Apple_Partition_Map
    http://developer.apple.com/technotes/tn2006/tn2166.html
    PowerMac G5 Debian Squeeze - MacOSX Leopard / Lenovo 3000 N200 Debian Wheezy
    PowerPCFAQ, PowerPCKnownIssues, Booting the Installer on PowerPC, Yaboot - How to configure the PPC Bootloader

  5. #5
    Join Date
    Nov 2008
    Beans
    14

    Re: PPC - Yaboot - How to configure the PPC Bootloader - Multibooting

    Man, if only I found this when I was still dual-booting my PowerBook G4... If I reinstall Ubuntu I'll use it! Thanks! Although, isn't sda for Macintel, and hda powerpc? My AlBook G4's partitions are called hda...

  6. #6
    Join Date
    Jun 2008
    Location
    Berlin
    Beans
    784
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: PPC - Yaboot - How to configure the PPC Bootloader - Multibooting

    Quote Originally Posted by concorde106 View Post
    Although, isn't sda for Macintel, and hda powerpc? My AlBook G4's partitions are called hda...
    No, sda (sdb,sdc, ...) refers to SCSI, Serial-ATA and USB Devices, while hda (hdb, hdc, ...) refers to IDE Devices. For a FloppyDisk you have /dev/fd.

    In your PowerBook g4 you have IDE-Disks, therefore your device is /dev/hda

    http://en.wikipedia.org/wiki/Device_...ng_conventions
    PowerMac G5 Debian Squeeze - MacOSX Leopard / Lenovo 3000 N200 Debian Wheezy
    PowerPCFAQ, PowerPCKnownIssues, Booting the Installer on PowerPC, Yaboot - How to configure the PPC Bootloader

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •