<?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-boot-yaboot-build" role="wrap">
  <?dbhtml filename="yaboot-build.html"?>

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

  <indexterm zone="ch-boot-yaboot-build">
    <primary sortas="a-Yaboot">Yaboot</primary>
    <secondary>boot</secondary>
  </indexterm>

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

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

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

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

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

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

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

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

    <para>The Makefile is already set to do kernel-style cross-compiling,
    but it will try to use <command>strip</command> to strip the second-stage
    loader.  It also expects to be running as root for the install, and to
    install for the root user, which user CLFS cannot do.  We also need to use
    the 32-bit compiler, and to force <command>ld</command> to use a 32-bit
    emulation. The following commands will fix and achieve this:</para>

<screen><userinput>cp -v Makefile{,.orig}
sed -e "s/\(-print-libgcc-file-name\)/${BUILD32} \1/" \
            -e "s/\(-Bstatic\)/-melf32ppclinux \1/" \
            -e "s/\(strip \)/${CLFS_TARGET}-\1/" \
            -e 's/-o root -g root//' \
            -e 's/-Werror//' \
    Makefile.orig &gt; Makefile</userinput></screen>

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

<screen><userinput>CFLAGS=${BUILD32} make CROSS=${CLFS_TARGET}-</userinput></screen>

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

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

<screen><userinput>make CROSS=${CLFS_TARGET}- ROOT=/tools PREFIX= install 2&gt;&amp;1 | tee instlog</userinput></screen>

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

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

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

  </sect2>

  <sect2 role="content">
    <title/>

    <para>Details on this package are located in <xref linkend="contents-yaboot" role="."/></para>

  </sect2>

</sect1>
