<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-yaboot" role="wrap">
  <?dbhtml filename="yaboot.html"?>

  <title>Yaboot-&yaboot-version;</title>

  <indexterm zone="ch-system-yaboot">
    <primary sortas="a-Yaboot">Yaboot</primary>
  </indexterm>

  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  href="../ppc/yaboot.xml"
  xpointer="xpointer(//*[@role='package'])"/>

  <sect2 role="installation">
    <title>Installation of Yaboot</title>

    <para>Yaboot defaults to build as 32bit, so we need to pass appropriate
    options to both the compiler and the linker.  To prevent the build from
    failing due to compiler warnings, the -Werror flag is removed.  The 
    Makefile already overrides any CC and ignores LDFLAGS in favour of 
    its own variables, so we need to use the following seds for a 
    successful compile and install.</para>

<screen><userinput>sed -i -e "s/m32/m64/g" \
    -e "s/-Werror//" \
    -e "s/elf32ppclinux/elf64ppc/" Makefile
</userinput></screen>

    <variablelist os="j">
      <title>The meaning of the sed parameters:</title>

      <varlistentry>
        <term><parameter>"s/m32/m64/g"</parameter></term>
        <listitem>
          <para>Replaces -m32 with -m64 to force <command>gcc</command> to
          create 64-bit code when compiling yaboot.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>"s/-Werror//"</parameter></term>
        <listitem>
          <para>This deletes the -Werror flag from the Makefile.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>"s/elf32ppclinux/elf64ppc/"</parameter></term>
        <listitem>
          <para>This replaces the 32 bit emulation with a 64 bit emulation
          flag to force <command>ld</command> to use a suitable 64-bit
          emulation picked from the output of <command>'ld -V'</command>.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='p3'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='p4'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='p5'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='p6'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='a'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='b'])"/>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='c'])"/>

<screen os="d"><userinput>make PREFIX=/usr</userinput></screen>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    href="../ppc/yaboot.xml"
    xpointer="xpointer(//*[@os='e'])"/>

    <important os="j0">
      <para>The install of yaboot can fail if you miss any of the
      patches or seds. <command>ld</command> will issue warnings,
      but the install will appear to complete successfully. That
      would result in an unbootable system, so you need to log the
      output to check it.</para>
    </important>

<screen os='f'><userinput>make PREFIX=/usr install 2&gt;&amp;1 | tee instlog</userinput></screen>

    <para os='g'>To ensure that the install was successful, run the following
    command:</para>

<screen os='h'><userinput>grep 'powerpc:common64' instlog</userinput></screen>

    <para os='i'>If the command gave you <emphasis>any</emphasis> output
    (... is incompatible with powerpc:common output) the build of yaboot is
    broken and you will have to correct your error(s) and repeat it.</para>

  </sect2>

  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  href="../ppc/yaboot.xml"
  xpointer="xpointer(id('contents-yaboot'))"/>

</sect1>
