Changeset 6dfcfecc for chapter04


Ignore:
Timestamp:
03/31/2021 10:41:39 AM (3 years ago)
Author:
Xℹ Ruoyao <xry111@…>
Branches:
ml-11.0, multilib
Children:
7610848
Parents:
811b5a39
git-author:
Thomas Trepl <thomas@…> (06/29/2020 07:55:01 AM)
git-committer:
Xℹ Ruoyao <xry111@…> (03/31/2021 10:41:39 AM)
Message:

Update to new lfs structure

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@11986 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Location:
chapter04
Files:
1 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • chapter04/aboutsbus.xml

    r811b5a39 r6dfcfecc  
    2121
    2222  <para>The SBU measure works as follows. The first package to be compiled
    23   from this book is Binutils in <xref linkend="chapter-temporary-tools"/>. The
     23  from this book is binutils in <xref linkend="chapter-cross-tools"/>. The
    2424  time it takes to compile this package is what will be referred to as the
    2525  Standard Build Unit or SBU. All other compile times will be expressed relative
     
    2828  <para>For example, consider a package whose compilation time is 4.5
    2929  SBUs. This means that if a system took 10 minutes to compile and
    30   install the first pass of Binutils, it will take
     30  install the first pass of binutils, it will take
    3131  <emphasis>approximately</emphasis> 45 minutes to build this example package.
    32   Fortunately, most build times are shorter than the one for Binutils.</para>
     32  Fortunately, most build times are shorter than the one for binutils.</para>
    3333
    3434  <para>In general, SBUs are not entirely accurate because they depend on many
     
    4242    make" by either setting an environment variable or telling the
    4343    <command>make</command> program how many processors are available.  For
    44     instance, a Core2Duo can support two simultaneous processes with:</para>
     44    instance, an Intel i5-6500 CPU can support four simultaneous processes with:</para>
    4545
    46     <screen role="nodump"><userinput>export MAKEFLAGS='-j 2'</userinput></screen>
     46    <screen role="nodump"><userinput>export MAKEFLAGS='-j4'</userinput></screen>
    4747
    4848    <para>or just building with:</para>
    4949
    50     <screen role="nodump"><userinput>make -j2</userinput></screen>
     50    <screen role="nodump"><userinput>make -j4</userinput></screen>
    5151
    5252    <para>When multiple processors are used in this way, the SBU units in the
  • chapter04/abouttestsuites.xml

    r811b5a39 r6dfcfecc  
    1919
    2020  <para>Some test suites are more important than others. For example,
    21   the test suites for the core toolchain packages&mdash;GCC, Binutils, and
    22   Glibc&mdash;are of the utmost importance due to their central role in a
    23   properly functioning system. The test suites for GCC and Glibc can
     21  the test suites for the core toolchain packages&mdash;GCC, binutils, and
     22  glibc&mdash;are of the utmost importance due to their central role in a
     23  properly functioning system. The test suites for GCC and glibc can
    2424  take a very long time to complete, especially on slower hardware, but
    2525  are strongly recommended.</para>
    2626
    2727  <note>
    28     <para>Experience has shown that there is little to be gained from running
    29     the test suites in <xref linkend="chapter-temporary-tools"/>. There can be
    30     no escaping the fact that the host system always exerts some influence on
    31     the tests in that chapter, often causing inexplicable failures. Because
    32     the tools built in <xref linkend="chapter-temporary-tools"/> are temporary
    33     and eventually discarded, we do not recommend running the test suites in
    34     <xref linkend="chapter-temporary-tools"/> for the average reader. The
    35     instructions for running those test suites are provided for the benefit of
    36     testers and developers, but they are strictly optional.</para>
     28    <para>Running the test suites in <xref linkend="chapter-cross-tools"/>
     29    and <xref linkend="chapter-temporary-tools"/>
     30    is impossible, since the programs are compiled with a cross-compiler,
     31    so are not supposed to be able to run on the build host.</para>
    3732  </note>
    3833
    39   <para>A common issue with running the test suites for Binutils and GCC
     34  <para>A common issue with running the test suites for binutils and GCC
    4035  is running out of pseudo terminals (PTYs). This can result in a high
    4136  number of failing tests. This may happen for several reasons, but the
  • chapter04/addinguser.xml

    r811b5a39 r6dfcfecc  
    1212
    1313  <para>When logged in as user <systemitem class="username">root</systemitem>,
    14   making a single mistake can damage or destroy a system. Therefore, we
    15   recommend building the packages in the next chapter as an unprivileged user.
     14  making a single mistake can damage or destroy a system. Therefore,
     15  the packages in the next two chapters are built as an unprivileged user.
    1616  You could use your own user name, but to make it easier to set up a clean
    1717  working environment, create a new user called <systemitem
     
    6363      <term><parameter>lfs</parameter></term>
    6464      <listitem>
    65         <para>This is the actual name for the created group and user.</para>
     65        <para>This is the actual name for the created user.</para>
    6666      </listitem>
    6767    </varlistentry>
     
    7878
    7979  <para>Grant <systemitem class="username">lfs</systemitem> full access to
    80   <filename class="directory">$LFS/tools</filename> by making
     80  all directories under <filename class="directory">$LFS</filename> by making
    8181  <systemitem class="username">lfs</systemitem> the directory owner:</para>
    8282
    83 <screen><userinput>chown -v lfs $LFS/tools</userinput></screen>
     83<screen><userinput>chown -v lfs $LFS/{usr,lib,var,etc,bin,sbin,tools}
     84case $(uname -m) in
     85  x86_64) chown -v lfs $LFS/lib64 ;;
     86esac</userinput></screen>
     87<screen arch="ml_32"  ><userinput>chown -v lfs $LFS&lib-m32;</userinput></screen>
     88<screen arch="ml_x32" ><userinput>chown -v lfs $LFS&lib-mx32;</userinput></screen>
     89<screen arch="ml_all" ><userinput>chown -v lfs $LFS/{lib32,libx32}</userinput></screen>
    8490
    8591  <para>If a separate working directory was created as suggested, give
     
    96102  <para>Next, login as user <systemitem class="username">lfs</systemitem>.
    97103  This can be done via a virtual console, through a display manager, or with
    98   the following substitute user command:</para>
     104  the following substitute/switch user command:</para>
    99105
    100106<screen role="nodump"><userinput>su - lfs</userinput></screen>
  • chapter04/chapter04.xml

    r811b5a39 r6dfcfecc  
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
    1515  <!--<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutlfs.xml"/>-->
    16   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingtoolsdir.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingminlayout.xml"/>
    1717  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="addinguser.xml"/>
    1818  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="settingenviron.xml"/>
  • chapter04/introduction.xml

    r811b5a39 r6dfcfecc  
    1212
    1313  <para>In this chapter, we will perform a few additional tasks to prepare
    14   for building the temporary system. We will create a directory in
     14  for building the temporary system. We will create a set of directories in
    1515  <filename class="directory">$LFS</filename> for the installation of the
    1616  temporary tools, add an unprivileged user to reduce risk,
  • chapter04/settingenviron.xml

    r811b5a39 r6dfcfecc  
    4444LC_ALL=POSIX
    4545LFS_TGT=$(uname -m)-lfs-linux-gnu
    46 PATH=/tools/bin:/bin:/usr/bin
     46PATH=/usr/bin
     47if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
     48PATH=$LFS/tools/bin:$PATH
    4749export LFS LC_ALL LFS_TGT PATH</literal>
    4850EOF</userinput></screen>
     
    5557LFS_TGT32=i686-lfs-linux-gnu
    5658LFS_TGTX32=x86_64-lfs-linux-gnux32
    57 PATH=/tools/bin:/bin:/usr/bin
     59PATH=/usr/bin
     60if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
     61PATH=$LFS/tools/bin:$PATH
    5862export LFS LC_ALL LFS_TGT LFS_TGT32 LFS_TGTX32 PATH</literal>
    5963EOF</userinput></screen>
    6064
    6165  <variablelist>
    62     <title>The meaning of the command line options in <filename>.bashrc</filename></title>
     66    <title>The meaning of the settings in <filename>.bashrc</filename></title>
    6367
    6468    <varlistentry>
     
    120124
    121125    <varlistentry>
    122       <term><parameter>PATH=/tools/bin:/bin:/usr/bin</parameter></term>
    123       <listitem>
    124   <para>By putting <filename class="directory">/tools/bin</filename> ahead of the
    125   standard <envar>PATH</envar>, all the programs installed in <xref
    126   linkend="chapter-temporary-tools"/> are picked up by the shell immediately after
    127   their installation. This, combined with turning off hashing, limits the risk
    128   that old programs are used from the host when the same programs are available in
    129   the Chapter 5 environment.</para>
     126      <term><parameter>PATH=/usr/bin</parameter></term>
     127      <listitem>
     128  <para>Many modern linux distributions have merged <filename
     129  class="directory">/bin</filename> and <filename
     130  class="directory">/usr/bin</filename>. When this is the case, the standard
     131  <envar>PATH</envar> variable needs just to be set to <filename
     132  class="directory">/usr/bin/</filename> for the <xref
     133  linkend="chapter-temporary-tools"/> environment. When this is not the
     134  case, the following line adds <filename class="directory">/bin</filename>
     135  to the path.</para>
     136      </listitem>
     137    </varlistentry>
     138
     139    <varlistentry>
     140      <term><parameter>if [ ! -L /bin ]; then PATH=/bin:$PATH; fi</parameter></term>
     141      <listitem>
     142  <para>If <filename class="directory">/bin</filename> is not a symbolic
     143  link, then it has to be added to the <envar>PATH</envar> variable.</para>
     144      </listitem>
     145    </varlistentry>
     146
     147    <varlistentry>
     148      <term><parameter>PATH=$LFS/tools/bin:$PATH</parameter></term>
     149      <listitem>
     150  <para>By putting <filename class="directory">$LFS/tools/bin</filename> ahead of the
     151  standard <envar>PATH</envar>, the cross-compiler installed at the beginning
     152  of <xref linkend="chapter-cross-tools"/> is picked up by the shell
     153  immediately after its installation. This, combined with turning off hashing,
     154  limits the risk that the compiler from the host be used instead of the
     155  cross-compiler.</para>
    130156      </listitem>
    131157    </varlistentry>
     
    135161      <listitem>
    136162        <para>While the above commands have set some variables, in order
    137         to make them visible within any sub-shells, we export them</para>
     163        to make them visible within any sub-shells, we export them.</para>
    138164      </listitem>
    139165    </varlistentry>
    140166
    141167  </variablelist>
     168
     169  <important>
     170
     171     <para>Several commercial distributions add a non-documented instantiation
     172     of <filename>/etc/bash.bashrc</filename> to the initialization of
     173     <command>bash</command>. This file has the potential to modify the
     174     <systemitem class="username">lfs</systemitem>
     175     user's environment in ways that can affect the building of critical LFS
     176     packages. To make sure the <systemitem class="username">lfs</systemitem>
     177     user's envronment is clean, check for the
     178     presence of <filename>/etc/bash.bashrc</filename> and, if present, move it
     179     out of the way.  As the <systemitem class="username">root</systemitem>
     180     user, run:</para>
     181
     182     <screen role="nodump"><userinput>[ ! -e /etc/bash.bashrc ] || mv -v /etc/bash.bashrc /etc/bash.bashrc.NOUSE</userinput></screen>
     183
     184     <para>After use of the <systemitem class="username">lfs</systemitem>
     185     user is finished at the beginning of <xref
     186     linkend="chapter-chroot-temporary-tools"/>, you can restore
     187         <filename>/etc/bash.bashrc</filename> (if desired).</para>
     188
     189     <para>Note that the LFS Bash package we will build in
     190     <xref linkend="ch-system-bash"/> is not configured to load or execute
     191     <filename>/etc/bash.bashrc</filename>, so this file is useless on a
     192     completed LFS system.</para>
     193  </important>
    142194
    143195  <para>Finally, to have the environment fully prepared for building the
Note: See TracChangeset for help on using the changeset viewer.