Changeset 4e82d47


Ignore:
Timestamp:
12/05/2008 08:46:02 PM (15 years ago)
Author:
Jeremy Huntwork <jhuntwork@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
6f2cc22
Parents:
6e88633
Message:

Bring in DIY's next generation build method. Move GRUB to chapter 8.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8755 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Files:
18 edited

Legend:

Unmodified
Added
Removed
  • chapter01/changelog.xml

    r6e88633 r4e82d47  
    3737
    3838-->
     39    <listitem>
     40      <para>2008-12-04</para>
     41      <itemizedlist>
     42        <listitem>
     43          <para>[jhuntwork] - Introduce new build method in Chapter 5 originating
     44          in DIY-Linux. Thanks, Greg Schafer.</para>
     45        </listitem>
     46        <listitem>
     47          <para>[jhuntwork] - Move instructions for GRUB to chapter 8 just after the
     48          compilation of the kernel. Merge GRUB build and configuration instructions
     49          into one page.</para>
     50        </listitem>
     51      </itemizedlist>
     52    </listitem>
     53
    3954    <listitem>
    4055      <para>2008-12-03</para>
  • chapter01/whatsnew.xml

    r6e88633 r4e82d47  
    214214
    215215    <listitem>
    216       <para>None yet</para>
     216      <para>&gcc-startfiles-patch;</para>
    217217    </listitem>
    218218
  • chapter03/patches.xml

    r6e88633 r4e82d47  
    116116
    117117    <varlistentry>
     118      <term>GCC Startfiles Fix Patch - <token>&gcc-startfiles-patch-size;</token>:</term>
     119      <listitem>
     120        <para>Download: <ulink url="&patches-root;&gcc-startfiles-patch;"/></para>
     121        <para>MD5 sum: <literal>&gcc-startfiles-patch-md5;</literal></para>
     122      </listitem>
     123    </varlistentry>
     124
     125    <varlistentry>
    118126      <term>Glibc Iconv Test Fixes Patch - <token>&glibc-iconv-test-fixes-patch-size;</token>:</term>
    119127      <listitem>
  • chapter04/settingenviron.xml

    r6e88633 r4e82d47  
    4343LFS=/mnt/lfs
    4444LC_ALL=POSIX
     45LFS_TGT=$(uname -m)-lfs-linux-gnu
    4546PATH=/tools/bin:/bin:/usr/bin
    46 export LFS LC_ALL PATH</literal>
     47export LFS LC_ALL LFS_TGT PATH</literal>
    4748EOF</userinput></screen>
    4849
     
    7778  everything will work as expected in the chroot environment.</para>
    7879
     80  <para>The <envar>LFS_TGT</envar> variable sets a non-default, but compatible machine
     81  description for use when building our cross compiler and linker and when cross
     82  compiling our temporary toolchain. More information is contained in
     83  <xref linkend="ch-tools-toolchaintechnotes" role=""/>.</para>
     84
    7985  <para>By putting <filename class="directory">/tools/bin</filename> ahead of the
    8086  standard <envar>PATH</envar>, all the programs installed in <xref
  • chapter05/adjusting.xml

    r6e88633 r4e82d47  
    1313  <para>Now that the temporary C libraries have been installed, all
    1414  tools compiled in the rest of this chapter should be linked against
    15   these libraries. In order to accomplish this, the linker and the
    16   compiler's specs file need to be adjusted.</para>
     15  these libraries. In order to accomplish this, the cross-compiler's
     16  specs file needs to be adjusted to point to the new dynamic linker
     17  in <filename class="directory">/tools</filename>.</para>
    1718
    18   <para>The linker, adjusted at the end of the first pass of Binutils, needs
    19   to be renamed so that it can be properly found and used. First, backup the
    20   original linker, then replace it with the adjusted linker. We'll also
    21   create a link to its counterpart in <filename class="directory">
    22   /tools/$(gcc -dumpmachine)/bin</filename>:</para>
    23 
    24 <screen><userinput>mv -v /tools/bin/{ld,ld-old}
    25 mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
    26 mv -v /tools/bin/{ld-new,ld}
    27 ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen>
    28 
    29   <para>From this point onwards, everything will link only against the
    30   libraries in <filename class="directory">/tools/lib</filename>.</para>
    31 
    32   <para>The next task is to point GCC to the new dynamic linker. This is done by
    33   dumping GCC's <quote>specs</quote> file to a location where GCC will look for it
    34   by default. A simple <command>sed</command> substitution then alters the
     19  <para>This is done by dumping the compiler's <quote>specs</quote> file to a
     20  location where it will look for it by default.
     21  A simple <command>sed</command> substitution then alters the
    3522  dynamic linker that GCC will use. The principle here is to find all references
    3623  to the dynamic linker file in <filename class="directory">/lib</filename>
     
    4734
    4835<!-- Ampersands are needed to allow copy and paste -->
    49 <screen><userinput>gcc -dumpspecs | sed 's@/lib\(64\)\?/ld@/tools&amp;@g' &gt; \
    50   `dirname $(gcc -print-libgcc-file-name)`/specs</userinput></screen>
    51 
    52   <para>During the build process, GCC runs a script
    53   (<command>fixincludes</command>) that scans the system for header files
    54   that may need to be fixed (they might contain syntax errors, for example),
    55   and installs the fixed versions in a private include directory. There is a
    56   possibility that, as a result of this process, some header files from the
    57   host system have found their way into GCC's private include directory. As
    58   the rest of this chapter only requires the headers from GCC and Glibc,
    59   which have both been installed at this point, any <quote>fixed</quote>
    60   headers can safely be removed. This helps to avoid any host headers
    61   polluting the build environment. Run the following commands to remove the
    62   header files in GCC's private include directory (you may find it easier to
    63   copy and paste these commands, rather than typing them by hand, due to
    64   their length):</para>
    65 
    66 <!-- && used to ease copy and pasting -->
    67 <screen><userinput>GCC_FIXED=`dirname $(gcc -print-libgcc-file-name)`/include-fixed &amp;&amp;
    68 find ${GCC_FIXED}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; &amp;&amp;
    69 rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_FIXED}/*` &amp;&amp;
    70 unset GCC_FIXED</userinput></screen>
     36<screen><userinput>SPECS=`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/specs
     37$LFS_TGT-gcc -dumpspecs | sed \
     38  -e 's@/lib\(64\)\?/ld@/tools&amp;@g' \
     39  -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" &gt; $SPECS
     40echo "New specs file is: $SPECS"
     41unset SPECS</userinput></screen>
    7142
    7243  <caution>
     
    7647
    7748<screen><userinput>echo 'main(){}' &gt; dummy.c
    78 cc dummy.c
     49$LFS_TGT-gcc -B/tools/lib dummy.c
    7950readelf -l a.out | grep ': /tools'</userinput></screen>
    8051
     
    9263    then something is wrong. Investigate and retrace the steps to find out
    9364    where the problem is and correct it. This issue must be resolved before
    94     continuing on. First, perform the sanity check again, using
    95     <command>gcc</command> instead of <command>cc</command>. If this works,
    96     then the <filename class="symlink">/tools/bin/cc</filename> symlink is
    97     missing. Revisit <xref linkend="ch-tools-gcc-pass1" role=","/> and install
    98     the symlink. Next, ensure that the <envar>PATH</envar> is correct. This
    99     can be checked by running <command>echo $PATH</command> and verifying that
    100     <filename class="directory">/tools/bin</filename> is at the head of the
    101     list. If the <envar>PATH</envar> is wrong it could mean that you are not
    102     logged in as user <systemitem class="username">lfs</systemitem> or that
    103     something went wrong back in <xref linkend="ch-tools-settingenviron"
    104     role="."/> Another option is that something may have gone wrong with the
     65    continuing on. Something may have gone wrong with the
    10566    specs file amendment above. In this case, redo the specs file amendment,
    10667    being careful to copy-and-paste the commands.</para>
     
    11273  </caution>
    11374
    114   <note><para>Building Tcl in the next section will serve as an additional check that
    115   the toolchain has been built properly.  If Tcl fails to build, it is an
    116   indication that something has gone wrong with the Binutils, GCC, or Glibc
    117   installation, but not with Tcl itself.</para></note>
     75  <note><para>Building Binutils in the next section will serve as an additional check that
     76  the toolchain has been built properly. If Binutils fails to build, it is an
     77  indication that something has gone wrong with the previous Binutils, GCC, or Glibc
     78  installations.</para></note>
    11879
    11980</sect1>
  • chapter05/binutils-pass1.xml

    r6e88633 r4e82d47  
    4242
    4343  <sect2 role="installation">
    44     <title>Installation of Binutils</title>
     44    <title>Installation of Cross Binutils</title>
    4545
    4646    <para>It is important that Binutils be the first package compiled
     
    7171    <para>Now prepare Binutils for compilation:</para>
    7272
    73 <screen><userinput remap="configure">CC="gcc -B/usr/bin/" ../binutils-&binutils-version;/configure \
    74     --prefix=/tools --disable-nls --disable-werror</userinput></screen>
     73<screen><userinput remap="configure">../binutils-&binutils-version;/configure \
     74    --target=$LFS_TGT --prefix=/tools \
     75    --disable-nls --disable-werror</userinput></screen>
    7576
    7677    <variablelist>
     
    7879
    7980      <varlistentry>
    80         <term><envar>CC="gcc -B/usr/bin/"</envar></term>
     81        <term><envar>--target=$LFS_TGT</envar></term>
    8182        <listitem>
    82           <para>This forces <command>gcc</command> to prefer the linker from
    83           the host in <filename class="directory">/usr/bin</filename>. This
    84           is necessary on some hosts where the new <command>ld</command>
    85           built here is not compatible with the host's <command>gcc</command>.
     83          <para>Because the machine description in the <envar>LFS_TGT</envar>
     84          variable is slightly different than the value returned by the
     85          config.guess script, this switch will tell the configure script to
     86          adjust Binutil's build system for building a cross linker.
    8687          </para>
    8788        </listitem>
     
    125126    first pass will soon be replaced by those from the second.</para>
    126127
    127     <para>Create a symlink to ensure the sanity of our toolchain:</para>
     128    <para>If building on x86_64, create a symlink to ensure the sanity of
     129    the toolchain:</para>
    128130
    129 <screen><userinput remap="install">mkdir -v /tools/lib
    130 ln -sv lib /tools/lib64</userinput></screen>
     131<screen><userinput remap="install">case $(uname -m) in
     132  x86_64) mkdir -v /tools/lib &amp;&amp; ln -sv lib /tools/lib64 ;;
     133esac</userinput></screen>
    131134
    132135    <para>Install the package:</para>
    133136
    134137<screen><userinput remap="install">make install</userinput></screen>
    135 
    136     <para>Finally, prepare the linker for the <quote>Adjusting</quote> phase
    137     later on:</para>
    138 
    139 <screen><userinput remap="adjust">make -C ld clean
    140 make -C ld LIB_PATH=/tools/lib
    141 cp -v ld/ld-new /tools/bin</userinput></screen>
    142 
    143     <variablelist>
    144       <title>The meaning of the make parameters:</title>
    145 
    146       <varlistentry>
    147         <term><parameter>-C ld clean</parameter></term>
    148         <listitem>
    149           <para>This tells the make program to remove all compiled
    150           files in the <filename class="directory">ld</filename>
    151           subdirectory.</para>
    152         </listitem>
    153       </varlistentry>
    154 
    155       <varlistentry>
    156         <term><parameter>-C ld LIB_PATH=/tools/lib</parameter></term>
    157         <listitem>
    158           <para>This option rebuilds everything in the <filename
    159           class="directory">ld</filename> subdirectory. Specifying the
    160           <envar>LIB_PATH</envar> Makefile variable on the command line
    161           allows us to override the default value and point it to the
    162           temporary tools location. The value of this variable specifies
    163           the linker's default library search path. This preparation is
    164           used later in the chapter.</para>
    165         </listitem>
    166       </varlistentry>
    167 
    168     </variablelist>
    169138
    170139  </sect2>
  • chapter05/binutils-pass2.xml

    r6e88633 r4e82d47  
    4242
    4343  <sect2 role="installation">
    44     <title>Re-installation of Binutils</title>
     44    <title>Installation of Binutils</title>
    4545
    4646    <para>Binutils does not recognize versions of Texinfo newer than 4.9.  Fix
     
    5656    <para>Prepare Binutils for compilation:</para>
    5757
    58 <screen><userinput remap="configure">../binutils-&binutils-version;/configure --prefix=/tools \
    59     --disable-nls --with-lib-path=/tools/lib</userinput></screen>
     58<screen><userinput remap="configure">CC="$LFS_TGT-gcc -B/tools/lib/" \
     59   AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
     60   ../binutils-&binutils-version;/configure --prefix=/tools \
     61   --disable-nls --with-lib-path=/tools/lib</userinput></screen>
    6062
    6163    <variablelist>
    6264      <title>The meaning of the new configure options:</title>
     65
     66      <varlistentry>
     67        <term><parameter>CC="$LFS_TGT-gcc -B/tools/lib/" AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib</parameter></term>
     68        <listitem>
     69          <para>Because this is really a native build of Binutils, setting these
     70          variables ensures that the build system uses the cross-compiler and
     71          associated tools instead of the ones on the host system.</para>
     72        </listitem>
     73      </varlistentry>
    6374
    6475      <varlistentry>
     
    7990<screen><userinput remap="make">make</userinput></screen>
    8091
    81     <para>Compilation is now complete. As discussed earlier, running the
    82     test suite is not mandatory for the temporary tools here in this
    83     chapter. To run the Binutils test suite anyway, issue the following
    84     command:</para>
    85 
    86 <screen><userinput remap="test">make check</userinput></screen>
    87 
    8892    <para>Install the package:</para>
    8993
     
    96100make -C ld LIB_PATH=/usr/lib:/lib
    97101cp -v ld/ld-new /tools/bin</userinput></screen>
     102
     103    <variablelist>
     104      <title>The meaning of the make parameters:</title>
     105
     106      <varlistentry>
     107        <term><parameter>-C ld clean</parameter></term>
     108        <listitem>
     109          <para>This tells the make program to remove all compiled
     110          files in the <filename class="directory">ld</filename>
     111          subdirectory.</para>
     112        </listitem>
     113      </varlistentry>
     114
     115      <varlistentry>
     116        <term><parameter>-C ld LIB_PATH=/usr/lib:/lib</parameter></term>
     117        <listitem>
     118          <para>This option rebuilds everything in the <filename
     119          class="directory">ld</filename> subdirectory. Specifying the
     120          <envar>LIB_PATH</envar> Makefile variable on the command line
     121          allows us to override the default value of the temporary tools
     122          and point it to the proper final path. The value of this variable
     123          specifies the linker's default library search path. This
     124          preparation is used in the next chapter.</para>
     125        </listitem>
     126      </varlistentry>
     127
     128    </variablelist>
    98129
    99130  </sect2>
  • chapter05/chapter05.xml

    r6e88633 r4e82d47  
    2020  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
    2121  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="adjusting.xml"/>
     22  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-pass2.xml"/>
     23  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-pass2.xml"/>
    2224  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tcl.xml"/>
    2325  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="expect.xml"/>
    2426  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="dejagnu.xml"/>
    25   <!-- <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gmp.xml"/>
    26   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mpfr.xml"/> -->
    27   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-pass2.xml"/>
    28   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-pass2.xml"/>
    2927  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/>
    3028  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/>
  • chapter05/gcc-pass1.xml

    r6e88633 r4e82d47  
    4242
    4343  <sect2 role="installation">
    44     <title>Installation of GCC</title>
     44    <title>Installation of Cross GCC</title>
    4545
    4646    <para>GCC now requires the GMP and MPFR packages. As these packages may
     
    6161    <para>Prepare GCC for compilation:</para>
    6262
    63 <screen><userinput remap="configure">CC="gcc -B/usr/bin/" ../gcc-&gcc-version;/configure --prefix=/tools \
    64     --with-local-prefix=/tools --disable-nls --disable-shared --disable-libssp \
    65     --disable-multilib --enable-languages=c</userinput></screen>
     63<screen><userinput remap="configure">../gcc-&gcc-version;/configure \
     64    --target=$LFS_TGT --prefix=/tools \
     65    --disable-nls --disable-shared --disable-multilib \
     66    --disable-decimal-float --disable-threads \
     67    --disable-libmudflap --disable-libssp \
     68    --disable-libgomp --enable-languages=c</userinput></screen>
    6669
    6770    <variablelist>
    6871      <title>The meaning of the configure options:</title>
    69 
    70       <varlistentry>
    71         <term><envar>CC="gcc -B/usr/bin/"</envar></term>
    72         <listitem>
    73           <para>This forces <command>gcc</command> to prefer the linker from
    74           the host in <filename class="directory">/usr/bin</filename>. This
    75           is necessary on some hosts where the new <command>ld</command>
    76           built in the previous section is not compatible with the host's
    77           <command>gcc</command>.</para>
    78         </listitem>
    79       </varlistentry>
    80 
    81       <varlistentry>
    82         <term><parameter>--with-local-prefix=/tools</parameter></term>
    83         <listitem>
    84           <para>The purpose of this switch is to remove <filename
    85           class="directory">/usr/local/include</filename> from
    86           <command>gcc</command>'s include search path. This is not
    87           absolutely essential, however, it helps to minimize the
    88           influence of the host system.</para>
    89         </listitem>
    90       </varlistentry>
    9172
    9273      <varlistentry>
     
    10081
    10182      <varlistentry>
    102         <term><parameter>--disable-libssp</parameter></term>
     83        <term><parameter>--disable-decimal-float, --disable-threads, --disable-libmudflap, --disable-libssp, --disable-libgomp</parameter></term>
    10384        <listitem>
    104           <para>This switch prevents a conflict with older versions of
    105           glibc which can cause the build to fail.</para>
     85          <para>These switches disable support for the decimal floating point extension,
     86          threading, libmudflap, libssp and libgomp respectively. These features will fail
     87          to compile when building a cross-compiler and are not necessary for the task of
     88          cross-compiling the temporary libc.</para>
     89        </listitem>
     90      </varlistentry>
     91
     92      <varlistentry>
     93        <term><parameter>--disable-multilib</parameter></term>
     94        <listitem>
     95          <para>On x86_64, LFS does not yet support a multilib configuration.
     96          This switch is harmless for x86.</para>
    10697        </listitem>
    10798      </varlistentry>
     
    115106      </varlistentry>
    116107
    117       <varlistentry>
    118         <term><parameter>--disable-multilib</parameter></term>
    119         <listitem>
    120           <para>We currently only want to build support for 64-bit libraries.</para>
    121         </listitem>
    122       </varlistentry>
    123 
    124108    </variablelist>
    125109
    126     <para>The following command will compile GCC not once, but several times. It
    127     uses the programs compiled in a first round to compile itself a second time,
    128     and then again a third time. It then compares these second and third compiles
    129     to make sure it can reproduce itself flawlessly. This is called
    130     <quote>bootstrapping</quote>. Building GCC in this way ensures that it was
    131     compiled correctly and is now the default configuration for the released
    132     package. Continue with compiling by running:</para>
     110    <para>Compile GCC by running:</para>
    133111
    134112<screen><userinput remap="make">make</userinput></screen>
     
    147125    <filename>libgcc_eh.a</filename> file isn't created and installed. The
    148126    Glibc package depends on this library as it uses
    149     <parameter>-lgcc_eh</parameter> within its build system. We can satisfy
    150     that dependency by creating a symlink to <filename>libgcc.a</filename>,
     127    <parameter>-lgcc_eh</parameter> within its build system. This dependency
     128    can be satisfied by creating a symlink to <filename>libgcc.a</filename>,
    151129    since that file will end up containing the objects normally contained in
    152130    <filename>libgcc_eh.a</filename>.</para>
    153131
    154 <screen><userinput remap="install">ln -vs libgcc.a `gcc -print-libgcc-file-name | \
     132<screen><userinput remap="install">ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \
    155133    sed 's/libgcc/&amp;_eh/'`</userinput></screen>
    156 
    157     <para>As a finishing touch, create a symlink. Many programs and scripts
    158     run <command>cc</command> instead of <command>gcc</command>, which is
    159     used to keep programs generic and therefore usable on all kinds of UNIX
    160     systems where the GNU C compiler is not always installed. Running
    161     <command>cc</command> leaves the system administrator free to decide
    162     which C compiler to install:</para>
    163 
    164 <screen><userinput remap="install">ln -vs gcc /tools/bin/cc</userinput></screen>
    165134
    166135  </sect2>
  • chapter05/gcc-pass2.xml

    r6e88633 r4e82d47  
    4242
    4343  <sect2 role="installation">
    44     <title>Re-installation of GCC</title>
    45 
    46     <para>The tools required to test GCC and Binutils&mdash;Tcl, Expect
    47     and DejaGNU&mdash;are installed now. GCC and Binutils can now be
    48     rebuilt, linking them against the new Glibc and testing them properly
    49     (if running the test suites in this chapter). Please note that these
    50     test suites are highly dependent on properly functioning PTYs which
    51     are provided by the host. PTYs are most commonly implemented via the
    52     <systemitem class="filesystem">devpts</systemitem> file system. Check
    53     to see if the host system is set up correctly in this regard by
    54     performing a quick test:</para>
    55 
    56 <screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
    57 
    58     <para>The response might be:</para>
    59 
    60 <screen><computeroutput>The system has no more ptys.
    61 Ask your system administrator to create more.</computeroutput></screen>
    62 
    63     <para>If the above message is received, the host does not have its PTYs
    64     set up properly. In this case, there is no point in running the test
    65     suites for GCC and Binutils until this issue is resolved. Please consult
    66     the LFS FAQ at <ulink url="&lfs-root;/lfs/faq.html#no-ptys"/> for more
    67     information on how to get PTYs working.</para>
    68 
    69     <para>As previously explained in <xref linkend="ch-tools-adjusting"/>,
    70     under normal circumstances the GCC <command>fixincludes</command> script
     44    <title>Installation of GCC</title>
     45
     46    <para>Versions of GCC later than 4.3 will treat this build as if
     47    it were a relocated compiler and disallow searching for startfiles in
     48    the location specified by <parameter>--prefix</parameter>. Since this
     49    will not be a relocated compiler, and the startfiles in
     50    <filename class="directory">/tools</filename> are crucial to building
     51    a working compiler linked to the libs in <filename class="directory">/tools</filename>,
     52    apply the following patch which partially reverts GCC to its old behavior:</para>
     53
     54<screen><userinput remap="pre">patch -Np1 -i ../&gcc-startfiles-patch;</userinput></screen>
     55
     56    <para>Under normal circumstances the GCC <command>fixincludes</command> script
    7157    is run in order to fix potentially broken header files. As GCC-&gcc-version;
    7258    and Glibc-&glibc-version; have already been installed at this point, and
     
    8167sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
    8268
    83     <para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
    84     built GCC with the <option>-fomit-frame-pointer</option> compiler flag.
    85     Non-bootstrap builds omit this flag by default, so apply the following
    86     <command>sed</command> to use it in order to ensure consistent compiler
    87     builds:</para>
     69    <para>Non-bootstrap builds omit the <option>-fomit-frame-pointer</option>
     70    build flag by default, and the goal should be to produce a compiler that is
     71    exactly the same as if it were bootstrapped. Apply the following
     72    <command>sed</command> command to force the build to use the flag:</para>
    8873
    8974<screen><userinput remap="pre">cp -v gcc/Makefile.in{,.tmp}
     
    9277
    9378    <para>The following command will change the location of GCC's default
    94     dynamic linker to use the one we installed in
     79    dynamic linker to use the one installed in
    9580    <filename class="directory">/tools</filename>. It also removes <filename
    9681    class="directory">/usr/include</filename> from GCC's include search path.
     
    10691  sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \
    10792  -e 's@/usr@/tools@g' $file.orig &gt; $file
    108   echo "
     93  echo '
    10994#undef STANDARD_INCLUDE_DIR
    110 #define STANDARD_INCLUDE_DIR 0" &gt;&gt; $file
     95#define STANDARD_INCLUDE_DIR 0
     96#define STANDARD_STARTFILE_PREFIX_1 ""
     97#define STANDARD_STARTFILE_PREFIX_2 ""' &gt;&gt; $file
    11198  touch $file.orig
    11299done</userinput></screen>
     
    121108    <quote>/lib64/ld</quote> or <quote>/lib32/ld</quote>, while the second one
    122109    replaces hard-coded instances of <quote>/usr</quote>. Then we add our define
    123     statements which alter the include search path to the end of the file. Finally,
    124     we use <command>touch</command> to update the timestamp on the copied files.
     110    statements which alter the include search path and the default startfile prefix
     111    to the end of the file.
     112    Finally, we use <command>touch</command> to update the timestamp on the copied files.
    125113    When used in conjunction with <command>cp -u</command>, this prevents unexpected
    126114    changes to the original files in case the command is inadvertently run twice.
    127115    </para>
    128116
    129     <para>Unsetting the multlib spec for GCC ensures that it
     117    <para>On x86_64, unsetting the multlib spec for GCC ensures that it
    130118    won't attempt to link against libraries on the host:</para>
    131119
    132 <screen><userinput remap="pre">for file in $(find gcc/config -name t-linux64) ; do \
    133    cp -v $file{,.orig}
    134    sed '/MULTILIB_OSDIRNAMES/d' $file.orig &gt; $file
    135 done</userinput></screen>
     120<screen><userinput remap="pre">case $(uname -m) in
     121  x86_64)
     122    for file in $(find gcc/config -name t-linux64) ; do \
     123      cp -v $file{,.orig}
     124      sed '/MULTILIB_OSDIRNAMES/d' $file.orig &gt; $file
     125    done
     126  ;;
     127esac</userinput></screen>
    136128
    137129    <para>As in the first build of GCC it requires the GMP and MPFR packages.
     
    153145    <para>Now prepare GCC for compilation:</para>
    154146
    155 <screen><userinput remap="configure">../gcc-&gcc-version;/configure --prefix=/tools \
     147<screen><userinput remap="configure">CC="$LFS_TGT-gcc -B/tools/lib/" \
     148    AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
     149    ../gcc-&gcc-version;/configure --prefix=/tools \
    156150    --with-local-prefix=/tools --enable-clocale=gnu \
    157151    --enable-shared --enable-threads=posix \
     
    228222<screen><userinput remap="make">make</userinput></screen>
    229223
    230     <para>Compilation is now complete. As previously mentioned, running the test
    231     suites for the temporary tools compiled in this chapter is not mandatory.
    232     To run the GCC test suite anyway, use the following command:</para>
    233 
    234 <screen><userinput remap="test">make -k check</userinput></screen>
    235 
    236     <para>The <parameter>-k</parameter> flag is used to make the test suite run
    237     through to completion and not stop at the first failure. The GCC test
    238     suite is very comprehensive and is almost guaranteed to generate a few
    239     failures.</para>
    240 
    241     <para>For a discussion of test failures that are of particular
    242     importance, please see <xref linkend="ch-system-gcc" role="."/></para>
    243 
    244224    <para>Install the package:</para>
    245225
    246226<screen><userinput remap="install">make install</userinput></screen>
    247227
    248     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
    249     href="adjusting.xml"
    250     xpointer="xpointer(/sect1/caution[1])"/>
     228    <para>As a finishing touch, create a symlink. Many programs and scripts
     229    run <command>cc</command> instead of <command>gcc</command>, which is
     230    used to keep programs generic and therefore usable on all kinds of UNIX
     231    systems where the GNU C compiler is not always installed. Running
     232    <command>cc</command> leaves the system administrator free to decide
     233    which C compiler to install:</para>
     234
     235<screen><userinput remap="install">ln -vs gcc /tools/bin/cc</userinput></screen>
     236
     237  <caution>
     238    <para>At this point, it is imperative to stop and ensure that the basic
     239    functions (compiling and linking) of the new toolchain are working as
     240    expected. To perform a sanity check, run the following commands:</para>
     241
     242<screen><userinput>echo 'main(){}' &gt; dummy.c
     243cc dummy.c
     244readelf -l a.out | grep ': /tools'</userinput></screen>
     245
     246    <para>If everything is working correctly, there should be no errors,
     247    and the output of the last command will be of the form:</para>
     248
     249<screen><computeroutput>[Requesting program interpreter:
     250    /tools/lib/ld-linux.so.2]</computeroutput></screen>
     251
     252    <para>Note that <filename class="directory">/tools/lib</filename>, or
     253    <filename class="directory">/tools/lib64</filename> for 64-bit machines
     254    appears as the prefix of the dynamic linker.</para>
     255
     256    <para>If the output is not shown as above or there was no output at all,
     257    then something is wrong. Investigate and retrace the steps to find out
     258    where the problem is and correct it. This issue must be resolved before
     259    continuing on. First, perform the sanity check again, using
     260    <command>gcc</command> instead of <command>cc</command>. If this works,
     261    then the <filename class="symlink">/tools/bin/cc</filename> symlink is
     262    missing. Install the symlink as per above.
     263    Next, ensure that the <envar>PATH</envar> is correct. This
     264    can be checked by running <command>echo $PATH</command> and verifying that
     265    <filename class="directory">/tools/bin</filename> is at the head of the
     266    list. If the <envar>PATH</envar> is wrong it could mean that you are not
     267    logged in as user <systemitem class="username">lfs</systemitem> or that
     268    something went wrong back in <xref linkend="ch-tools-settingenviron"
     269    role="."/></para>
     270
     271    <para>Once all is well, clean up the test files:</para>
     272
     273<screen><userinput>rm -v dummy.c a.out</userinput></screen>
     274
     275  </caution>
    251276
    252277  </sect2>
  • chapter05/glibc.xml

    r6e88633 r4e82d47  
    4444    <title>Installation of Glibc</title>
    4545
    46     <para>Fix a potential issue if <filename>/etc/ld.so.preload</filename> is
    47     used on the host system.</para>
    48 
    49 <screen><userinput remap="pre">sed -i 's@/etc/ld.so.preload@/tools/etc/ld.so.preload@' elf/rtld.c</userinput></screen>
    50 
    5146    <para>The Glibc documentation recommends building Glibc outside of the source
    5247    directory in a dedicated build directory:</para>
     
    7267
    7368<screen><userinput remap="configure">../glibc-&glibc-version;/configure --prefix=/tools \
     69    --host=$LFS_TGT --build=$(../glibc-&glibc-version;/scripts/config.guess) \
    7470    --disable-profile --enable-add-ons \
    75     --enable-kernel=2.6.0 --with-binutils=/tools/bin \
    76     --without-gd --with-headers=/tools/include \
    77     --without-selinux</userinput></screen>
     71    --enable-kernel=2.6.0 --with-headers=/tools/include \
     72    libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes</userinput></screen>
    7873
    7974    <variablelist>
    8075      <title>The meaning of the configure options:</title>
     76
     77      <varlistentry>
     78        <term><parameter>--host=$LFS_TGT, --build=$(../glibc-&glibc-version;/scripts/config.guess)</parameter></term>
     79        <listitem>
     80          <para>The combined effect of these switches is that Glibc's build system
     81          configures itself to cross-compile, using the cross-linker and
     82          cross-compiler in <filename class="directory">/tools</filename>.</para>
     83        </listitem>
     84      </varlistentry>
    8185
    8286      <varlistentry>
     
    105109
    106110      <varlistentry>
    107         <term><parameter>--with-binutils=/tools/bin</parameter></term>
    108         <listitem>
    109           <para>While not required, this switch ensures that there are
    110           no errors pertaining to which Binutils programs get used during the
    111           Glibc build.</para>
    112         </listitem>
    113       </varlistentry>
    114 
    115       <varlistentry>
    116         <term><parameter>--without-gd</parameter></term>
    117         <listitem>
    118           <para>This prevents the build of the <command>memusagestat</command>
    119           program, which insists on linking against the host's libraries
    120           (libgd, libpng, libz, etc.).</para>
    121         </listitem>
    122       </varlistentry>
    123 
    124       <varlistentry>
    125111        <term><parameter>--with-headers=/tools/include</parameter></term>
    126112        <listitem>
     
    132118
    133119      <varlistentry>
    134         <term><parameter>--without-selinux</parameter></term>
     120        <term><parameter>libc_cv_forced_unwind=yes</parameter></term>
    135121        <listitem>
    136           <para>When building from hosts that include SELinux functionality
    137           (e.g., Fedora Core 3), Glibc will build with support for SELinux.
    138           As the LFS tools environment does not contain support for SELinux, a
    139           Glibc compiled with such support will fail to operate correctly.</para>
     122          <para>The build requires support for forced unwind, but because it is
     123          being cross compiled, it cannot auto detect it. Setting this variable
     124          on the command line explicitly tells the configure script that support
     125          is available.</para>
     126        </listitem>
     127      </varlistentry>
     128      <varlistentry>
     129        <term><parameter>libc_cv_c_cleanup=yes</parameter></term>
     130        <listitem>
     131          <para>The build also requires support for C cleanup handling, which it
     132          cannot auto detect when being cross compiled. Enable it explicitly.</para>
    140133        </listitem>
    141134      </varlistentry>
     
    168161    run at this time because we do not have a C++ compiler yet.</para>
    169162
    170     <para>The install stage of Glibc will issue a harmless warning at the
    171     end about the absence of <filename>/tools/etc/ld.so.conf</filename>.
    172     Prevent this warning with:</para>
    173 
    174 <screen><userinput remap="install">mkdir -v /tools/etc
    175 touch /tools/etc/ld.so.conf</userinput></screen>
    176 
    177163    <para>Install the package:</para>
    178164
  • chapter05/toolchaintechnotes.xml

    r6e88633 r4e82d47  
    1515  understand everything in this section. Most of this information will be
    1616  clearer after performing an actual build. This section can be referred
    17   back to at any time during the process.</para>
     17  to at any time during the process.</para>
    1818
    1919  <para>The overall goal of <xref linkend="chapter-temporary-tools"/> is to
     
    5555  <itemizedlist>
    5656    <listitem>
    57       <para>The process is similar in principle to cross-compiling, whereby
    58       tools installed in the same prefix work in cooperation, and thus utilize
    59       a little GNU <quote>magic</quote></para>
     57      <para>Slightly adjusting the name of the working platform ensures that
     58      the first build of Binutils and GCC produces a compatible cross-linker
     59      and cross-compiler. Instead of producing binaries for another architecture,
     60      the cross-linker and cross-compiler will produce binaries compatible with
     61      the current hardware.</para>
    6062    </listitem>
    6163    <listitem>
    62       <para>Careful manipulation of the standard linker's library search path
    63       ensures programs are linked only against chosen libraries</para>
     64      <para>The temporary libraries are cross-compiled. This removes all
     65      dependency on the host system, lessens the chance of headers or libraries
     66      from the host corrupting the new tools and allows for the possibility of
     67      building both 32-bit and 64-bit libraries on 64-bit capable hardware.</para>
    6468    </listitem>
    6569    <listitem>
  • chapter06/chapter06.xml

    r6e88633 r4e82d47  
    4949  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/>
    5050  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/>
    51   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/>
    5251  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/>
    5352  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/>
  • chapter06/creatingdirs.xml

    r6e88633 r4e82d47  
    2525  ln -sv share/{man,doc,info} $dir
    2626done
    27 ln -sv lib /lib64
    28 ln -sv lib /usr/lib64
     27case $(uname -m) in
     28 x86_64) ln -sv lib /lib64 &amp;&amp; ln -sv lib /usr/lib64 ;;
     29esac
    2930mkdir -v /var/{lock,log,mail,run,spool}
    3031mkdir -pv /var/{opt,cache,lib/{misc,locate},local}</userinput></screen>
  • chapter06/readjusting.xml

    r6e88633 r4e82d47  
    3434
    3535  <para>Next, amend the GCC specs file so that it points to the new
    36   dynamic linker, and so that GCC knows where to find the correct headers
    37   and Glibc start files. A <command>sed</command> command accomplishes
    38   this:</para>
     36  dynamic linker. Simply deleting all instances of <quote>/tools</quote> should
     37  leave us with the correct path to the dynamic linker. Also adjust the specs file
     38  so that GCC knows where to find the correct headers and Glibc start files.
     39  A <command>sed</command> command accomplishes this:</para>
    3940
    4041<screen><userinput>gcc -dumpspecs | sed -e 's@/tools@@g' \
  • chapter08/grub.xml

    r6e88633 r4e82d47  
    66]>
    77
    8 <sect1 id="ch-bootable-grub">
     8<sect1 id="ch-bootable-grub" role="wrap">
    99  <?dbhtml filename="grub.html"?>
    1010
    11   <title>Making the LFS System Bootable</title>
     11  <sect1info condition="script">
     12    <productname>grub</productname>
     13    <productnumber>&grub-version;</productnumber>
     14    <address>&grub-url;</address>
     15  </sect1info>
     16
     17  <title>GRUB-&grub-version;</title>
    1218
    1319  <indexterm zone="ch-bootable-grub">
    1420    <primary sortas="a-Grub">GRUB</primary>
    15     <secondary>configuring</secondary>
    1621  </indexterm>
    1722
    18   <para>Your shiny new LFS system is almost complete. One of the last
    19   things to do is to ensure that the system can be properly booted. The
    20   instructions below apply only to computers of IA-32 architecture,
    21   meaning mainstream PCs. Information on <quote>boot loading</quote> for
    22   other architectures should be available in the usual resource-specific
    23   locations for those architectures.</para>
    24 
    25   <para>Boot loading can be a complex area, so a few cautionary
    26   words are in order. Be familiar with the current boot loader and any other
    27   operating systems present on the hard drive(s) that need to be
    28   bootable. Make sure that an emergency boot disk is ready to
    29   <quote>rescue</quote> the computer if the computer becomes
    30   unusable (un-bootable).</para>
    31 
    32   <para>Earlier, we compiled and installed the GRUB boot loader software
    33   in preparation for this step. The procedure involves writing some
    34   special GRUB files to specific locations on the hard drive. We highly
    35   recommend creating a GRUB boot floppy diskette as a backup. Insert a
    36   blank floppy diskette and run the following commands:</para>
     23  <sect2 role="package">
     24    <title/>
     25
     26    <para>The GRUB package contains the GRand Unified Bootloader.</para>
     27
     28    <segmentedlist>
     29      <segtitle>&buildtime;</segtitle>
     30      <segtitle>&diskspace;</segtitle>
     31
     32      <seglistitem>
     33        <seg>&grub-ch6-sbu;</seg>
     34        <seg>&grub-ch6-du;</seg>
     35      </seglistitem>
     36    </segmentedlist>
     37
     38  </sect2>
     39
     40  <sect2 role="installation">
     41    <title>Installation of GRUB</title>
     42
     43    <caution>
     44      <para>This package will only build for x86 and x86_64 architectures
     45      containing 32-bit libs. If you chose to build on x86_64 without 32-bit
     46      libriaries (no multilib), then you must use LILO instead.</para>
     47    </caution>
     48
     49    <para>This package is known to have issues when its default
     50    optimization flags (including the <parameter>-march</parameter> and
     51    <parameter>-mcpu</parameter> options) are changed. If any environment
     52    variables that override default optimizations have been defined, such
     53    as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
     54    unset them when building GRUB.</para>
     55
     56    <para>Start by applying the following patch to allow for better drive
     57    detection, fix some GCC 4.x issues, and provide better SATA support
     58    for some disk controllers:</para>
     59
     60<screen><userinput remap="pre">patch -Np1 -i ../&grub-geometry-patch;</userinput></screen>
     61
     62    <para>By default, GRUB doesn't support ext2 filesystems with 256-byte inodes.
     63    Fix this by applying the following patch:</para>
     64
     65<screen><userinput remap="pre">patch -Np1 -i ../&grub-inode-patch;</userinput></screen>
     66
     67    <para>Prepare GRUB for compilation:</para>
     68
     69<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     70
     71    <para>Compile the package:</para>
     72
     73<screen><userinput remap="make">make</userinput></screen>
     74
     75    <para>To test the results, issue:</para>
     76
     77<screen><userinput remap="test">make check</userinput></screen>
     78
     79    <para>Install the package:</para>
     80
     81<screen><userinput remap="install">make install
     82mkdir -v /boot/grub
     83cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen>
     84
     85    <para>Replace <filename class="directory">i386-pc</filename> with whatever
     86    directory is appropriate for the hardware in use.</para>
     87
     88    <para>The <filename class="directory">i386-pc</filename> directory
     89    contains a number of <filename>*stage1_5</filename> files, different
     90    ones for different file systems. Review the files available and copy
     91    the appropriate ones to the <filename
     92    class="directory">/boot/grub</filename> directory. Most users will
     93    copy the <filename>e2fs_stage1_5</filename> and/or
     94    <filename>reiserfs_stage1_5</filename> files.</para>
     95
     96  </sect2>
     97
     98  <sect2 role="configuration">
     99    <title>Configuring GRUB</title>
     100
     101    <para>Your shiny new LFS system is almost complete. One of the last
     102    things to do is to ensure that the system can be properly booted. The
     103    instructions below apply only to computers of IA-32 architecture,
     104    meaning mainstream PCs. Information on <quote>boot loading</quote> for
     105    other architectures should be available in the usual resource-specific
     106    locations for those architectures.</para>
     107
     108    <para>Boot loading can be a complex area, so a few cautionary
     109    words are in order. Be familiar with the current boot loader and any other
     110    operating systems present on the hard drive(s) that need to be
     111    bootable. Make sure that an emergency boot disk is ready to
     112    <quote>rescue</quote> the computer if the computer becomes
     113    unusable (un-bootable).</para>
     114
     115    <para>Earlier, we compiled and installed the GRUB boot loader software
     116    in preparation for this step. The procedure involves writing some
     117    special GRUB files to specific locations on the hard drive. We highly
     118    recommend creating a GRUB boot floppy diskette as a backup. Insert a
     119    blank floppy diskette and run the following commands:</para>
    37120
    38121<screen><userinput>dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
    39122dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1</userinput></screen>
    40123
    41   <para>Remove the diskette and store it somewhere safe. Now, run the
    42   <command>grub</command> shell:</para>
     124    <para>Remove the diskette and store it somewhere safe. Now, run the
     125    <command>grub</command> shell:</para>
    43126
    44127<screen><userinput>grub</userinput></screen>
    45128
    46   <para>GRUB uses its own naming structure for drives and partitions in
    47   the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis>
    48   is the hard drive number and <emphasis>m</emphasis> is the partition
    49   number, both starting from zero. For example, partition <filename
    50   class="partition">hda1</filename> is <emphasis>(hd0,0)</emphasis> to
    51   GRUB and <filename class="partition">hdb3</filename> is
    52   <emphasis>(hd1,2)</emphasis>. In contrast to Linux, GRUB does not
    53   consider CD-ROM drives to be hard drives. For example, if using a CD
    54   on <filename class="partition">hdb</filename> and a second hard drive
    55   on <filename class="partition">hdc</filename>, that second hard drive
    56   would still be <emphasis>(hd1)</emphasis>.</para>
    57 
    58   <para>Using the above information, determine the appropriate
    59   designator for the root partition (or boot partition, if a separate
    60   one is used). For the following example, it is assumed that the root
    61   (or separate boot) partition is <filename
    62   class="partition">hda4</filename>.</para>
    63 
    64   <para>Tell GRUB where to search for its
    65   <filename>stage{1,2}</filename> files. The Tab key can be used
    66   everywhere to make GRUB show the alternatives:</para>
     129    <para>GRUB uses its own naming structure for drives and partitions in
     130    the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis>
     131    is the hard drive number and <emphasis>m</emphasis> is the partition
     132    number, both starting from zero. For example, partition <filename
     133    class="partition">hda1</filename> is <emphasis>(hd0,0)</emphasis> to
     134    GRUB and <filename class="partition">hdb3</filename> is
     135    <emphasis>(hd1,2)</emphasis>. In contrast to Linux, GRUB does not
     136    consider CD-ROM drives to be hard drives. For example, if using a CD
     137    on <filename class="partition">hdb</filename> and a second hard drive
     138    on <filename class="partition">hdc</filename>, that second hard drive
     139    would still be <emphasis>(hd1)</emphasis>.</para>
     140
     141    <para>Using the above information, determine the appropriate
     142    designator for the root partition (or boot partition, if a separate
     143    one is used). For the following example, it is assumed that the root
     144    (or separate boot) partition is <filename
     145    class="partition">hda4</filename>.</para>
     146
     147    <para>Tell GRUB where to search for its
     148    <filename>stage{1,2}</filename> files. The Tab key can be used
     149    everywhere to make GRUB show the alternatives:</para>
    67150
    68151<screen><userinput>root (hd0,3)</userinput></screen>
    69152
    70   <warning>
    71     <para>The following command will overwrite the current boot loader. Do not
    72     run the command if this is not desired, for example, if using a third party
    73     boot manager to manage the Master Boot Record (MBR). In this scenario, it
    74     would make more sense to install GRUB into the <quote>boot sector</quote>
    75     of the LFS partition. In this case, this next command would become
    76     <userinput>setup (hd0,3)</userinput>.</para>
    77   </warning>
    78 
    79   <para>Tell GRUB to install itself into the MBR of
    80   <filename class="partition">hda</filename>:</para>
     153    <warning>
     154      <para>The following command will overwrite the current boot loader. Do not
     155      run the command if this is not desired, for example, if using a third party
     156      boot manager to manage the Master Boot Record (MBR). In this scenario, it
     157      would make more sense to install GRUB into the <quote>boot sector</quote>
     158      of the LFS partition. In this case, this next command would become
     159      <userinput>setup (hd0,3)</userinput>.</para>
     160    </warning>
     161
     162    <para>Tell GRUB to install itself into the MBR of
     163    <filename class="partition">hda</filename>:</para>
    81164
    82165<screen><userinput>setup (hd0)</userinput></screen>
    83166
    84   <para>If all went well, GRUB will have reported finding its files in
    85   <filename class="directory">/boot/grub</filename>. That's all there is
    86   to it. Quit the <command>grub</command> shell:</para>
     167    <para>If all went well, GRUB will have reported finding its files in
     168    <filename class="directory">/boot/grub</filename>. That's all there is
     169    to it. Quit the <command>grub</command> shell:</para>
    87170
    88171<screen><userinput>quit</userinput></screen>
    89172
    90   <para>Create a <quote>menu list</quote> file defining GRUB's boot menu:</para>
     173    <para>Create a <quote>menu list</quote> file defining GRUB's boot menu:</para>
    91174
    92175<screen><userinput>cat &gt; /boot/grub/menu.lst &lt;&lt; "EOF"
     
    108191EOF</userinput></screen>
    109192
    110   <para>Add an entry for the host distribution if desired. It might look
    111   like this:</para>
     193    <para>Add an entry for the host distribution if desired. It might look
     194    like this:</para>
    112195
    113196<screen><userinput>cat &gt;&gt; /boot/grub/menu.lst &lt;&lt; "EOF"
     
    118201EOF</userinput></screen>
    119202
    120   <para>If dual-booting Windows, the following entry will allow
    121   booting it:</para>
     203    <para>If dual-booting Windows, the following entry will allow
     204    booting it:</para>
    122205
    123206<screen><userinput>cat &gt;&gt; /boot/grub/menu.lst &lt;&lt; "EOF"
     
    127210EOF</userinput></screen>
    128211
    129   <para>If <command>info grub</command> does not provide all necessary material,
    130   additional information regarding GRUB is located on its website at:
    131   <ulink url="http://www.gnu.org/software/grub/"/>.</para>
    132 
    133   <para>The FHS stipulates that GRUB's <filename>menu.lst</filename> file should
    134   be symlinked to <filename class="symlink">/etc/grub/menu.lst</filename>. To
    135   satisfy this requirement, issue the following command:</para>
     212    <para>If <command>info grub</command> does not provide all necessary material,
     213    additional information regarding GRUB is located on its website at:
     214    <ulink url="http://www.gnu.org/software/grub/"/>.</para>
     215
     216    <para>The FHS stipulates that GRUB's <filename>menu.lst</filename> file should
     217    be symlinked to <filename class="symlink">/etc/grub/menu.lst</filename>. To
     218    satisfy this requirement, issue the following command:</para>
    136219
    137220<screen><userinput>mkdir -v /etc/grub
    138221ln -sv /boot/grub/menu.lst /etc/grub</userinput></screen>
    139222
     223  </sect2>
     224
     225  <sect2 id="contents-gRUB" role="content">
     226    <title>Contents of GRUB</title>
     227
     228    <segmentedlist>
     229      <segtitle>Installed programs</segtitle>
     230
     231      <seglistitem>
     232        <seg>grub, grub-install, grub-md5-crypt, grub-set-default,
     233        grub-terminfo, and mbchk</seg>
     234      </seglistitem>
     235    </segmentedlist>
     236
     237    <variablelist>
     238      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
     239      <?dbfo list-presentation="list"?>
     240      <?dbhtml list-presentation="table"?>
     241
     242      <varlistentry id="grub">
     243        <term><command>grub</command></term>
     244        <listitem>
     245          <para>The Grand Unified Bootloader's command shell</para>
     246          <indexterm zone="ch-bootable-grub grub">
     247            <primary sortas="b-grub">grub</primary>
     248          </indexterm>
     249        </listitem>
     250      </varlistentry>
     251
     252      <varlistentry id="grub-install">
     253        <term><command>grub-install</command></term>
     254        <listitem>
     255          <para>Installs GRUB on the given device</para>
     256          <indexterm zone="ch-bootable-grub grub-install">
     257            <primary sortas="b-grub-install">grub-install</primary>
     258          </indexterm>
     259        </listitem>
     260      </varlistentry>
     261
     262      <varlistentry id="grub-md5-crypt">
     263        <term><command>grub-md5-crypt</command></term>
     264        <listitem>
     265          <para>Encrypts a password in MD5 format</para>
     266          <indexterm zone="ch-bootable-grub grub-md5-crypt">
     267            <primary sortas="b-grub-md5-crypt">grub-md5-crypt</primary>
     268          </indexterm>
     269        </listitem>
     270      </varlistentry>
     271
     272      <varlistentry id="grub-set-default">
     273        <term><command>grub-set-default</command></term>
     274        <listitem>
     275          <para>Sets the default boot entry for GRUB</para>
     276          <indexterm zone="ch-bootable-grub grub-set-default">
     277            <primary sortas="b-grub-set-default">grub-set-default</primary>
     278          </indexterm>
     279        </listitem>
     280      </varlistentry>
     281
     282      <varlistentry id="grub-terminfo">
     283        <term><command>grub-terminfo</command></term>
     284        <listitem>
     285          <para>Generates a terminfo command from a terminfo name; it can be
     286          employed if an unknown terminal is being used</para>
     287          <indexterm zone="ch-bootable-grub grub-terminfo">
     288            <primary sortas="b-grub-terminfo">grub-terminfo</primary>
     289          </indexterm>
     290        </listitem>
     291      </varlistentry>
     292
     293      <varlistentry id="mbchk">
     294        <term><command>mbchk</command></term>
     295        <listitem>
     296          <para>Checks the format of a multi-boot kernel</para>
     297          <indexterm zone="ch-bootable-grub mbchk">
     298            <primary sortas="b-mbchk">mbchk</primary>
     299          </indexterm>
     300        </listitem>
     301      </varlistentry>
     302
     303    </variablelist>
     304
     305  </sect2>
     306
    140307</sect1>
  • general.ent

    r6e88633 r4e82d47  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!ENTITY version "SVN-20081203">
    3 <!ENTITY releasedate "December 3, 2008">
     2<!ENTITY version "SVN-20081204">
     3<!ENTITY releasedate "December 4, 2008">
    44<!ENTITY copyrightdate "1999-2008"><!-- jhalfs needs a literal dash, not &ndash; -->
    55<!ENTITY milestone "7.0">
  • patches.ent

    r6e88633 r4e82d47  
    5858<!ENTITY expect-tcl-patch-size "4.1 KB">
    5959
     60<!ENTITY gcc-startfiles-patch "gcc-&gcc-version;-startfiles_fix-1.patch">
     61<!ENTITY gcc-startfiles-patch-md5 "799ef1971350d2e3c794f2123f247cc6">
     62<!ENTITY gcc-startfiles-patch-size "1.5 KB">
    6063
    6164<!ENTITY glibc-iconv-test-fixes-patch "glibc-&glibc-version;-iconv_tests-1.patch">
Note: See TracChangeset for help on using the changeset viewer.