<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">

<!-- The content of this document is licensed under the CC-BY-SA license -->
<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->

<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-ppc64-bootloader.xml,v 1.2 2004/08/05 13:08:39 swift Exp $ -->

<sections>
<section>
<title>Making your Choice</title>
<subsection>
<title>Introduction</title>
<body>

<p>
Now that your kernel is configured and compiled and the necessary system
configuration files are filled in correctly, it is time to install a
program that will fire up your kernel when you start the system. Such a
program is called a <e>bootloader</e>.
</p>

<p>
On Linux/PPC64 we have only yaBoot as a bootloader untill grub2 is
finished.
</p>

</body>
</subsection>
</section>
<section id="yaboot">
<title>Using yaBoot</title>
<subsection>
<title>Introduction</title>
<body>

<impo>
You have to use yaboot-static instead of yaboot, because yaboot won't
compile on PPC64.
</impo>

<p>
There are two ways to configure yaBoot for your system. You can use the
new and improved <c>yabootconfig</c> included with
<path>yaboot-1.3.8-r1</path> and later to automatically setup yaboot. If
for some reason you do not want to run <c>yabootconfig</c> to
automatically setup <path>/etc/yaboot.conf</path> or you are installing Gentoo
on a G5 (on which <c>yabootconfig</c> does not always work), you can just edit 
the sample file already installed on your system.
</p>

<impo>
yabootconfig/ybin won't work on IBM. You have to install yaboot another way:
<uri link="#yaboot-ibm">Using yaboot on IBM</uri>
</impo>

<ul>
  <li><uri link="#yabootconfig">Default: Using yabootconfig</uri></li>
  <li>
    <uri link="#manual_yaboot">Alternative: Manual yaBoot Configuration</uri>
  </li>
</ul>

</body>
</subsection>
<subsection id="yabootconfig">
<title>Default: Using yabootconfig</title>
<body>

<p>
<c>yabootconfig</c> will auto-detect the partitions on your machine and will
setup dual and triple boot combinations with Linux, Mac OS, and Mac OS
X.
</p>

<p>
To use <c>yabootconfig</c>, your drive must have a bootstrap partition, and
<path>/etc/fstab</path> must be configured with your Linux partitions. Both of 
these should have been done already in the steps above. To start, ensure that
you have the latest version of yaboot installed by running <c>emerge --update
yaboot-static</c>. This is necessary as the latest version will be available via
Portage, but it may not have made it into the stage files.
</p>

<pre caption = "Installing yaboot-static">
# <i>emerge --update yaboot-static</i>
</pre>

<p>
Now run <c>yabootconfig</c>. The program will run and it will confirm
the location of the bootstrap partition. Type <c>Y</c> if it is correct. If
not, double check <path>/etc/fstab</path>. yabootconfig will then scan your
system setup, create <path>/etc/yaboot.conf</path> and run <c>mkofboot</c> for
you. <c>mkofboot</c> is used to format the bootstrap partition, and install 
the yaboot configuration file into it.
</p>

<p>
You might want to verify the contents of <path>/etc/yaboot.conf</path>. If 
you make changes to <path>/etc/yaboot.conf</path> (like setting the 
default/boot OS), make sure to rerun <c>ybin -v</c> to apply changes to the 
bootstrap partition.
</p>

<p>
Now continue with <uri link="#reboot">Rebooting your System</uri>.
</p>

</body>
</subsection>
<subsection id="manual_yaboot">
<title>Alternative: Manual yaBoot Configuration</title>
<body>

<p>
First make sure you have the latest <c>yaboot-static</c> installed on your
system:
</p>

<pre caption = "Installing yaboot">
# <i>emerge --update yaboot-static</i>
</pre>

<p>
Below you find a completed <path>yaboot.conf</path> file. Alter it at
will.
</p>

<pre caption = "/etc/yaboot.conf">
<comment>## /etc/yaboot.conf
##
## 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

## our bootstrap partition:</comment>

boot=/dev/sda2

<comment>## ofboot is the openfirmware way to specify the bootstrap partition.
## If this isn't defined, yaboot fails on the G5 (unless you pass the necessary
## arguments to the mkofboot/ybin program).
## hd:X means /dev/sdaX (or /dev/hdaX).
## 
## G5 users should uncomment this line!!</comment>

ofboot=hd:2

<comment>##hd: is open firmware speak for sda</comment>
device=hd:
partition=4

delay=5
defaultos=macosx
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot

<comment>#################
## This section can be duplicated if you have more than one kernel or set of
## boot options
#################</comment>
image=/boot/kernel-2.6.7-gentoo-r8
  label=Linux
  root=/dev/sda4
  sysmap=/boot/System.map-2.6.7
  read-only
<comment>##################</comment>

macos=hd:5
macosx=hd:6
enablecdboot
enableofboot
</pre>

<p>
Once <path>yaboot.conf</path> is set up the way you want it, you run
<c>mkofboot -v</c> to install the settings in the bootstrap partition.
<e>Don't forget this!</e> If all goes well, and you have the same
options as the sample above, your next reboot will give you a simple,
five-entry boot menu. If you update your yaboot config later on, you'll
just need to run <c>ybin -v</c> to update the bootstrap partition -
<c>mkofboot</c> is for initial setup only.
</p>

<p>
For more information on yaboot, take a look at the <uri
link="http://penguinppc.org/projects/yaboot">yaboot project</uri>. For
now, continue the installation with <uri link="#reboot">Rebooting your 
System</uri>.
</p>

</body>
</subsection>
</section>
<section id="yaboot-ibm">
<title>Using yaboot on IBM</title>
<body>

<p>
On IBM hardware you cannot run yabootconfig or ybin. You have to proceed
the folowing steps:
</p>

<ul>
  <li>Install yaboot-static</li>
  <li>Run 'dd if=/usr/lib/yaboot/yaboot.chrp of=/dev/sdXX' (fill in XX
  with your disk and partition for the RPeP partition; this was in our
  example /dev/sda1)</li>
  <li>Next construct your own yaboot.conf file and place into /etc.
  (Take a look at the config above or look into the man page of
  yaboot.conf)</li>
  <li>Assuming your boot device in OF is pointing to the harddrive you
  prep boot partition is on then it'll just work, otherwise at IPL time,
  go into the multiboot menu and set the boot device to the one with
  your prep boot partition.</li>
  <li>That's it!</li>
</ul>

</body>
</section>
<section id="reboot">
<title>Rebooting the System</title>
<subsection>
<body>

<p>
Exit the chrooted environment and unmount all mounted partitions. Then type in 
that one magical command you have been waiting for: <c>reboot</c>.
</p>

<pre caption="Exiting the chroot, unmounting all partitions and rebooting">
# <i>exit</i>
cdimage ~# <i>umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo</i>
cdimage ~# <i>reboot</i>
</pre>

<p>
Of course, don't forget to remove the bootable CD, otherwise the CD will be
booted again instead of your new Gentoo system.
</p>

<p>
Once rebooted in your Gentoo installation, finish up with <uri
link="?part=1&amp;chap=11">Finalizing your Gentoo Installation</uri>.
</p>

</body>
</subsection>
</section>

</sections>
