Page 1 of 2 12 LastLast
Results 1 to 10 of 16

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

  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
    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

  7. #7
    Join Date
    May 2008
    Beans
    7

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

    I have a dual boot iBook G3 with Hardy one hda3 and Intrepid on hda4. I would like for Intrepid to be the default partition, so do I just add to my yaboot.conf file "default=hda4-Linux"? Secondly, I installed Hardy after Intrepid on hda3 and its yaboot.conf file makes note of the hda4 partion, to add my default option to the file do I add it to the yaboot.conf located on hda3, or does it matter? Lastly, i prefer the Hardy splash screen to Intrepid bc in Intrepid the colors are all wonky but they are fine in Hardy (the correct orange/red/yellow logo with orange progress bar). Is it possible to somehow copy the Hardy splash screen to the Intrepid partion? What file should I look for and what all involves in changing that? Sorry for all the questions.

  8. #8
    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 MemphisJones View Post
    I have a dual boot iBook G3 with Hardy one hda3 and Intrepid on hda4. I would like for Intrepid to be the default partition, so do I just add to my yaboot.conf file "default=hda4-Linux"?
    Secondly, I installed Hardy after Intrepid on hda3 and its yaboot.conf file makes note of the hda4 partion, to add my default option to the file do I add it to the yaboot.conf located on hda3, or does it matter?
    First of all: backup you yaboot.conf
    Code:
    sudo cp /etc/yaboot.conf /etc/yaboot.conf.bak
    The file /etc/yaboot.conf is not a configuration file for yaboot but for ybin. According to the parameters in that file, ybin installs yaboot on /dev/hda2. Therefore doesn't really matter, if /etc/yaboot.conf is on /dev/hda3 or /dev/hda4

    The option 'defaultos=' (please, notice it's defaultos not default) is usually used to specify an OS other that Linux (macos, macosx, bsd). If it is not specified yaboot will boot a Linux Kernel (after a time delay as in timeout).
    At the second step, if you hit TAB, yaboot lists the names of the Linux Kernel on your computer, the first being the 'default' Kernel on the partition shown in 'partition='

    Anyway, in your case, if you add 'defaultos=sda4-linux', it won't work, becaus 'sda4-Linux' is just a label, a name for the Linux Kernel, it is not the partition nor the root of that Kernel.

    The easiest solution for you is just to boot in Intrepid (/dev/hda4) and run
    Code:
    sudo yabootconfig
    It will set Intrepid as first Linux System to boot. If you want to edit yourself your yaboot.conf just as exercise, post it here and we can do it together.


    Lastly, i prefer the Hardy splash screen to Intrepid bc in Intrepid the colors are all wonky but they are fine in Hardy (the correct orange/red/yellow logo with orange progress bar). Is it possible to somehow copy the Hardy splash screen to the Intrepid partion? What file should I look for and what all involves in changing that? Sorry for all the questions.
    You can have a look here to get more information about 'usplash'
    https://help.ubuntu.com/community/USplash
    https://help.ubuntu.com/community/US...omizationHowto
    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

  9. #9
    Join Date
    May 2008
    Beans
    7

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

    I actually got kind of ansy last night and tried on my own after reading "man yaboot.conf". Thank you for explaining the relationship bt ybin and yaboot, I didn't know that exactly. I edited the yaboot.conf file on my partion number 3 (hda3) just bc it comes before hda4. And like you suggested I made a copy of my file before I started editing. Anyways I added "default=hda4-Linux" and that worked I did not need to use "defaultos" bc I only have Linux on this box. I will add my conf file, but I have to boot into the other partion to get it. Thanks for the links on the usplash; I haven't figured that out yet but hopefully those links will head me in the right direction (i haven't read them yet).

  10. #10
    Join Date
    May 2008
    Beans
    7

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

    Here's my yaboot.conf file. The only thing I changed was the "default=hda4-Linux". So from what you are saying about ybin I could put this in my hda4 partition and and it would work. Does it matter that this file has the added bit about "# This entry automatically added..." at the bottom?

    Code:
    ## yaboot.conf generated by the Ubuntu installer
    ##
    ## run: "man yaboot.conf" for details. Do not make changes until you have!!
    ## see also: /usr/share/doc/yaboot/examples for example configurations.
    ##
    ## For a dual-boot menu, add one or more of:
    ## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ
    
    boot=/dev/hda2
    device=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:
    partition=3
    root=/dev/hda3
    timeout=100
    install=/usr/lib/yaboot/yaboot
    magicboot=/usr/lib/yaboot/ofboot
    default=hda4-Linux
    enablecdboot
    
    image=/boot/vmlinux
    	label=Linux
    	read-only
    	initrd=/boot/initrd.img
    	append="quiet splash"
    
    image=/boot/vmlinux.old
    	label=old
    	read-only
    	initrd=/boot/initrd.img.old
    	append="quiet splash"
    
    # This entry automatically added by the Ubuntu installer for an existing
    # Linux installation on /dev/hda4.
    image=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4,/boot/vmlinux
        label=hda4-Linux
        root=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4
        append="root=/dev/hda4 ro quiet splash video=ofonly"
        initrd=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4,/boot/initrd.img
    
    # This entry automatically added by the Ubuntu installer for an existing
    # Linux installation on /dev/hda4.
    image=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4,/boot/vmlinux.old
        label=hda4-old
        root=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4
        append="root=/dev/hda4 ro quiet splash video=ofonly"
        initrd=/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4,/boot/initrd.img.old

Page 1 of 2 12 LastLast

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
  •