Changeset 675606b


Ignore:
Timestamp:
06/16/2020 11:56:28 AM (18 months ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, ml-11.0, multilib, trunk, xry111/git-transition, xry111/glibc-2.34, xry111/tester-nohack, xry111/usr-move
Children:
9a05e45
Parents:
560065f (diff), 1cd5961 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Split Chapter 5 into three separate chapters.
Implement a new method of cross-building the LFS tool chain
and other tools to simplify the method of isolating the
new system from the original host. This will be the start of
LFS-10.0.

Move old trunk/BOOK to branches/old-trunk.

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

Files:
27 added
24 deleted
56 edited
93 moved

Legend:

Unmodified
Added
Removed
  • Makefile

    r560065f r675606b  
    2727  PDF_OUTPUT      ?= LFS-BOOK.pdf
    2828  NOCHUNKS_OUTPUT ?= LFS-BOOK.html
    29   DUMPDIR         ?= ~/lfs-commands
     29  DUMPDIR         ?= ~/cross-lfs-commands
    3030else
    3131  BASEDIR         ?= ~/lfs-systemd
     
    4747        $(Q)mkdir -p $(BASEDIR)/stylesheets
    4848        $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
    49         $(Q)pushd $(BASEDIR)/ > /dev/null;                     \
    50 #       sed -i -e "s@../stylesheets@stylesheets@g" *.html; \
    51        popd > /dev/null
    5249
    5350        $(Q)mkdir -p $(BASEDIR)/images
  • appendices/dependencies.xml

    r560065f r675606b  
    829829      </segmentedlist>
    830830
    831 <!-- Begin Gcc dependency info -->
    832   <bridgehead renderas="sect2" id="gcc-dep">Gcc</bridgehead>
     831<!-- Begin GCC dependency info -->
     832  <bridgehead renderas="sect2" id="gcc-dep">GCC</bridgehead>
    833833
    834834      <segmentedlist>
     
    19491949
    19501950        <seglistitem>
    1951          <seg>Binutils, Coreutils, Gcc, and Python</seg>
     1951         <seg>Binutils, Coreutils, GCC, and Python</seg>
    19521952        </seglistitem>
    19531953      </segmentedlist>
     
    19841984
    19851985        <seglistitem>
    1986          <seg>Binutils, Coreutils, Gcc, Make, and Perl</seg>
     1986         <seg>Binutils, Coreutils, GCC, Make, and Perl</seg>
    19871987        </seglistitem>
    19881988      </segmentedlist>
  • chapter01/changelog.xml

    r560065f r675606b  
    4545
    4646    <listitem>
     47      <para>2020-06-16</para>
     48      <itemizedlist>
     49        <listitem>
     50          <para>[bdubbs] - Split Chapter 5 into three separate chapters.
     51          Implement a new method of cross-building the LFS tool chain
     52          and other tools to simplify the method of isolating the
     53          new system from the original host.  This will be the start of
     54          LFS-10.0.</para>
     55        </listitem>
     56      </itemizedlist>
     57    </listitem>
     58
     59    <listitem>
    4760      <para>2020-06-03</para>
    4861      <itemizedlist>
     
    213226          <para>[pierre] - Pass -Wno-format-overflow to systemd to
    214227          prevent an error with GCC 10.</para>
     228        </listitem>
     229      </itemizedlist>
     230    </listitem>
     231
     232    <listitem>
     233      <para>2020-05-09</para>
     234      <itemizedlist>
     235        <listitem>
     236          <para>[pierre] - Patch GCC pass 2 to allow cross-compile
     237          (specific to new cross method).</para>
    215238        </listitem>
    216239      </itemizedlist>
  • chapter01/how.xml

    r560065f r675606b  
    4545  <xref linkend="chapter-final-preps"/> carefully as it explains several
    4646  important issues you need be aware of before beginning to
    47   work your way through <xref linkend="chapter-temporary-tools"/> and beyond.</para>
     47  work your way through <xref linkend="chapter-cross-tools"/> and beyond.</para>
    4848
    49   <para><xref linkend="chapter-temporary-tools"/> explains the
    50   installation of a number of packages that will form the basic
    51   development suite (or toolchain) which is used to build the actual
    52   system in <xref linkend="chapter-building-system"/>. Some of these
    53   packages are needed to resolve circular dependencies&mdash;for example,
    54   to compile a compiler, you need a compiler.</para>
     49  <para><xref linkend="chapter-cross-tools"/>,  explains the installation of
     50  the initial tool chain, (binutils, gcc, and glibc) using cross compilation
     51  techniques to isolate the new tools from the host system.</para>
    5552
    56   <para><xref linkend="chapter-temporary-tools"/> also shows you how to
    57   build a first pass of the toolchain, including Binutils and GCC (first pass
    58   basically means these two core packages will be reinstalled).
    59   The next step is to build Glibc, the C library. Glibc will be compiled by
    60   the toolchain programs built in the first pass. Then, a second pass of the
    61   toolchain will be built. This time, the toolchain will be dynamically linked
    62   against the newly built Glibc. The remaining <xref
    63   linkend="chapter-temporary-tools"/> packages are built using this second
    64   pass toolchain. When this is done, the LFS installation process will no
    65   longer depend on the host distribution, with the exception of the running
    66   kernel. </para>
     53  <para><xref linkend="chapter-temporary-tools"/> shows you how to
     54  cross-compile basic utilities using the just built cross-toolchain.</para>
     55
     56  <para><xref linkend="chapter-chroot-temporary-tools"/> then enters a
     57  "chroot" environment and uses the previously built tools to build
     58  the additional tools needed to build and test the final system.</para>
    6759
    6860  <para>This effort to isolate the new system from the host distribution may
    69   seem excessive. A full technical explanation as to why this is done is provided in
    70   <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
     61  seem excessive. A full technical explanation as to why this is done is
     62  provided in <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
    7163
    72   <para>In <xref linkend="chapter-building-system"/>, the full LFS system is
    73   built. The <command>chroot</command> (change root) program is used to enter
    74   a virtual environment and start a new shell whose root directory will be
    75   set to the LFS partition. This is very similar to rebooting and instructing
    76   the kernel to mount the LFS partition as the root partition. The system
    77   does not actually reboot, but instead uses <command>chroot</command> because
    78   creating a bootable system requires additional work which is not necessary
    79   just yet. The major advantage is that <quote>chrooting</quote> allows you
    80   to continue using the host system while LFS is being built. While waiting
    81   for package compilations to complete, you can continue using your computer as
    82   normal.</para>
     64  <para>In <xref linkend="chapter-building-system"/>, The
     65  full LFS system is built. Another advantage provided by the chroot
     66  environment is that it allows you to continue using the host system
     67  while LFS is being built. While waiting for package compilations to
     68  complete, you can continue using your computer as normal.</para>
    8369
    8470  <para>To finish the installation, the basic system configuration is set up in
  • chapter01/whatsnew.xml

    r560065f r675606b  
    1212  <title>What's new since the last release</title>
    1313
     14  <para>In this version of LFS, there has been a major reorganization
     15  of the book using techniques that avoid changing the host system
     16  and provides a more straight forward build process.</para>
     17
    1418  <para>Below is a list of package updates made since the previous
    1519  release of the book.</para>
  • chapter02/creatingfilesystem.xml

    r560065f r675606b  
    5353<screen role="nodump"><userinput>mkfs -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
    5454
    55 <!--
    5655  <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the LFS
    57   partition (<filename class="devicefile">sda5</filename> in our previous
    58   example).</para>
     56  partition.</para>
    5957
    60   <note>
    61     <para>Some host distributions use custom features in their filesystem
    62     creation tools (E2fsprogs). This can cause problems when booting into your new
    63     LFS in Chapter&nbsp;9, as those features will not be supported by the LFS-installed
    64     E2fsprogs; you will get an error similar to <quote>unsupported filesystem
    65     features, upgrade your e2fsprogs</quote>. To check if your host system
    66     uses custom enhancements, run the following command:</para>
    67 
    68 <screen role="nodump"><userinput>debugfs -R feature /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
    69 
    70     <para>If the output contains features other than
    71     <option>has_journal</option>, <option>ext_attr</option>,
    72     <option>resize_inode</option>, <option>dir_index</option>,
    73     <option>filetype</option>, <option>sparse_super</option>,
    74     <option>large_file</option> or <option>needs_recovery</option>, then your
    75     host system may have custom enhancements.  In that case, to avoid later
    76     problems, you should compile the stock E2fsprogs package and use the
    77     resulting binaries to re-create the filesystem on your LFS partition:</para>
    78 
    79 <screen role="nodump"><userinput>cd /tmp
    80 tar -xzvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.gz
    81 cd e2fsprogs-&e2fsprogs-version;
    82 mkdir -v build
    83 cd build
    84 ../configure
    85 make #note that we intentionally don't 'make install' here!
    86 ./misc/mke2fs -jv /dev/<replaceable>&lt;xxx&gt;</replaceable>
    87 cd /tmp
    88 rm -rfv e2fsprogs-&e2fsprogs-version;</userinput></screen>
    89   </note>
    90 -->
    9158  <para>If you are using an existing <systemitem class="filesystem">swap
    9259  </systemitem> partition, there is no need to format it. If a new
  • chapter02/creatingpartition.xml

    r560065f r675606b  
    1515  is to use an available empty partition or, if you have enough unpartitioned
    1616  space, to create one.</para>
    17 
    18 <!--
    19 
    20   <para>It is possible to install an LFS system (in fact even multiple LFS
    21   systems) on a partition already occupied by another
    22   operating system and the different systems will co-exist peacefully. The
    23   document <ulink url="&hints-root;lfs_next_to_existing_systems.txt"/>
    24   contains notes on how to implement this. This document was last updated
    25   in 2004. It has not been updated since and it has not been tested with
    26   recent versions of this LFS book. The document is more than likely not
    27   usable as-is and you will need to account for changes made to the LFS
    28   procedures since it was written. This is only recommended for expert LFS
    29   users.</para>
    30 
    31 -->
    3217
    3318  <para>A minimal system requires a partition of around 10 gigabytes (GB).
     
    7863
    7964  <para>Requests for advice on system partitioning are often posted on the LFS mailing
    80   lists.  This is a highly subjective topic.  The default for most distributions
     65  lists. This is a highly subjective topic.  The default for most distributions
    8166  is to use the entire drive with the exception of one small swap partition.  This
    8267  is not optimal for LFS for several reasons.  It reduces flexibility, makes
     
    9075    <para>A root LFS partition (not to be confused with the
    9176    <filename class="directory">/root</filename> directory) of
    92     ten gigabytes is a good compromise for most systems.  It provides enough
     77    twenty gigabytes is a good compromise for most systems.  It provides enough
    9378    space to build LFS and most of BLFS, but is small enough so that multiple
    9479    partitions can be easily created for experimentation.</para> </sect3>
     
    10388    swapping.</para>
    10489
    105     <para>Swapping is never good.  Generally you can tell if a system is
    106     swapping by just listening to disk activity and observing how the system
    107     reacts to commands.  The first reaction to swapping should be to check for
    108     an unreasonable command such as trying to edit a five gigabyte file.  If
    109     swapping becomes a normal occurrence, the best solution is to purchase more
    110     RAM for your system.</para>
    111     </sect3>
     90    <para>If you want to use the hibernation feature (suspend-to-disk) of Linux,
     91    it writes out the contents of RAM to the swap partition before turning off
     92    the machine. In this case the size of the swap partition should be at
     93    least as large as the system's installed RAM.</para>
     94
     95    <para>Swapping is never good. For mechanical hard drives you can generally
     96    tell if a system is swapping by just listening to disk activity and
     97    observing how the system reacts to commands.  For an SSD drive you will not
     98    be able to hear swapping but you can tell how much swap space is being used
     99    by the <command>top</command> or <command>free</command> programs.  Use of
     100    an SSD drive for a swap partition should be avoided if possible.  The first
     101    reaction to swapping should be to check for an unreasonable command such as
     102    trying to edit a five gigabyte file. If swapping becomes a normal
     103    occurrence, the best solution is to purchase more RAM for your
     104    system.</para> </sect3>
    112105
    113106    <sect3>
     
    141134      store kernels and other booting information.  To minimize potential boot
    142135      problems with larger disks, make this the first physical partition on
    143       your first disk drive.  A partition size of 100 megabytes is quite
     136      your first disk drive.  A partition size of 200 megabytes is quite
    144137      adequate.</para></listitem>
    145138
     
    151144      <listitem><para>/usr &ndash; A separate /usr partition is generally used
    152145      if providing a server for a thin client or diskless workstation.  It is
    153       normally not needed for LFS.  A size of five gigabytes will handle most
     146      normally not needed for LFS.  A size of ten gigabytes will handle most
    154147      installations.</para></listitem>
    155148
  • chapter02/stages.xml

    r560065f r675606b  
    2626    <itemizedlist>
    2727      <listitem>
    28          <para>Procedures done as the root user after Section 2.4 need to
    29          have the LFS environment variable set <emphasis>FOR THE ROOT
    30          USER</emphasis>.</para>
     28        <para>Procedures done as the root user after Section 2.4 need to
     29        have the LFS environment variable set <emphasis>FOR THE ROOT
     30        USER</emphasis>.</para>
    3131      </listitem>
    3232    </itemizedlist>
     
    3434 
    3535  <sect2>
    36   <title>Chapter&nbsp;5</title>
     36  <title>Chapter&nbsp;5&ndash;6</title>
     37
     38    <itemizedlist>
     39      <listitem>
     40        <para>The /mnt/lfs partition must be mounted.</para>
     41      </listitem>
     42
     43      <listitem>
     44        <para>Threse two chapters must be done as user <emphasis>lfs</emphasis>.
     45        A <command>su - lfs</command> needs to be done before any task in these
     46        chapters. Failing to do that, you are at risk of installing packages to the
     47        host, and potentially rendering it unusable.</para>
     48      </listitem>
     49
     50      <listitem>
     51         <para>The procedures in <xref linkend='ch-tools-generalinstructions'/>
     52         are critical.  If there is any
     53         doubt about installing a package, ensure any previously expanded
     54         tarballs are removed, then re-extract the package files, and complete all
     55         instructions in that section.</para>
     56      </listitem>
     57    </itemizedlist>
     58  </sect2>
     59
     60  <sect2>
     61  <title>Chapter&nbsp;7&ndash;10</title>
    3762
    3863    <itemizedlist>
     
    4267
    4368      <listitem>
    44          <para><emphasis>ALL</emphasis> instructions in Chapter&nbsp;5
    45          must be done by user <emphasis>lfs</emphasis>. 
    46          A  <command>su - lfs</command> needs to be done before any
    47          task in Chapter&nbsp;5.</para>
    48       </listitem>
    49 
    50       <listitem>
    51          <para>The procedures in <xref linkend='ch-tools-generalinstructions'/>
    52          are critical.  If there is any
    53          doubt about installing a package, ensure any previously expanded
    54          tarballs are removed, re-extract the package files, and complete all
    55          instructions in that section.</para>
    56       </listitem>
    57     </itemizedlist>
    58   </sect2>
    59 
    60   <sect2>
    61   <title>Chapters&nbsp;6&ndash;8</title>
    62 
    63     <itemizedlist>
    64       <listitem>
    65          <para>The /mnt/lfs partition must be mounted.</para>
     69        <para>A few operations, from <quote>Changing Ownership</quote> to
     70        <quote>Entering the Chroot Environment</quote> must be done as the
     71        root user, with the LFS envirnment variable set for the root user.</para>
    6672      </listitem>
    6773
    6874      <listitem>
    6975         <para> When entering chroot, the LFS environment variable must be set
    70          for root.  The LFS variable is not used otherwise.</para>
     76         for root. The LFS variable is not used afterwards.</para>
    7177      </listitem>
    7278
  • chapter03/patches.xml

    r560065f r675606b  
    5151      </listitem>
    5252    </varlistentry>
    53 <!--
    54     <varlistentry>
    55       <term>Flex Fixes Patch - <token>&flex-fixes-patch-size;</token>:</term>
    56       <listitem>
    57         <para>Download: <ulink url="&patches-root;&flex-fixes-patch;"/></para>
    58         <para>MD5 sum: <literal>&flex-fixes-patch-md5;</literal></para>
    59       </listitem>
    60     </varlistentry>
    61 -->
    62 <!--
    63     <varlistentry>
    64       <term>Gccc ASAN Patch - <token>&gcc-asan-patch-size;</token>:</term>
    65       <listitem>
    66         <para>Download: <ulink url="&patches-root;&gcc-asan-patch;"/></para>
    67         <para>MD5 sum: <literal>&gcc-asan-patch-md5;</literal></para>
    68       </listitem>
    69     </varlistentry>
    70 -->
     53
    7154    <varlistentry>
    7255      <term>Glibc FHS Patch - <token>&glibc-fhs-patch-size;</token>:</term>
     
    7659      </listitem>
    7760    </varlistentry>
    78 <!--
     61
    7962    <varlistentry>
    80       <term>Glibc Glob Security Patch - <token>&glibc-glob-patch-size;</token>:</term>
     63      <term>GCC Cross Build Fix Patch - <token>&gcc-cross-patch-size;</token>:</term>
    8164      <listitem>
    82         <para>Download: <ulink url="&patches-root;&glibc-glob-patch;"/></para>
    83         <para>MD5 sum: <literal>&glibc-glob-patch-md5;</literal></para>
     65        <para>Download: <ulink url="&patches-root;&gcc-cross-patch;"/></para>
     66        <para>MD5 sum: <literal>&gcc-cross-patch-md5;</literal></para>
    8467      </listitem>
    8568    </varlistentry>
    86 -->
     69
    8770    <varlistentry>
    8871      <term>Kbd Backspace/Delete Fix Patch - <token>&kbd-backspace-patch-size;</token>:</term>
     
    9275      </listitem>
    9376    </varlistentry>
    94 <!--
    95     <varlistentry>
    96       <term>Ninja Limit Jobs Patch - <token>&ninja-limit-jobs-patch-size;</token>:</term>
    97       <listitem>
    98         <para>Download: <ulink url="&patches-root;&ninja-limit-jobs-patch;"/></para>
    99         <para>MD5 sum: <literal>&ninja-limit-jobs-patch-md5;</literal></para>
    100       </listitem>
    101     </varlistentry>
    102 -->
    103 <!--
    104     <varlistentry>
    105       <term>Readline Upstream Fixes Patch - <token>&readline-fixes-patch-size;</token>:</term>
    106       <listitem>
    107         <para>Download: <ulink url="&patches-root;&readline-fixes-patch;"/></para>
    108         <para>MD5 sum: <literal>&readline-fixes-patch-md5;</literal></para>
    109       </listitem>
    110     </varlistentry>
    111 -->
     77
    11278    <varlistentry revision="sysv">
    11379      <term>Sysvinit Consolidated Patch - <token>&sysvinit-consolidated-patch-size;</token>:</term>
     
    11783      </listitem>
    11884    </varlistentry>
    119 <!--
    120     <varlistentry revision="systemd">
    121       <term>Systemd Consolidated Patch - <token>&systemd-consolidated-patch-size;</token>:</term>
    122       <listitem>
    123         <para>Download: <ulink url="&patches-root;&systemd-consolidated-patch;"/></para>
    124         <para>MD5 sum: <literal>&systemd-consolidated-patch-md5;</literal></para>
    125       </listitem>
    126     </varlistentry>
    127 -->
    12885
    12986    <varlistentry revision="systemd">
  • chapter04/aboutsbus.xml

    r560065f r675606b  
    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

    r560065f r675606b  
    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

    r560065f r675606b  
    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>
    8487
    8588  <para>If a separate working directory was created as suggested, give
     
    9699  <para>Next, login as user <systemitem class="username">lfs</systemitem>.
    97100  This can be done via a virtual console, through a display manager, or with
    98   the following substitute user command:</para>
     101  the following substitute/switch user command:</para>
    99102
    100103<screen role="nodump"><userinput>su - lfs</userinput></screen>
  • chapter04/chapter04.xml

    r560065f r675606b  
    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

    r560065f r675606b  
    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

    r560065f r675606b  
    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>
    4951
    5052  <variablelist>
    51     <title>The meaning of the command line options in <filename>.bashrc</filename></title>
     53    <title>The meaning of the settings in <filename>.bashrc</filename></title>
    5254
    5355    <varlistentry>
     
    6264  the shell will always search the <envar>PATH</envar> when a program is to
    6365  be run. As such, the shell will find the newly compiled tools in
    64   <filename class="directory">$LFS/tools</filename> as soon as they are
     66  <filename class="directory">~/tools</filename> as soon as they are
    6567  available without remembering a previous version of the same program in a
    6668  different location.</para>
     
    109111
    110112    <varlistentry>
    111       <term><parameter>PATH=/tools/bin:/bin:/usr/bin</parameter></term>
     113      <term><parameter>PATH=/usr/bin</parameter></term>
    112114      <listitem>
    113   <para>By putting <filename class="directory">/tools/bin</filename> ahead of the
    114   standard <envar>PATH</envar>, all the programs installed in <xref
    115   linkend="chapter-temporary-tools"/> are picked up by the shell immediately after
    116   their installation. This, combined with turning off hashing, limits the risk
    117   that old programs are used from the host when the same programs are available in
    118   the Chapter 5 environment.</para>
     115  <para>Many modern linux distributions have merged <filename
     116  class="directory">/bin</filename> and <filename
     117  class="directory">/usr/bin</filename>. When this is the case, the standard
     118  <envar>PATH</envar> variable needs just to be set to <filename
     119  class="directory">/usr/bin/</filename> for the <xref
     120  linkend="chapter-temporary-tools"/> environment. When this is not the
     121  case, the following line adds <filename class="directory">/bin</filename>
     122  to the path.</para>
     123      </listitem>
     124    </varlistentry>
     125
     126    <varlistentry>
     127      <term><parameter>if [ ! -L /bin ]; then PATH=/bin:$PATH; fi</parameter></term>
     128      <listitem>
     129  <para>If <filename class="directory">/bin</filename> is not a symbolic
     130  link, then it has to be added to the <envar>PATH</envar> variable.</para>
     131      </listitem>
     132    </varlistentry>
     133
     134    <varlistentry>
     135      <term><parameter>PATH=$LFS/tools/bin:$PATH</parameter></term>
     136      <listitem>
     137  <para>By putting <filename class="directory">$LFS/tools/bin</filename> ahead of the
     138  standard <envar>PATH</envar>, the cross-compiler installed at the beginning
     139  of <xref linkend="chapter-cross-tools"/> is picked up by the shell
     140  immediately after its installation. This, combined with turning off hashing,
     141  limits the risk that the compiler from the host be used instead of the
     142  cross-compiler.</para>
    119143      </listitem>
    120144    </varlistentry>
     
    124148      <listitem>
    125149        <para>While the above commands have set some variables, in order
    126         to make them visible within any sub-shells, we export them</para>
     150        to make them visible within any sub-shells, we export them.</para>
    127151      </listitem>
    128152    </varlistentry>
  • chapter05/binutils-pass1.xml

    r560065f r675606b  
    2626
    2727    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/binutils.xml"
     28    href="../chapter08/binutils.xml"
    2929    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
     
    3434
    3535      <seglistitem>
    36         <seg>&binutils-ch5p1-sbu;</seg>
    37         <seg>&binutils-ch5p1-du;</seg>
     36        <seg>&binutils-tmpp1-sbu;</seg>
     37        <seg>&binutils-tmpp1-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    6464      the configuration, up to and including the first install. To achieve
    6565      this easily, wrap the commands in a <command>time</command>
    66       command like this: <userinput>time { ./configure ... &amp;&amp; ...
     66      command like this: <userinput>time { ./configure ... &amp;&amp; make
    6767      &amp;&amp; make install; }</userinput>.</para>
    6868    </note>
    6969
    70     <note><para>The approximate build SBU values and required disk space
    71     in Chapter&nbsp;5 does not include test suite data.</para></note>
    72 
    7370    <para>Now prepare Binutils for compilation:</para>
    7471
    75 <screen><userinput remap="configure">../configure --prefix=/tools            \
     72<screen><userinput remap="configure">../configure --prefix=$LFS/tools       \
    7673             --with-sysroot=$LFS        \
    77              --with-lib-path=/tools/lib \
    7874             --target=$LFS_TGT          \
    7975             --disable-nls              \
     
    8480
    8581      <varlistentry>
    86         <term><parameter>--prefix=/tools</parameter></term>
     82        <term><parameter>--prefix=$LFS/tools</parameter></term>
    8783        <listitem>
    8884          <para>This tells the configure script to prepare to install the
    89           Binutils programs in the <filename class="directory">/tools</filename>
    90           directory.</para>
     85          binutils programs in the <filename
     86          class="directory">$LFS/tools</filename> directory.</para>
    9187        </listitem>
    9288      </varlistentry>
     
    10197
    10298      <varlistentry>
    103         <term><parameter>--with-lib-path=/tools/lib</parameter></term>
    104         <listitem>
    105           <para>This specifies which library path the linker should be
    106           configured to use.</para>
    107         </listitem>
    108       </varlistentry>
    109 
    110       <varlistentry>
    11199        <term><envar>--target=$LFS_TGT</envar></term>
    112100        <listitem>
     
    114102          variable is slightly different than the value returned by the
    115103          <command>config.guess</command> script, this switch will tell the
    116           <command>configure</command> script to adjust Binutil's build system
     104          <command>configure</command> script to adjust binutil's build system
    117105          for building a cross linker.  </para>
    118106        </listitem>
     
    141129<screen><userinput remap="make">make</userinput></screen>
    142130
    143     <para>Compilation is now complete. Ordinarily we would now run the
    144     test suite, but at this early stage the test suite framework (Tcl,
    145     Expect, and DejaGNU) is not yet in place. The benefits of running the
    146     tests at this point are minimal since the programs from this
    147     first pass will soon be replaced by those from the second.</para>
    148 
    149     <para>If building on x86_64, create a symlink to ensure the sanity of
    150     the toolchain:</para>
    151 
    152 <screen><userinput remap="install">case $(uname -m) in
    153   x86_64) mkdir -v /tools/lib &amp;&amp; ln -sv lib /tools/lib64 ;;
    154 esac</userinput></screen>
    155 
    156131    <para>Install the package:</para>
    157132
  • chapter05/chapter05.xml

    r560065f r675606b  
    66]>
    77
    8 <chapter id="chapter-temporary-tools" xreflabel="Chapter&nbsp;5">
     8<chapter id="chapter-cross-tools" xreflabel="Chapter&nbsp;5">
    99  <?dbhtml dir="chapter05"?>
    1010  <?dbhtml filename="chapter05.html"?>
    1111
    12   <title>Constructing a Temporary System</title>
     12  <title>Compiling a Cross-Toolchain</title>
    1313
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
     
    2020  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glibc.xml"/>
    2121  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libstdc++.xml"/>
    22   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass2.xml"/>
    23   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/>
    24   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tcl.xml"/>
    25   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expect.xml"/>
    26   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dejagnu.xml"/>
    27   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
    28   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
    29   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
    30   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/>
    31   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
    32   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
    33   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.xml"/>
    34   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
    35   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
    36   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/>
    37   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grep.xml"/>
    38   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
    39   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="make.xml"/>
    40   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="patch.xml"/>
    41   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="perl.xml"/>
    42   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
    43   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
    44   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
    45   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/>
    46   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
    47   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
    48   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="stripping.xml"/>
    49   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="changingowner.xml"/>
    5022
    5123</chapter>
  • chapter05/gcc-pass1.xml

    r560065f r675606b  
    2626
    2727    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/gcc.xml"
     28    href="../chapter08/gcc.xml"
    2929    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
     
    3434
    3535      <seglistitem>
    36         <seg>&gcc-ch5p1-sbu;</seg>
    37         <seg>&gcc-ch5p1-du;</seg>
     36        <seg>&gcc-tmpp1-sbu;</seg>
     37        <seg>&gcc-tmpp1-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    4444    <title>Installation of Cross GCC</title>
    4545
    46     <para>GCC now requires the GMP, MPFR and MPC packages. As these packages may
     46    <para>GCC requires the GMP, MPFR and MPC packages. As these packages may
    4747    not be included in your host distribution, they will be built with
    4848    GCC.  Unpack each package into the GCC source directory and rename the
     
    6363mv -v mpc-&mpc-version; mpc</userinput></screen>
    6464
    65     <para>The following command will change the location of GCC's default
    66     dynamic linker to use the one installed in <filename
    67     class="directory">/tools</filename>. It also removes <filename
    68     class="directory">/usr/include</filename> from GCC's include search path.
    69     Issue:</para>
    70 
    71 <screen><userinput remap="pre">for file in gcc/config/{linux,i386/linux{,64}}.h
    72 do
    73   cp -uv $file{,.orig}
    74   sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \
    75       -e 's@/usr@/tools@g' $file.orig &gt; $file
    76   echo '
    77 #undef STANDARD_STARTFILE_PREFIX_1
    78 #undef STANDARD_STARTFILE_PREFIX_2
    79 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
    80 #define STANDARD_STARTFILE_PREFIX_2 ""' &gt;&gt; $file
    81   touch $file.orig
    82 done</userinput></screen>
    83 
    84     <para>In case the above seems hard to follow, let's break it down a bit.
    85     First we copy the files <filename>gcc/config/linux.h</filename>,
    86     <filename>gcc/config/i386/linux.h</filename>, and
    87     <filename>gcc/config/i386/linux64.h</filename> to a file of
    88     the same name but with an added suffix of <quote>.orig</quote>. Then the
    89     first sed expression prepends <quote>/tools</quote> to every instance of
    90     <quote>/lib/ld</quote>, <quote>/lib64/ld</quote> or
    91     <quote>/lib32/ld</quote>, while the second one replaces hard-coded
    92     instances of <quote>/usr</quote>. Next, we add our define statements which
    93     alter the default startfile prefix to the end of the file. Note that the
    94     trailing <quote>/</quote> in <quote>/tools/lib/</quote> is required.
    95     Finally, we use <command>touch</command> to update the timestamp on the
    96     copied files.  When used in conjunction with <command>cp -u</command>, this
    97     prevents unexpected changes to the original files in case the commands are
    98     inadvertently run twice.</para>
    99 
    100     <para>Finally, on x86_64 hosts, set the default directory name for
     65    <para>On x86_64 hosts, set the default directory name for
    10166    64-bit libraries to <quote>lib</quote>:</para>
    10267
     
    10873esac</userinput></screen>
    10974
    110 <!--
    111     <para>GCC doesn't detect stack protection correctly, which causes problems
    112     for the build of Glibc-&glibc-version;, so fix that by issuing the following
    113     command:</para>
    114 
    115 <screen><userinput remap="pre">sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure</userinput></screen>
    116 -->
    117 
    118 <!--
    119     <para>Also fix a problem identified upstream:</para>
    120 
    121 <screen><userinput remap="pre">sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
    122 -->
    12375    <para>The GCC documentation recommends building GCC
    12476    in a dedicated build directory:</para>
     
    13183<screen><userinput remap="configure">../configure                                       \
    13284    --target=$LFS_TGT                              \
    133     --prefix=/tools                                \
     85    --prefix=$LFS/tools                            \
    13486    --with-glibc-version=2.11                      \
    13587    --with-sysroot=$LFS                            \
    13688    --with-newlib                                  \
    13789    --without-headers                              \
    138     --with-local-prefix=/tools                     \
    139     --with-native-system-header-dir=/tools/include \
     90    --enable-initfini-array                        \
    14091    --disable-nls                                  \
    14192    --disable-shared                               \
     
    182133
    183134      <varlistentry>
    184         <term><parameter>--with-local-prefix=/tools</parameter></term>
    185         <listitem>
    186           <para>The local prefix is the location in the system that GCC will search
    187           for locally installed include files. The default is <filename>/usr/local</filename>.
    188           Setting this to <filename>/tools</filename> helps keep the host location of
    189           <filename>/usr/local</filename> out of this GCC's search path.</para>
    190         </listitem>
    191       </varlistentry>
    192 
    193       <varlistentry>
    194         <term><parameter>--with-native-system-header-dir=/tools/include</parameter></term>
    195         <listitem>
    196           <para>By default, GCC searches <filename>/usr/include</filename> for
    197           system headers. In conjunction with the sysroot switch, this would
    198           normally translate to <filename>$LFS/usr/include</filename>. However
    199           the headers that will be installed in the next two sections will go
    200           to <filename>$LFS/tools/include</filename>. This switch ensures that
    201           gcc will find them correctly. In the second pass of GCC, this same
    202           switch will ensure that no headers from the host system are
    203           found.</para>
     135        <term><parameter>--enable-initfini-array</parameter></term>
     136        <listitem>
     137          <para>This switch forces the use of some internal data structures
     138          that are needed but cannot be detected when building a cross
     139          compiler.</para>
    204140        </listitem>
    205141      </varlistentry>
     
    209145        <listitem>
    210146          <para>This switch forces GCC to link its internal libraries
    211           statically. We do this to avoid possible issues with the host
    212           system.</para>
     147          statically. We need this because the shared libraries require glibc,
     148          which is not yet installed on the target system.</para>
     149        </listitem>
     150      </varlistentry>
     151
     152      <varlistentry>
     153        <term><parameter>--disable-multilib</parameter></term>
     154        <listitem>
     155          <para>On x86_64, LFS does not support a multilib configuration.
     156          This switch is harmless for x86.</para>
    213157        </listitem>
    214158      </varlistentry>
     
    216160      <varlistentry>
    217161        <term><parameter>--disable-decimal-float, --disable-threads,
    218               --disable-libatomic, --disable-libgomp, <!--- -disable-libmpx,-->
     162              --disable-libatomic, --disable-libgomp,
    219163        --disable-libquadmath, --disable-libssp, --disable-libvtv,
    220164        --disable-libstdcxx</parameter></term>
    221165        <listitem>
    222166          <para>These switches disable support for the decimal floating point
    223           extension, threading, libatomic, libgomp, <!--libmpx, --> libquadmath, libssp,
     167          extension, threading, libatomic, libgomp, libquadmath, libssp,
    224168          libvtv, and the C++ standard library respectively. These features
    225169          will fail to compile when building a cross-compiler and are not
     
    229173
    230174      <varlistentry>
    231         <term><parameter>--disable-multilib</parameter></term>
    232         <listitem>
    233           <para>On x86_64, LFS does not yet support a multilib configuration.
    234           This switch is harmless for x86.</para>
    235         </listitem>
    236       </varlistentry>
    237 
    238       <varlistentry>
    239175        <term><parameter>--enable-languages=c,c++</parameter></term>
    240176        <listitem>
     
    250186<screen><userinput remap="make">make</userinput></screen>
    251187
    252     <para>Compilation is now complete. At this point, the test suite would
    253     normally be run, but, as mentioned before, the test suite framework is
    254     not in place yet. The benefits of running the tests at this point
    255     are minimal since the programs from this first pass will soon be
    256     replaced.</para>
    257 
    258188    <para>Install the package:</para>
    259189
    260 <screen><userinput remap="install">make install</userinput></screen>
    261 <!--
    262     <para>Using <parameter>- -disable-shared</parameter> means that the
    263     <filename>libgcc_eh.a</filename> file isn't created and installed. The
    264     Glibc package depends on this library as it uses
    265     <parameter>-lgcc_eh</parameter> within its build system. This dependency
    266     can be satisfied by creating a symlink to <filename>libgcc.a</filename>,
    267     since that file will end up containing the objects normally contained in
    268     <filename>libgcc_eh.a</filename>:</para>
    269 
    270 <screen><userinput remap="install">ln -sv libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&amp;_eh/'`</userinput></screen>
    271 -->
     190    <screen><userinput remap="install">make install</userinput></screen>
     191
     192    <para>This build of GCC has installed a couple of internal system
     193    headers.  Normally one of them, <filename>limits.h</filename>, would in turn
     194    include the corresponding system <filename>limits.h</filename> header, in
     195    this case, <filename>$LFS/usr/include/limits.h</filename>. However, at the
     196    time of this build of GCC <filename>$LFS/usr/include/limits.h</filename>
     197    does not exist, so the internal header that has just been installed is a
     198    partial, self-contained file and does not include the extended features of
     199    the system header. This is adequate for building glibc, but the full
     200    internal header will be needed later.  Create a full version of the internal
     201    header using a command that is identical to what the GCC build system does
     202    in normal circumstances:</para>
     203
     204<screen><userinput remap="install">cd ..
     205cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
     206  `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h</userinput></screen>
    272207  </sect2>
    273208
  • chapter05/generalinstructions.xml

    r560065f r675606b  
    1919    <para>Several of the packages are patched before compilation, but only when
    2020    the patch is needed to circumvent a problem. A patch is often needed in
    21     both this and the next chapter, but sometimes in only one or the other.
     21    both this and the following chapters, but sometimes in only one location.
    2222    Therefore, do not be concerned if instructions for a downloaded patch seem
    2323    to be missing.  Warning messages about <emphasis>offset</emphasis> or
     
    8282          <para>Place all the sources and patches in a directory that will be
    8383          accessible from the chroot environment such as
    84           <filename class="directory">/mnt/lfs/sources/</filename>. Do
     84          <filename class="directory">/mnt/lfs/sources/</filename>.<!-- Do
    8585          <emphasis>not</emphasis> put sources in
    86           <filename class="directory">/mnt/lfs/tools/</filename>.</para>
     86          <filename class="directory">/mnt/lfs/tools/</filename>. --></para>
    8787        </listitem>
    8888        <listitem>
     
    9494            <listitem>
    9595              <para>Using the <command>tar</command> program, extract the package
    96               to be built.  In Chapter&nbsp;5, ensure you are the <emphasis>lfs</emphasis>
    97               user when extracting the package.</para>
     96              to be built.  In Chapters 5 and 6, ensure you are
     97              the <emphasis>lfs</emphasis> user when extracting the package.</para>
    9898            </listitem>
    9999            <listitem>
  • chapter05/glibc.xml

    r560065f r675606b  
    2626
    2727    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/glibc.xml"
     28    href="../chapter08/glibc.xml"
    2929    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
     
    3434
    3535      <seglistitem>
    36         <seg>&glibc-ch5-sbu;</seg>
    37         <seg>&glibc-ch5-du;</seg>
     36        <seg>&glibc-tmp-sbu;</seg>
     37        <seg>&glibc-tmp-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    4444    <title>Installation of Glibc</title>
    4545
     46    <para>First, create a symbolic link for LSB compliance. Additionally,
     47    for x86_64, create a compatibility symbolic link required for proper
     48    operation of the dynamic library loader:</para>
     49
     50<screen><userinput remap="pre">case $(uname -m) in
     51    i?86)   ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
     52    ;;
     53    x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
     54            ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
     55    ;;
     56esac</userinput></screen>
     57
     58    <para>Some of the Glibc programs use the non-FHS compliant
     59    <filename class="directory">/var/db</filename> directory to store their
     60    runtime data. Apply the following patch to make such programs store their
     61    runtime data in the FHS-compliant locations:</para>
     62
     63<screen><userinput remap="pre">patch -Np1 -i ../glibc-&glibc-version;-fhs-1.patch</userinput></screen>
     64
    4665    <para>The Glibc documentation recommends building Glibc
    4766    in a dedicated build directory:</para>
     
    5372
    5473<screen><userinput remap="configure">../configure                             \
    55       --prefix=/tools                    \
     74      --prefix=/usr                      \
    5675      --host=$LFS_TGT                    \
    5776      --build=$(../scripts/config.guess) \
    5877      --enable-kernel=&min-kernel;                \
    59       --with-headers=/tools/include</userinput></screen>
     78      --with-headers=$LFS/usr/include    \
     79      libc_cv_slibdir=/lib</userinput></screen>
    6080<!--
    6181      libc_cv_forced_unwind=yes          \
     
    6989        <listitem>
    7090          <para>The combined effect of these switches is that Glibc's build system
    71           configures itself to cross-compile, using the cross-linker and
     91          configures itself to be cross-compiled, using the cross-linker and
    7292          cross-compiler in <filename class="directory">/tools</filename>.</para>
    7393        </listitem>
     
    84104
    85105      <varlistentry>
    86         <term><parameter>--with-headers=/tools/include</parameter></term>
    87         <listitem>
    88           <para>This tells Glibc to compile itself against the headers recently
    89           installed to the tools directory, so that it knows exactly what
    90           features the kernel has and can optimize itself accordingly.</para>
    91         </listitem>
    92       </varlistentry>
    93 <!--
    94       <varlistentry>
    95         <term><parameter>libc_cv_forced_unwind=yes</parameter></term>
    96         <listitem>
    97           <para>The linker installed during
    98           <xref linkend="ch-tools-binutils-pass1"/> was cross-compiled and as
    99           such cannot be used until Glibc has been installed.  This means that
    100           the configure test for force-unwind support will fail, as it relies on
    101           a working linker.  The libc_cv_forced_unwind=yes variable is passed in
    102           order to inform <command>configure</command> that force-unwind
    103           support is available without it having to run the test.</para>
    104         </listitem>
    105       </varlistentry>
    106       <varlistentry>
    107         <term><parameter>libc_cv_c_cleanup=yes</parameter></term>
    108         <listitem>
    109           <para>Similarly, we pass libc_cv_c_cleanup=yes through to the
    110           <command>configure</command> script so that the test is skipped and C
    111           cleanup handling support is configured.</para>
    112         </listitem>
    113       </varlistentry>
    114 -->
    115 <!--  <varlistentry>
    116         <term><parameter>libc_cv_ctors_header=yes</parameter></term>
    117         <listitem>
    118           <para>Similarly, we pass libc_cv_ctors_header=yes through to the
    119           <command>configure</command> script so that the test is skipped and
    120           gcc constructor support is configured.</para>
    121         </listitem>
    122       </varlistentry>-->
     106        <term><parameter>--with-headers=$LFS/usr/include</parameter></term>
     107        <listitem>
     108          <para>This tells Glibc to compile itself against the headers
     109          recently installed to the $LFS/usr/include directory, so that
     110          it knows exactly what features the kernel has and can optimize
     111          itself accordingly.</para>
     112        </listitem>
     113      </varlistentry>
     114
     115      <varlistentry>
     116        <term><parameter>libc_cv_slibdir=/lib</parameter></term>
     117        <listitem>
     118          <para>This ensures that the library is installed in /lib instead
     119          of the default /lib64 on 64 bit machines.</para>
     120        </listitem>
     121      </varlistentry>
    123122
    124123    </variablelist>
     
    148147    <para>Install the package:</para>
    149148
    150 <screen><userinput remap="install">make install</userinput></screen>
    151 
    152   <caution>
    153     <para>At this point, it is imperative to stop and ensure that the basic
    154     functions (compiling and linking) of the new toolchain are working as
    155     expected. To perform a sanity check, run the following commands:</para>
     149    <warning><para>If <envar>LFS</envar> is not properly set, and despite the
     150    recommendations, you are building as root, the next command will install
     151    the newly built glibc to your host system, which most likely will render it
     152    unusable. So double check that the environment is correctly set for user
     153    <systemitem class="username">lfs</systemitem>.</para></warning>
     154
     155<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
     156
     157    <variablelist>
     158      <title>The meaning of the <command>make install</command> option:</title>
     159
     160      <varlistentry>
     161        <term><parameter>DESTDIR=$LFS</parameter></term>
     162        <listitem>
     163          <para>The <envar>DESTDIR</envar> make variable is used by almost all
     164          packages to define the location where the package should be
     165          installed. If it is not set, it defaults to the root (<filename
     166          class="directory">/</filename>) directory. Here we specify that
     167          the package be installed in <filename class="directory">$LFS
     168          </filename>, which will become the root after <xref linkend=
     169          "ch-tools-chroot"/>.</para>
     170        </listitem>
     171      </varlistentry>
     172
     173    </variablelist>
     174
     175    <caution>
     176      <para>At this point, it is imperative to stop and ensure that the basic
     177      functions (compiling and linking) of the new toolchain are working as
     178      expected. To perform a sanity check, run the following commands:</para>
    156179
    157180<screen><userinput>echo 'int main(){}' &gt; dummy.c
    158181$LFS_TGT-gcc dummy.c
    159 readelf -l a.out | grep ': /tools'</userinput></screen>
    160 
    161     <para>If everything is working correctly, there should be no errors,
    162     and the output of the last command will be of the form:</para>
    163 
    164 <screen><computeroutput>[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
    165 
    166     <para>Note that for 32-bit machines, the interpreter name will be
    167     <filename>/tools/lib/ld-linux.so.2</filename>.</para>
    168 
    169     <para>If the output is not shown as above or there was no output at all,
    170     then something is wrong. Investigate and retrace the steps to find out
    171     where the problem is and correct it. This issue must be resolved before
    172     continuing on.</para>
    173 
    174     <para>Once all is well, clean up the test files:</para>
     182readelf -l a.out | grep '/ld-linux'</userinput></screen>
     183
     184      <para>If everything is working correctly, there should be no errors,
     185      and the output of the last command will be of the form:</para>
     186
     187<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
     188
     189      <para>Note that for 32-bit machines, the interpreter name will be
     190      <filename>/lib/ld-linux.so.2</filename>.</para>
     191
     192      <para>If the output is not shown as above or there was no output at all,
     193      then something is wrong. Investigate and retrace the steps to find out
     194      where the problem is and correct it. This issue must be resolved before
     195      continuing on.</para>
     196
     197      <para>Once all is well, clean up the test files:</para>
    175198
    176199<screen><userinput>rm -v dummy.c a.out</userinput></screen>
    177200
    178   </caution>
    179 
    180   <note><para>Building Binutils in the section after next will serve as an
    181   additional check that the toolchain has been built properly. If Binutils
    182   fails to build, it is an indication that something has gone wrong with the
    183   previous Binutils, GCC, or Glibc installations.</para></note>
     201    </caution>
     202
     203    <note><para>Building packages in the next chapter will serve as an
     204    additional check that the toolchain has been built properly. If some
     205    package, especially binutils-pass2 or gcc-pass2, fails to build, it is
     206    an indication that something has gone wrong with the
     207    previous Binutils, GCC, or Glibc installations.</para></note>
     208
     209    <para>Now that our cross-toolchain is complete, finalize the installation
     210    of the limits.h header. For doing so, run a utility provided by the GCC
     211    developers:</para>
     212
     213<screen><userinput>$LFS/tools/libexec/gcc/$LFS_TGT/&gcc-version;/install-tools/mkheaders</userinput></screen>
    184214
    185215  </sect2>
  • chapter05/introduction.xml

    r560065f r675606b  
    1111  <title>Introduction</title>
    1212
    13   <para>This chapter shows how to build a minimal Linux system.
    14   This system will contain just enough tools to start constructing the final
    15   LFS system in <xref linkend="chapter-building-system"/> and allow a working
    16   environment with more user convenience than a minimum environment would.</para>
     13  <para>This chapter shows how to build a cross-compiler and its associated
     14  tools. Although here cross-compilation is faked, the principles are
     15  the same as for a real cross-toolchain, and are detailed in the next
     16  section.</para>
    1717
    18   <para>There are two steps in building this minimal system. The first step
    19   is to build a new and host-independent toolchain (compiler, assembler,
    20   linker, libraries, and a few useful utilities).  The second step uses this
    21   toolchain to build the other essential tools.</para>
    22 
    23   <para>The files compiled in this chapter will be installed under the
     18  <para>The programs compiled in this chapter will be installed under the
    2419  <filename class="directory">$LFS/tools</filename> directory to keep them
    25   separate from the files installed in the next chapter and the host
    26   production directories. Since the packages compiled here are temporary,
    27   we do not want them to pollute the soon-to-be LFS system.</para>
     20  separate from the files installed in the following chapters. The libraries,
     21  on the other hand, are installed into their final place, since they pertain
     22  to the system we want to build.</para>
    2823
    2924</sect1>
  • chapter05/libstdc++.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-tools-libstdcpp" role="wrap">
    9   <?dbhtml filename="gcc-libstdc++.html"?>
     8<sect1 id="ch-tools-libstdcpp-pass1" role="wrap">
     9  <?dbhtml filename="gcc-libstdc++-pass1.html"?>
    1010
    1111  <sect1info condition="script">
     
    1515  </sect1info>
    1616
    17   <title>Libstdc++ from GCC-&gcc-version;</title>
     17  <title>Libstdc++ from GCC-&gcc-version;, Pass 1</title>
    1818
    19   <indexterm zone="ch-tools-libstdcpp">
     19  <indexterm zone="ch-tools-libstdcpp-pass1">
    2020    <primary sortas="a-GCC">GCC</primary>
    21     <secondary>tools, libstdc++</secondary>
     21    <secondary>tools, libstdc++ pass 1</secondary>
    2222  </indexterm>
    2323
     
    2929    (part of GCC is written in C++), but we had to defer its installation
    3030    when we built <xref linkend="ch-tools-gcc-pass1"/>
    31     because it depends on glibc, which was not yet available in /tools.
     31    because it depends on glibc, which was not yet available in the target
     32    directory.
    3233    </para>
    3334
     
    3738
    3839      <seglistitem>
    39         <seg>&libstdcpp-ch5-sbu;</seg>
    40         <seg>&libstdcpp-ch5-du;</seg>
     40        <seg>&libstdcpp-tmpp1-sbu;</seg>
     41        <seg>&libstdcpp-tmpp1-du;</seg>
    4142      </seglistitem>
    4243    </segmentedlist>
     
    5354    </note>
    5455
    55     <para>Create a separate build directory for Libstdc++ and enter it:</para>
     56    <para>Create a separate build directory for libstdc++ and enter it:</para>
    5657
    5758<screen><userinput remap="pre">mkdir -v build
    5859cd       build</userinput></screen>
    5960
    60     <para>Prepare Libstdc++ for compilation:</para>
     61    <para>Prepare libstdc++ for compilation:</para>
    6162
    6263<screen><userinput remap="configure">../libstdc++-v3/configure           \
    6364    --host=$LFS_TGT                 \
    64     --prefix=/tools                 \
     65    --build=$(../config.guess)      \
     66    --prefix=/usr                   \
    6567    --disable-multilib              \
    66     --disable-nls                   \<!--
    67     - -disable-libstdcxx-threads     \-->
     68    --disable-nls                   \
    6869    --disable-libstdcxx-pch         \
    6970    --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
     
    7576        <term><parameter>--host=...</parameter></term>
    7677        <listitem>
    77           <para>Indicates to use the cross compiler we have just built
     78          <para>Specifies the use the cross compiler we have just built
    7879          instead of the one in <filename>/usr/bin</filename>.</para>
    7980        </listitem>
    8081      </varlistentry>
    81         <!--
    82       <varlistentry>
    83         <term><parameter>- -disable-libstdcxx-threads</parameter></term>
    84         <listitem>
    85           <para>Since gcc-pass1 is built without thread support, the C++
    86           thread library cannot be built either.</para>
    87         </listitem>
    88       </varlistentry>
    89         -->
     82
    9083      <varlistentry>
    9184        <term><parameter>--disable-libstdcxx-pch</parameter></term>
     
    9992        <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
    10093        <listitem>
    101           <para>This is the location where the standard include files are
    102           searched by the C++ compiler. In a normal build, this information
    103           is automatically passed to the Libstdc++ <command>configure</command>
     94          <para>This is the location where the C++ compiler should search for the
     95          standard include files. In a normal build, this information
     96          is automatically passed to the libstdc++ <command>configure</command>
    10497          options from the top level directory. In our case, this information
    10598          must be explicitly given.</para>
     
    115108    <para>Install the library:</para>
    116109
    117 <screen><userinput remap="install">make install</userinput></screen>
     110<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    118111
    119112  </sect2>
  • chapter05/linux-headers.xml

    r560065f r675606b  
    2525    <title/>
    2626
    27     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    28     href="../chapter06/linux-headers.xml"
    29     xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
     27    <para>The Linux API Headers (in linux-&linux-version;.tar.xz) expose the
     28    kernel's API for use by Glibc.</para>
    3029
    3130    <segmentedlist>
     
    3433
    3534      <seglistitem>
    36         <seg>&linux-headers-ch5-sbu;</seg>
    37         <seg>&linux-headers-ch5-du;</seg>
     35        <seg>&linux-headers-tmp-sbu;</seg>
     36        <seg>&linux-headers-tmp-du;</seg>
    3837      </seglistitem>
    3938    </segmentedlist>
     
    6160
    6261<screen><userinput remap="make">make headers
    63 </userinput><userinput remap="install">cp -rv usr/include/* /tools/include</userinput></screen>
     62find usr/include -name '.*' -delete
     63rm usr/include/Makefile
     64</userinput><userinput remap="install">cp -rv usr/include $LFS/usr</userinput></screen>
    6465
    6566  </sect2>
    6667
    67   <sect2 role="content">
    68     <title/>
    69 
    70     <para>Details on this package are located in
    71     <xref linkend="contents-linux-headers" role="."/></para>
     68  <sect2 id="contents-linux-headers" role="content">
     69    <title>Contents of Linux API Headers</title>
     70
     71    <segmentedlist>
     72      <segtitle>Installed headers</segtitle>
     73      <segtitle>Installed directories</segtitle>
     74
     75      <seglistitem>
     76        <seg>/usr/include/asm/*.h, /usr/include/asm-generic/*.h,
     77        /usr/include/drm/*.h, /usr/include/linux/*.h, /usr/include/misc/*.h,
     78        /usr/include/mtd/*.h, /usr/include/rdma/*.h, /usr/include/scsi/*.h,
     79        /usr/include/sound/*.h, /usr/include/video/*.h,
     80        and /usr/include/xen/*.h</seg>
     81        <seg>/usr/include/asm, /usr/include/asm-generic, /usr/include/drm,
     82        /usr/include/linux, /usr/include/misc, /usr/include/mtd,
     83        /usr/include/rdma, /usr/include/scsi, /usr/include/sound,
     84        /usr/include/video, and /usr/include/xen</seg>
     85      </seglistitem>
     86    </segmentedlist>
     87
     88    <variablelist>
     89      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
     90      <?dbfo list-presentation="list"?>
     91      <?dbhtml list-presentation="table"?>
     92
     93      <varlistentry id="asm">
     94        <term><filename class="headerfile">/usr/include/asm/*.h</filename></term>
     95        <listitem>
     96          <para>The Linux API ASM Headers</para>
     97          <indexterm zone="ch-tools-linux-headers asm">
     98            <primary sortas="e-/usr/include/asm/*.h">/usr/include/asm/*.h</primary>
     99          </indexterm>
     100        </listitem>
     101      </varlistentry>
     102
     103     <varlistentry id="asm-generic">
     104        <term><filename class="headerfile">/usr/include/asm-generic/*.h</filename></term>
     105        <listitem>
     106          <para>The Linux API ASM Generic Headers</para>
     107          <indexterm zone="ch-tools-linux-headers asm-generic">
     108            <primary sortas="e-/usr/include/asm-generic/*.h">/usr/include/asm-generic/*.h</primary>
     109          </indexterm>
     110        </listitem>
     111      </varlistentry>
     112
     113      <varlistentry id="drm">
     114        <term><filename class="headerfile">/usr/include/drm/*.h</filename></term>
     115        <listitem>
     116          <para>The Linux API DRM Headers</para>
     117          <indexterm zone="ch-tools-linux-headers drm">
     118            <primary sortas="e-/usr/include/drm/*.h">/usr/include/drm/*.h</primary>
     119          </indexterm>
     120        </listitem>
     121      </varlistentry>
     122
     123      <varlistentry id="linux">
     124        <term><filename class="headerfile">/usr/include/linux/*.h</filename></term>
     125        <listitem>
     126          <para>The Linux API Linux Headers</para>
     127          <indexterm zone="ch-tools-linux-headers linux">
     128            <primary sortas="e-/usr/include/linux/*.h">/usr/include/linux/*.h</primary>
     129          </indexterm>
     130        </listitem>
     131      </varlistentry>
     132
     133      <varlistentry id="misc">
     134        <term><filename class="headerfile">/usr/include/misc/*.h</filename></term>
     135        <listitem>
     136          <para>The Linux API Miscellaneous Headers</para>
     137          <indexterm zone="ch-tools-linux-headers misc">
     138            <primary sortas="e-/usr/include/misc/*.h">/usr/include/misc/*.h</primary>
     139          </indexterm>
     140        </listitem>
     141      </varlistentry>
     142
     143      <varlistentry id="mtd">
     144        <term><filename class="headerfile">/usr/include/mtd/*.h</filename></term>
     145        <listitem>
     146          <para>The Linux API MTD Headers</para>
     147          <indexterm zone="ch-tools-linux-headers mtd">
     148            <primary sortas="e-/usr/include/mtd/*.h">/usr/include/mtd/*.h</primary>
     149          </indexterm>
     150        </listitem>
     151      </varlistentry>
     152
     153      <varlistentry id="rdma">
     154        <term><filename class="headerfile">/usr/include/rdma/*.h</filename></term>
     155        <listitem>
     156          <para>The Linux API RDMA Headers</para>
     157          <indexterm zone="ch-tools-linux-headers rdma">
     158            <primary sortas="e-/usr/include/rdma/*.h">/usr/include/rdma/*.h</primary>
     159         </indexterm>
     160        </listitem>
     161      </varlistentry>
     162
     163      <varlistentry id="scsi">
     164        <term><filename class="headerfile">/usr/include/scsi/*.h</filename></term>
     165        <listitem>
     166          <para>The Linux API SCSI Headers</para>
     167          <indexterm zone="ch-tools-linux-headers scsi">
     168            <primary sortas="e-/usr/include/scsi/*.h">/usr/include/scsi/*.h</primary>
     169          </indexterm>
     170        </listitem>
     171      </varlistentry>
     172
     173      <varlistentry id="sound">
     174        <term><filename class="headerfile">/usr/include/sound/*.h</filename></term>
     175        <listitem>
     176          <para>The Linux API Sound Headers</para>
     177          <indexterm zone="ch-tools-linux-headers sound">
     178           <primary sortas="e-/usr/include/sound/*.h">/usr/include/sound/*.h</primary>
     179          </indexterm>
     180        </listitem>
     181      </varlistentry>
     182
     183      <varlistentry id="video">
     184        <term><filename class="headerfile">/usr/include/video/*.h</filename></term>
     185        <listitem>
     186          <para>The Linux API Video Headers</para>
     187          <indexterm zone="ch-tools-linux-headers video">
     188            <primary sortas="e-/usr/include/video/*.h">/usr/include/video/*.h</primary>
     189          </indexterm>
     190        </listitem>
     191      </varlistentry>
     192
     193      <varlistentry id="xen">
     194        <term><filename class="headerfile">/usr/include/xen/*.h</filename></term>
     195        <listitem>
     196          <para>The Linux API Xen Headers</para>
     197          <indexterm zone="ch-tools-linux-headers xen">
     198            <primary sortas="e-/usr/include/xen/*.h">/usr/include/xen/*.h</primary>
     199          </indexterm>
     200        </listitem>
     201      </varlistentry>
     202
     203    </variablelist>
    72204
    73205  </sect2>
  • chapter05/toolchaintechnotes.xml

    r560065f r675606b  
    1717  to at any time during the process.</para>
    1818
    19   <para>The overall goal of <xref linkend="chapter-temporary-tools"/> is to
    20   produce a temporary area that contains a known-good set of tools that can be
    21   isolated from the host system. By using <command>chroot</command>, the
    22   commands in the remaining chapters will be contained within that environment,
    23   ensuring a clean, trouble-free build of the target LFS system. The build
    24   process has been designed to minimize the risks for new readers and to provide
    25   the most educational value at the same time.</para>
    26 
    27   <note>
    28     <para>Before continuing, be aware of the name of the working platform,
    29     often referred to as the target triplet. A simple way to determine the
    30     name of the target triplet is to run the <command>config.guess</command>
    31     script that comes with the source for many packages. Unpack the Binutils
    32     sources and run the script: <userinput>./config.guess</userinput> and note
    33     the output. For example, for a 32-bit Intel processor the
    34     output will be <emphasis>i686-pc-linux-gnu</emphasis>. On a 64-bit
    35     system it will be <emphasis>x86_64-pc-linux-gnu</emphasis>.</para>
    36 
    37     <para>Also be aware of the name of the platform's dynamic linker, often
    38     referred to as the dynamic loader (not to be confused with the standard
    39     linker <command>ld</command> that is part of Binutils). The dynamic linker
    40     provided by Glibc finds and loads the shared libraries needed by a program,
    41     prepares the program to run, and then runs it. The name of the dynamic
    42     linker for a 32-bit Intel machine will be <filename
    43     class="libraryfile">ld-linux.so.2</filename> (<filename
    44     class="libraryfile">ld-linux-x86-64.so.2</filename> for 64-bit systems).  A
    45     sure-fire way to determine the name of the dynamic linker is to inspect a
    46     random binary from the host system by running: <userinput>readelf -l
    47     &lt;name of binary&gt; | grep interpreter</userinput> and noting the
    48     output. The authoritative reference covering all platforms is in the
    49     <filename>shlib-versions</filename> file in the root of the Glibc source
    50     tree.</para>
    51   </note>
    52 
    53   <para>Some key technical points of how the <xref
    54   linkend="chapter-temporary-tools"/> build method works:</para>
    55 
    56   <itemizedlist>
    57     <listitem>
    58       <para>Slightly adjusting the name of the working platform, by changing the
    59       &quot;vendor&quot; field target triplet by way of the
    60       <envar>LFS_TGT</envar> variable, ensures that the first build of Binutils
    61       and GCC produces a compatible cross-linker and cross-compiler. Instead of
    62       producing binaries for another architecture, the cross-linker and
    63       cross-compiler will produce binaries compatible with the current
    64       hardware.</para>
    65     </listitem>
    66     <listitem>
    67       <para> The temporary libraries are cross-compiled.  Because a
    68       cross-compiler by its nature cannot rely on anything from its host
    69       system, this method removes potential contamination of the target
    70       system by lessening the chance of headers or libraries from the host
    71       being incorporated into the new tools.  Cross-compilation also allows for
    72       the possibility of building both 32-bit and 64-bit libraries on 64-bit
    73       capable hardware.</para>
    74     </listitem>
    75     <listitem>
    76     <para>Careful manipulation of the GCC source tells the compiler which target
    77     dynamic linker will be used.</para>
    78     </listitem>
    79   </itemizedlist>
    80 
    81   <para>Binutils is installed first because the <command>configure</command>
    82   runs of both GCC and Glibc perform various feature tests on the assembler
    83   and linker to determine which software features to enable or disable. This
    84   is more important than one might first realize. An incorrectly configured
    85   GCC or Glibc can result in a subtly broken toolchain, where the impact of
    86   such breakage might not show up until near the end of the build of an
    87   entire distribution. A test suite failure will usually highlight this error
    88   before too much additional work is performed.</para>
    89 
    90   <para>Binutils installs its assembler and linker in two locations,
    91   <filename class="directory">/tools/bin</filename> and <filename
    92   class="directory">/tools/$LFS_TGT/bin</filename>. The tools in one
    93   location are hard linked to the other. An important facet of the linker is
    94   its library search order. Detailed information can be obtained from
    95   <command>ld</command> by passing it the <parameter>--verbose</parameter>
    96   flag. For example, an <userinput>ld --verbose | grep SEARCH</userinput>
    97   will illustrate the current search paths and their order. It shows which
    98   files are linked by <command>ld</command> by compiling a dummy program and
    99   passing the <parameter>--verbose</parameter> switch to the linker. For example,
    100   <userinput>gcc dummy.c -Wl,--verbose 2&gt;&amp;1 | grep succeeded</userinput>
    101   will show all the files successfully opened during the linking.</para>
    102 
    103   <para>The next package installed is GCC. An example of what can be
    104   seen during its run of <command>configure</command> is:</para>
    105 
    106 <screen><computeroutput>checking what assembler to use... /tools/i686-lfs-linux-gnu/bin/as
    107 checking what linker to use... /tools/i686-lfs-linux-gnu/bin/ld</computeroutput></screen>
    108 
    109   <para>This is important for the reasons mentioned above. It also demonstrates
    110   that GCC's configure script does not search the PATH directories to find which
    111   tools to use. However, during the actual operation of <command>gcc</command>
    112   itself, the same search paths are not necessarily used. To find out which
    113   standard linker <command>gcc</command> will use, run:
    114   <userinput>gcc -print-prog-name=ld</userinput>.</para>
    115 
    116   <para>Detailed information can be obtained from <command>gcc</command> by
    117   passing it the <parameter>-v</parameter> command line option while compiling
    118   a dummy program. For example, <userinput>gcc -v dummy.c</userinput> will show
    119   detailed information about the preprocessor, compilation, and assembly stages,
    120   including <command>gcc</command>'s included search paths and their order.</para>
    121 
    122   <para>Next installed are sanitized Linux API headers. These allow the standard
    123   C library (Glibc) to interface with features that the Linux kernel will
    124   provide.</para>
    125 
    126   <para>The next package installed is Glibc. The most important considerations
    127   for building Glibc are the compiler, binary tools, and kernel headers. The
    128   compiler is generally not an issue since Glibc will always use the compiler
    129   relating to the <parameter>--host</parameter> parameter passed to its
    130   configure script; e.g. in our case, the compiler will be
    131   <command>i686-lfs-linux-gnu-gcc</command>. The binary tools and kernel
    132   headers can be a bit more complicated. Therefore, take no risks and use the
    133   available configure switches to enforce the correct selections. After the run
    134   of <command>configure</command>, check the contents of the
    135   <filename>config.make</filename> file in the <filename
    136   class="directory">glibc-build</filename> directory for all important details.
    137   Note the use of <parameter>CC="i686-lfs-gnu-gcc"</parameter> to control which
    138   binary tools are used and the use of the <parameter>-nostdinc</parameter> and
    139   <parameter>-isystem</parameter> flags to control the compiler's include
    140   search path. These items highlight an important aspect of the Glibc
    141   package&mdash;it is very self-sufficient in terms of its build machinery and
    142   generally does not rely on toolchain defaults.</para>
    143 
    144   <para>During the second pass of Binutils, we are able to utilize the
    145   <parameter>--with-lib-path</parameter> configure switch to control
    146   <command>ld</command>'s library search path.</para>
    147 
    148   <para>For the second pass of GCC, its sources also need to be modified to
    149   tell GCC to use the new dynamic linker. Failure to do so will result in the
    150   GCC programs themselves having the name of the dynamic linker from the host
    151   system's <filename class="directory">/lib</filename> directory embedded into
    152   them, which would defeat the goal of getting away from the host. From this
    153   point onwards, the core toolchain is self-contained and self-hosted. The
    154   remainder of the <xref linkend="chapter-temporary-tools"/> packages all build
    155   against the new Glibc in <filename
    156   class="directory">/tools</filename>.</para>
    157 
    158   <para>Upon entering the chroot environment in <xref
    159   linkend="chapter-building-system"/>, the first major package to be
    160   installed is Glibc, due to its self-sufficient nature mentioned above.
    161   Once this Glibc is installed into <filename
    162   class="directory">/usr</filename>, we will perform a quick changeover of the
    163   toolchain defaults, and then proceed in building the rest of the target
    164   LFS system.</para>
     19  <para>The overall goal of this chapter and <xref
     20  linkend="chapter-temporary-tools"/> is to produce a temporary area that
     21  contains a known-good set of tools that can be isolated from the host system.
     22  By using <command>chroot</command>, the commands in the remaining chapters
     23  will be contained within that environment, ensuring a clean, trouble-free
     24  build of the target LFS system. The build process has been designed to
     25  minimize the risks for new readers and to provide the most educational value
     26  at the same time.</para>
     27
     28  <para>The build process is based on the process of
     29  <emphasis>cross-compilation</emphasis>. Cross-compilation is normally used
     30  for building a compiler and its toolchain for a machine different from
     31  the one that is used for the build. This is not strictly needed for LFS,
     32  since the machine where the new system will run is the same as the one
     33  used for the build. But cross-compilation has the great advantage that
     34  anything that is cross-compiled cannot depend on the host environment.</para>
     35
     36  <sect2 id="cross-compile" xreflabel="About Cross-Compilation">
     37
     38    <title>About Cross-Compilation</title>
     39
     40    <para>Cross-compilation involves some concepts that deserve a section on
     41    their own. Although this section may be omitted in a first reading, it
     42    is strongly suggested to come back to it later in order to get a full
     43    grasp of the build process.</para>
     44
     45    <para>Let us first define some terms used in this context:</para>
     46
     47    <variablelist>
     48      <varlistentry><term>build</term><listitem>
     49        <para>is the machine where we build programs. Note that this machine
     50        is referred to as the <quote>host</quote> in other
     51        sections.</para></listitem>
     52      </varlistentry>
     53
     54      <varlistentry><term>host</term><listitem>
     55        <para>is the machine/system where the built programs will run. Note
     56        that this use of <quote>host</quote> is not the same as in other
     57        sections.</para></listitem>
     58      </varlistentry>
     59
     60      <varlistentry><term>target</term><listitem>
     61        <para>is only used for compilers. It is the machine the compiler
     62        produces code for. It may be different from both build and
     63        host.</para></listitem>
     64      </varlistentry>
     65
     66    </variablelist>
     67
     68    <para>As an example, let us imagine the following scenario: we may have a
     69    compiler on a slow machine only, let's call the machine A, and the compiler
     70    ccA. We may have also a fast machine (B), but with no compiler, and we may
     71    want to produce code for a another slow machine (C). Then, to build a
     72    compiler for machine C, we would have three stages:</para>
     73
     74    <informaltable align="center">
     75      <tgroup cols="5">
     76        <colspec colnum="1" align="center"/>
     77        <colspec colnum="2" align="center"/>
     78        <colspec colnum="3" align="center"/>
     79        <colspec colnum="4" align="center"/>
     80        <colspec colnum="5" align="left"/>
     81        <thead>
     82          <row><entry>Stage</entry><entry>Build</entry><entry>Host</entry>
     83               <entry>Target</entry><entry>Action</entry></row>
     84        </thead>
     85        <tbody>
     86          <row>
     87            <entry>1</entry><entry>A</entry><entry>A</entry><entry>B</entry>
     88            <entry>build cross-compiler cc1 using ccA on machine A</entry>
     89          </row>
     90          <row>
     91            <entry>2</entry><entry>A</entry><entry>B</entry><entry>B</entry>
     92            <entry>build cross-compiler cc2 using cc1 on machine A</entry>
     93          </row>
     94          <row>
     95            <entry>3</entry><entry>B</entry><entry>C</entry><entry>C</entry>
     96            <entry>build compiler ccC using cc2 on machine B</entry>
     97          </row>
     98        </tbody>
     99      </tgroup>
     100    </informaltable>
     101
     102    <para>Then, all the other programs needed by machine C can be compiled
     103    using cc2 on the fast machine B. Note that unless B can run programs
     104    produced for C, there is no way to test the built programs until machine
     105    C itself is running. For example, for testing ccC, we may want to add a
     106    fourth stage:</para>
     107
     108    <informaltable align="center">
     109      <tgroup cols="5">
     110        <colspec colnum="1" align="center"/>
     111        <colspec colnum="2" align="center"/>
     112        <colspec colnum="3" align="center"/>
     113        <colspec colnum="4" align="center"/>
     114        <colspec colnum="5" align="left"/>
     115        <thead>
     116          <row><entry>Stage</entry><entry>Build</entry><entry>Host</entry>
     117               <entry>Target</entry><entry>Action</entry></row>
     118        </thead>
     119        <tbody>
     120          <row>
     121            <entry>4</entry><entry>C</entry><entry>C</entry><entry>C</entry>
     122            <entry>rebuild  and test ccC using itself on machine C</entry>
     123          </row>
     124        </tbody>
     125      </tgroup>
     126    </informaltable>
     127
     128    <para>In the example above, only cc1 and cc2 are cross-compilers, that is,
     129    they produce code for a machine different from the one they are run on.
     130    The other compilers ccA and ccC produce code for the machine they are run
     131    on. Such compilers are called <emphasis>native</emphasis> compilers.</para>
     132
     133  </sect2>
     134
     135  <sect2 id="lfs-cross">
     136    <title>Implementation of Cross-Compilation for LFS</title>
     137
     138    <note>
     139      <para>Almost all the build systems use names of the form
     140      cpu-vendor-kernel-os referred to as the machine triplet. An astute
     141      reader may wonder why a <quote>triplet</quote> refers to a four component
     142      name. The reason is history: initially, three component names were enough
     143      to designate unambiguously a machine, but with new machines and systems
     144      appearing, that proved insufficient. The word <quote>triplet</quote>
     145      remained. A simple way to determine your machine triplet is to run
     146      the <command>config.guess</command>
     147      script that comes with the source for many packages. Unpack the binutils
     148      sources and run the script: <userinput>./config.guess</userinput> and note
     149      the output. For example, for a 32-bit Intel processor the
     150      output will be <emphasis>i686-pc-linux-gnu</emphasis>. On a 64-bit
     151      system it will be <emphasis>x86_64-pc-linux-gnu</emphasis>.</para>
     152
     153      <para>Also be aware of the name of the platform's dynamic linker, often
     154      referred to as the dynamic loader (not to be confused with the standard
     155      linker <command>ld</command> that is part of binutils). The dynamic linker
     156      provided by Glibc finds and loads the shared libraries needed by a
     157      program, prepares the program to run, and then runs it. The name of the
     158      dynamic linker for a 32-bit Intel machine will be <filename
     159      class="libraryfile">ld-linux.so.2</filename> (<filename
     160      class="libraryfile">ld-linux-x86-64.so.2</filename> for 64-bit systems). A
     161      sure-fire way to determine the name of the dynamic linker is to inspect a
     162      random binary from the host system by running: <userinput>readelf -l
     163      &lt;name of binary&gt; | grep interpreter</userinput> and noting the
     164      output. The authoritative reference covering all platforms is in the
     165      <filename>shlib-versions</filename> file in the root of the Glibc source
     166      tree.</para>
     167    </note>
     168
     169    <para>In order to fake a cross compilation, the name of the host triplet
     170    is slightly adjusted by changing the &quot;vendor&quot; field in the
     171    <envar>LFS_TGT</envar> variable. We also use the
     172    <parameter>--with-sysroot</parameter> option when building the cross linker and
     173    cross compiler to tell them where to find the needed host files. This
     174    ensures that none of the other programs built in <xref
     175    linkend="chapter-temporary-tools"/> can link to libraries on the build
     176    machine. Only two stages are mandatory, and one more for tests:</para>
     177
     178    <informaltable align="center">
     179      <tgroup cols="5">
     180        <colspec colnum="1" align="center"/>
     181        <colspec colnum="2" align="center"/>
     182        <colspec colnum="3" align="center"/>
     183        <colspec colnum="4" align="center"/>
     184        <colspec colnum="5" align="left"/>
     185        <thead>
     186          <row><entry>Stage</entry><entry>Build</entry><entry>Host</entry>
     187               <entry>Target</entry><entry>Action</entry></row>
     188        </thead>
     189        <tbody>
     190          <row>
     191            <entry>1</entry><entry>pc</entry><entry>pc</entry><entry>lfs</entry>
     192            <entry>build cross-compiler cc1 using cc-pc on pc</entry>
     193          </row>
     194          <row>
     195            <entry>2</entry><entry>pc</entry><entry>lfs</entry><entry>lfs</entry>
     196            <entry>build compiler cc-lfs using cc1 on pc</entry>
     197          </row>
     198          <row>
     199            <entry>3</entry><entry>lfs</entry><entry>lfs</entry><entry>lfs</entry>
     200            <entry>rebuild and test cc-lfs using itself on lfs</entry>
     201          </row>
     202        </tbody>
     203      </tgroup>
     204    </informaltable>
     205
     206    <para>In the above table, <quote>on pc</quote> means the commands are run
     207    on a machine using the already installed distribution. <quote>On
     208    lfs</quote> means the commands are run in a chrooted environment.</para>
     209
     210    <para>Now, there is more about cross-compiling: the C language is not
     211    just a compiler, but also defines a standard library. In this book, the
     212    GNU C library, named glibc, is used. This library must
     213    be compiled for the lfs machine, that is, using the cross compiler cc1.
     214    But the compiler itself uses an internal library implementing complex
     215    instructions not available in the assembler instruction set. This
     216    internal library is named libgcc, and must be linked to the glibc
     217    library to be fully functional! Furthermore, the standard library for
     218    C++ (libstdc++) also needs being linked to glibc. The solution
     219    to this chicken and egg problem is to first build a degraded cc1 based libgcc,
     220    lacking some fuctionalities such as threads and exception handling, then
     221    build glibc using this degraded compiler (glibc itself is not
     222    degraded), then build libstdc++. But this last library will lack the
     223    same functionalities as libgcc.</para>
     224
     225    <para>This is not the end of the story: the conclusion of the preceding
     226    paragraph is that cc1 is unable to build a fully functional libstdc++, but
     227    this is the only compiler available for building the C/C++ libraries
     228    during stage 2! Of course, the compiler built during stage 2, cc-lfs,
     229    would be able to build those libraries, but (1) the build system of
     230    GCC does not know that it is usable on pc, and (2) using it on pc
     231    would be at risk of linking to the pc libraries, since cc-lfs is a native
     232    compiler. So we have to build libstdc++ later, in chroot.</para>
     233
     234  </sect2>
     235
     236  <sect2 id="other-details">
     237
     238    <title>Other procedural details</title>
     239
     240    <para>The cross-compiler will be installed in a separate <filename
     241    class="directory">$LFS/tools</filename> directory, since it will not
     242    be part of the final system.</para>
     243
     244    <para>Binutils is installed first because the <command>configure</command>
     245    runs of both GCC and Glibc perform various feature tests on the assembler
     246    and linker to determine which software features to enable or disable. This
     247    is more important than one might first realize. An incorrectly configured
     248    GCC or Glibc can result in a subtly broken toolchain, where the impact of
     249    such breakage might not show up until near the end of the build of an
     250    entire distribution. A test suite failure will usually highlight this error
     251    before too much additional work is performed.</para>
     252
     253    <para>Binutils installs its assembler and linker in two locations,
     254    <filename class="directory">$LFS/tools/bin</filename> and <filename
     255    class="directory">$LFS/tools/$LFS_TGT/bin</filename>. The tools in one
     256    location are hard linked to the other. An important facet of the linker is
     257    its library search order. Detailed information can be obtained from
     258    <command>ld</command> by passing it the <parameter>--verbose</parameter>
     259    flag. For example, <command>$LFS_TGT-ld --verbose | grep SEARCH</command>
     260    will illustrate the current search paths and their order. It shows which
     261    files are linked by <command>ld</command> by compiling a dummy program and
     262    passing the <parameter>--verbose</parameter> switch to the linker. For
     263    example,
     264    <command>$LFS_TGT-gcc dummy.c -Wl,--verbose 2&gt;&amp;1 | grep succeeded</command>
     265    will show all the files successfully opened during the linking.</para>
     266
     267    <para>The next package installed is GCC. An example of what can be
     268    seen during its run of <command>configure</command> is:</para>
     269
     270<screen><computeroutput>checking what assembler to use... /mnt/lfs/tools/i686-lfs-linux-gnu/bin/as
     271checking what linker to use... /mnt/lfs/tools/i686-lfs-linux-gnu/bin/ld</computeroutput></screen>
     272
     273    <para>This is important for the reasons mentioned above. It also
     274    demonstrates that GCC's configure script does not search the PATH
     275    directories to find which tools to use. However, during the actual
     276    operation of <command>gcc</command> itself, the same search paths are not
     277    necessarily used. To find out which standard linker <command>gcc</command>
     278    will use, run: <command>$LFS_TGT-gcc -print-prog-name=ld</command>.</para>
     279
     280    <para>Detailed information can be obtained from <command>gcc</command> by
     281    passing it the <parameter>-v</parameter> command line option while compiling
     282    a dummy program. For example, <command>gcc -v dummy.c</command> will show
     283    detailed information about the preprocessor, compilation, and assembly
     284    stages, including <command>gcc</command>'s included search paths and their
     285    order.</para>
     286
     287    <para>Next installed are sanitized Linux API headers. These allow the
     288    standard C library (Glibc) to interface with features that the Linux
     289    kernel will provide.</para>
     290
     291    <para>The next package installed is Glibc. The most important
     292    considerations for building Glibc are the compiler, binary tools, and
     293    kernel headers. The compiler is generally not an issue since Glibc will
     294    always use the compiler relating to the <parameter>--host</parameter>
     295    parameter passed to its configure script; e.g. in our case, the compiler
     296    will be <command>$LFS_TGT-gcc</command>. The binary tools and kernel
     297    headers can be a bit more complicated. Therefore, take no risks and use
     298    the available configure switches to enforce the correct selections. After
     299    the run of <command>configure</command>, check the contents of the
     300    <filename>config.make</filename> file in the <filename
     301    class="directory">build</filename> directory for all important details.
     302    Note the use of <parameter>CC="$LFS_TGT-gcc"</parameter> (with
     303    <envar>$LFS_TGT</envar> expanded) to control which binary tools are used
     304    and the use of the <parameter>-nostdinc</parameter> and
     305    <parameter>-isystem</parameter> flags to control the compiler's include
     306    search path. These items highlight an important aspect of the Glibc
     307    package&mdash;it is very self-sufficient in terms of its build machinery
     308    and generally does not rely on toolchain defaults.</para>
     309
     310    <para>As said above, the standard C++ library is compiled next, followed in
     311    Chapter 6 by all the programs that need themselves to be built. The install
     312    step of libstdc++ uses the <envar>DESTDIR</envar> variable to have the
     313    programs land into the LFS filesystem.</para>
     314
     315    <para>In Chapter 7 the native lfs compiler is built. First binutils-pass2,
     316    with the same <envar>DESTDIR</envar> install as the other programs is
     317    built, and then the second pass of GCC is constructed, omitting libstdc++
     318    and other non-important libraries.  Due to some weird logic in GCC's
     319    configure script, <envar>CC_FOR_TARGET</envar> ends up as
     320    <command>cc</command> when the host is the same as the target, but is
     321    different from the build system. This is why
     322    <parameter>CC_FOR_TARGET=$LFS_TGT-gcc</parameter> is put explicitely into
     323    the configure options.</para>
     324
     325    <para>Upon entering the chroot environment in <xref
     326    linkend="chapter-chroot-temporary-tools"/>, the first task is to install
     327    libstdc++. Then temporary installations of programs needed for the proper
     328    operation of the toolchain are performed. Programs needed for testing
     329    other programs are also built. From this point onwards, the
     330    core toolchain is self-contained and self-hosted.  In
     331    <xref linkend="chapter-building-system"/>, final versions of all the
     332    packages needed for a fully functional system are built, tested and
     333    installed.</para>
     334
     335  </sect2>
    165336
    166337</sect1>
  • chapter06/bash.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-bash" role="wrap">
     8<sect1 id="ch-tools-bash" role="wrap">
    99  <?dbhtml filename="bash.html"?>
    1010
     
    1717  <title>Bash-&bash-version;</title>
    1818
    19   <indexterm zone="ch-system-bash">
     19  <indexterm zone="ch-tools-bash">
    2020    <primary sortas="a-Bash">Bash</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Bash package contains the Bourne-Again SHell.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/bash.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&bash-ch6-sbu;</seg>
    34         <seg>&bash-ch6-du;</seg>
     36        <seg>&bash-tmp-sbu;</seg>
     37        <seg>&bash-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4144    <title>Installation of Bash</title>
    4245
    43     <para>Incorporate some upstream fixes:</para>
    44 
    45 <screen><userinput remap="pre">patch -Np1 -i ../&bash-fixes-patch;</userinput></screen>
    46 
    4746    <para>Prepare Bash for compilation:</para>
    4847
    49 <screen><userinput remap="configure">./configure --prefix=/usr                    \
    50             --docdir=/usr/share/doc/bash-&bash-version; \
    51             --without-bash-malloc            \
    52             --with-installed-readline</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr                   \
     49            --build=$(support/config.guess) \
     50            --host=$LFS_TGT                 \
     51            --without-bash-malloc</userinput></screen>
    5352
    5453    <variablelist>
    55       <title>The meaning of the new configure option:</title>
     54      <title>The meaning of the configure options:</title>
    5655
    5756      <varlistentry>
    58         <term><parameter>--with-installed-readline</parameter></term>
     57        <term><parameter>--without-bash-malloc</parameter></term>
    5958        <listitem>
    60           <para>This option tells Bash to use the <filename
    61           class="libraryfile">readline</filename> library that is already
    62           installed on the system rather than using its own readline
    63           version.</para>
     59          <para>This option turns off the use of Bash's memory allocation
     60          (<function>malloc</function>) function which is known to cause
     61          segmentation faults. By turning this option off, Bash will use
     62          the <function>malloc</function> functions from Glibc which are
     63          more stable.</para>
    6464        </listitem>
    6565      </varlistentry>
     
    7171<screen><userinput remap="make">make</userinput></screen>
    7272
    73     <para>Skip down to <quote>Install the
    74     package</quote> if not running the test suite.</para>
     73    <para>Install the package:</para>
    7574
    76     <para>To prepare the tests, ensure that the <systemitem class="username">tester</systemitem> user can write to the sources tree:</para>
     75<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    7776
    78 <screen><userinput remap="test">chown -Rv tester .</userinput></screen>
     77    <para>Move the excutable to where it is expected:</para>
    7978
    80     <para>Now, run the tests as the <systemitem
    81     class="username">tester</systemitem> user:</para>
     79<screen><userinput remap="install">mv $LFS/usr/bin/bash $LFS/bin/bash</userinput></screen>
    8280
    83 <screen><userinput remap="test">su tester &lt;&lt; EOF
    84 PATH=$PATH make tests &lt; $(tty)
    85 EOF</userinput></screen>
    86 <!--
    87     <para>The <systemitem class="username">tester</systemitem>
    88     user does not have enough permissions for all the tests to pass. This shows
    89     up in some <quote>diff</quote> output in four test results. Portions of the
    90     run-execscript, run-lastpipe, run-read, and run-test programs
    91     are known to fail in the LFS chroot environment, but pass if the tests
    92     are run in a full system.</para>
    93 -->
    94     <para>Install the package and move the main executable to
    95     <filename class='directory'>/bin</filename>:</para>
     81    <para>Make a link for the programs that use <command>sh</command> for
     82    a shell:</para>
    9683
    97 <screen><userinput remap="install">make install
    98 mv -vf /usr/bin/bash /bin</userinput></screen>
    99 
    100     <para>Run the newly compiled <command>bash</command> program (replacing the one that is
    101     currently being executed):</para>
    102 
    103 <screen role="nodump"><userinput>exec /bin/bash --login +h</userinput></screen>
    104 
    105     <note>
    106       <para>The parameters used make the <command>bash</command>
    107       process an interactive login shell and continue to disable hashing so
    108       that new programs are found as they become available.</para>
    109     </note>
     84<screen><userinput remap="install">ln -sv bash $LFS/bin/sh</userinput></screen>
    11085
    11186  </sect2>
    11287
    113   <sect2 id="contents-bash" role="content">
    114     <title>Contents of Bash</title>
     88  <sect2 role="content">
     89    <title/>
    11590
    116     <segmentedlist>
    117       <segtitle>Installed programs</segtitle>
    118       <segtitle>Installed directory</segtitle>
    119 
    120       <seglistitem>
    121         <seg>bash, bashbug, and sh (link to bash)</seg>
    122         <seg>/usr/include/bash, /usr/lib/bash, and
    123         /usr/share/doc/bash-&bash-version;</seg>
    124       </seglistitem>
    125     </segmentedlist>
    126 
    127     <variablelist>
    128       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    129       <?dbfo list-presentation="list"?>
    130       <?dbhtml list-presentation="table"?>
    131 
    132       <varlistentry id="bash">
    133         <term><command>bash</command></term>
    134         <listitem>
    135           <para>A widely-used command interpreter; it performs many types of
    136           expansions and substitutions on a given command line before executing
    137           it, thus making this interpreter a powerful tool</para>
    138           <indexterm zone="ch-system-bash bash">
    139             <primary sortas="b-bash">bash</primary>
    140           </indexterm>
    141         </listitem>
    142       </varlistentry>
    143 
    144       <varlistentry id="bashbug">
    145         <term><command>bashbug</command></term>
    146         <listitem>
    147           <para>A shell script to help the user compose and mail standard
    148           formatted bug reports concerning <command>bash</command></para>
    149           <indexterm zone="ch-system-bash bashbug">
    150             <primary sortas="b-bashbug">bashbug</primary>
    151           </indexterm>
    152         </listitem>
    153       </varlistentry>
    154 
    155       <varlistentry id="sh">
    156         <term><command>sh</command></term>
    157         <listitem>
    158           <para>A symlink to the <command>bash</command> program; when invoked
    159           as <command>sh</command>, <command>bash</command> tries to mimic the
    160           startup behavior of historical versions of <command>sh</command> as
    161           closely as possible, while conforming to the POSIX standard as
    162           well</para>
    163           <indexterm zone="ch-system-bash sh">
    164             <primary sortas="b-sh">sh</primary>
    165           </indexterm>
    166         </listitem>
    167       </varlistentry>
    168 
    169     </variablelist>
     91    <para>Details on this package are located in
     92    <xref linkend="contents-bash" role="."/></para>
    17093
    17194  </sect2>
  • chapter06/chapter06.xml

    r560065f r675606b  
    66]>
    77
    8 <chapter id="chapter-building-system" xreflabel="Chapter&nbsp;6">
     8<chapter id="chapter-temporary-tools" xreflabel="Chapter&nbsp;6">
    99  <?dbhtml dir="chapter06"?>
    1010  <?dbhtml filename="chapter06.html"?>
    1111
    12   <title>Installing Basic System Software</title>
     12  <title>Cross Compiling Temporary Tools</title>
    1313
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
    15   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernfs.xml"/>
    16   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgmgt.xml"/>
    17   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chroot.xml"/>
    18   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingdirs.xml"/>
    19   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="createfiles.xml"/>
    20   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="linux-headers.xml"/>
    21   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-pages.xml"/>
    22   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glibc.xml"/>
    23   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="adjusting.xml"/>
    24   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zlib.xml"/>
    25   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bzip2.xml"/>
    26   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
    27   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="zstd.xml"/>
     15  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
     17  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
     19  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
    2820  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="file.xml"/>
    29   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="readline.xml"/>
    30   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="m4.xml"/>
    31   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bc.xml"/>
    32   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="flex.xml"/>
    33   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils.xml"/>
    34   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gmp.xml"/>
    35   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpfr.xml"/>
    36   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mpc.xml"/>
    37   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="attr.xml"/>
    38   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="acl.xml"/>
    39   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libcap.xml"/>
    40   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="shadow.xml"/>
    41   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc.xml"/>
    42   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkgconfig.xml"/>
    43   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ncurses.xml"/>
    44   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
    45   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="psmisc.xml"/>
    46   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iana-etc.xml"/>
    47   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/>
    48   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/>
     21  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
     22  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
    4923  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grep.xml"/>
    50   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bash.xml"/>
    51   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libtool.xml"/>
    52   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gdbm.xml"/>
    53   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gperf.xml"/>
    54   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expat.xml"/>
    55   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inetutils.xml"/>
    56   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="perl.xml"/>
    57   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xml-parser.xml"/>
    58   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="intltool.xml"/>
    59   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="autoconf.xml"/>
    60   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="automake.xml"/>
    61   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kmod.xml"/>
    62   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libelf.xml"/>
    63   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libffi.xml"/>
    64   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="openssl.xml"/>
    65   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
    66   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ninja.xml"/>
    67   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="meson.xml"/>
    68   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
    69   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="check.xml"/>
    70   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="diffutils.xml"/>
    71   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gawk.xml"/>
    72   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="findutils.xml"/>
    73   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="groff.xml"/>
    74   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="grub.xml"/>
    75   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="less.xml"/>
    7624  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gzip.xml"/>
    77   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="iproute2.xml"/>
    78   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kbd.xml"/>
    79   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libpipeline.xml"/>
    8025  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="make.xml"/>
    8126  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="patch.xml"/>
    82   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="man-db.xml"/>
     27  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sed.xml"/>
    8328  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tar.xml"/>
    84   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/>
    85   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="vim.xml"/>
    86 
    87   <!-- systemd only -->
    88   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd.xml"/>
    89   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dbus.xml"/>
    90 
    91   <!-- sysv only -->
    92   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="eudev.xml"/>
    93 
    94   <!-- Both sysv on systemd builds -->
    95   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="procps.xml"/>
    96   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/>
    97 
    98   <!-- Both sysv and systemd builds -->
    99   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="e2fsprogs.xml"/>
    100 
    101   <!-- sysv only -->
    102   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>
    103   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysvinit.xml"/>
    104 
    105   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutdebug.xml"/>
    106   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="strippingagain.xml"/>
    107   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="revisedchroot.xml"/>
     29  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="xz.xml"/>
     30  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="binutils-pass2.xml"/>
     31  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gcc-pass2.xml"/>
    10832
    10933</chapter>
  • chapter06/coreutils.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-coreutils" role="wrap">
     8<sect1 id="ch-tools-coreutils" role="wrap">
    99  <?dbhtml filename="coreutils.html"?>
    1010
     
    1717  <title>Coreutils-&coreutils-version;</title>
    1818
    19   <indexterm zone="ch-system-coreutils">
     19  <indexterm zone="ch-tools-coreutils">
    2020    <primary sortas="a-Coreutils">Coreutils</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Coreutils package contains utilities for showing and setting the
    27     basic system characteristics.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/coreutils.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&coreutils-ch6-sbu;</seg>
    35         <seg>&coreutils-ch6-du;</seg>
     36        <seg>&coreutils-tmp-sbu;</seg>
     37        <seg>&coreutils-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4244    <title>Installation of Coreutils</title>
    4345
    44     <para>POSIX requires that programs from Coreutils recognize character
    45     boundaries correctly even in multibyte locales. The following patch fixes
    46     this non-compliance and other internationalization-related bugs.</para>
     46    <para>Prepare Coreutils for compilation:</para>
    4747
    48 <screen><userinput remap="pre">patch -Np1 -i ../&coreutils-i18n-patch;</userinput></screen>
    49 
    50     <note>
    51       <para>In the past, many bugs were found in this patch. When reporting new
    52       bugs to Coreutils maintainers, please check first if they are reproducible
    53       without this patch.</para>
    54     </note>
    55 
    56    <!-- this has been fixed in upstream gnulib, when a new version of
    57    coreutils is released, please check #4055 to see if the change has been
    58    picked up in this package -->
    59    <para>Suppress a test which on some machines can loop forever:</para>
    60 
    61 <screen><userinput remap="pre">sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk</userinput></screen>
    62 
    63     <para>Now prepare Coreutils for compilation:</para>
    64 
    65 <screen><userinput remap="configure">autoreconf -fiv
    66 FORCE_UNSAFE_CONFIGURE=1 ./configure \
    67             --prefix=/usr            \
     48<screen><userinput remap="configure">./configure --prefix=/usr                     \
     49            --host=$LFS_TGT                   \
     50            --build=$(build-aux/config.guess) \
     51            --enable-install-program=hostname \
    6852            --enable-no-install-program=kill,uptime</userinput></screen>
    6953
     
    7256
    7357      <varlistentry>
    74         <term><command>autoreconf</command></term>
     58        <term><envar>--enable-install-program=hostname</envar></term>
    7559        <listitem>
    76           <para>This command updates generated configuration files
    77           consistent with the latest version of automake.
    78           </para>
    79         </listitem>
    80       </varlistentry>
    81 
    82       <varlistentry>
    83         <term><envar>FORCE_UNSAFE_CONFIGURE=1</envar></term>
    84         <listitem>
    85           <para>This environment variable allows the package to be
    86           built as the root user.
    87           </para>
    88         </listitem>
    89       </varlistentry>
    90 
    91       <varlistentry>
    92         <term><parameter>--enable-no-install-program=kill,uptime</parameter></term>
    93         <listitem>
    94           <para>The purpose of this switch is to prevent Coreutils from
    95           installing binaries that will be installed by other packages later.
    96           </para>
     60          <para>This enables the <command>hostname</command> binary to be built
     61          and installed &ndash; it is disabled by default but is required by the
     62          Perl test suite.</para>
    9763        </listitem>
    9864      </varlistentry>
     
    10369<screen><userinput remap="make">make</userinput></screen>
    10470
    105     <para>Skip down to <quote>Install the
    106     package</quote> if not running the test suite.</para>
    107 
    108     <para>Now the test suite is ready to be run. First, run the tests that are
    109     meant to be run as user <systemitem class="username">root</systemitem>:</para>
    110 
    111 <screen><userinput remap="test">make NON_ROOT_USERNAME=tester check-root</userinput></screen>
    112 
    113     <para>We're going to run the remainder of the tests as the
    114     <systemitem class="username">tester</systemitem> user. Certain tests,
    115     however, require that the user be a member of more than one group. So that
    116     these tests are not skipped we'll add a temporary group and make the
    117     user <systemitem class="username">tester</systemitem> a part of it:</para>
    118 
    119 <screen><userinput remap="test">echo "dummy:x:102:tester" &gt;&gt; /etc/group</userinput></screen>
    120 
    121     <para>Fix some of the permissions so that the non-root user can compile and
    122     run the tests:</para>
    123 
    124 <screen><userinput remap="test">chown -Rv tester . </userinput></screen>
    125 
    126     <para>Now run the tests. Make sure the PATH in the <userinput>su</userinput>
    127     environment includes /tools/bin.</para>
    128 
    129 <screen><userinput remap="test">su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen>
    130 <!--
    131     <para>The test program test-getlogin is known to fail in a
    132     partially built system environment like the chroot environment here, but
    133     passes if run at the end of this chapter.  The test program tty.sh is
    134     also known to fail.</para>
    135 -->
    136 
    137     <para>Remove the temporary group:</para>
    138 
    139 <screen><userinput remap="test">sed -i '/dummy/d' /etc/group</userinput></screen>
    14071    <para>Install the package:</para>
    14172
    142 <screen><userinput remap="install">make install</userinput></screen>
     73<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
     74<!--
     75    <para>The above command refuses to install <filename>su</filename>
     76    because the program cannot be installed setuid root as a non-privileged
     77    user. By manually installing it, we can use it for running tests in the
     78    final system as a non-privileged user. Install it with:</para>
    14379
    144     <para>Move programs to the locations specified by the FHS:</para>
     80<screen><userinput remap="install">cp -v src/su /tools/bin</userinput></screen>
     81-->
     82    <para>Move programs to their final expected locations. Although this is
     83    not necessary in this temporary environment, we must do so because some
     84    programs harcode executable locations:</para>
    14585
    146 <screen><userinput remap="install">mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
    147 mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
    148 mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
    149 mv -v /usr/bin/chroot /usr/sbin
    150 mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
    151 sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8</userinput></screen>
    152 
    153     <para revision="sysv">Some of the scripts in the LFS-Bootscripts package
    154     depend on <command>head</command>, <command>nice</command>,
    155     <command>sleep</command>, and <command>touch</command>.  As <filename
    156     class="directory">/usr</filename> may not be available during the early and
    157     late stages of booting, those binaries need to be on the root partition to
    158     maintain FHS compliance:</para>
    159 
    160 <screen><userinput remap="install">mv -v /usr/bin/{head,nice,sleep,touch} /bin</userinput></screen>
     86<screen><userinput remap="install">mv -v $LFS/usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} $LFS/bin
     87mv -v $LFS/usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm}        $LFS/bin
     88mv -v $LFS/usr/bin/{rmdir,stty,sync,true,uname}               $LFS/bin
     89mv -v $LFS/usr/bin/{head,nice,sleep,touch}                    $LFS/bin
     90mv -v $LFS/usr/bin/chroot                                     $LFS/usr/sbin
     91mkdir -pv $LFS/usr/share/man/man8
     92mv -v $LFS/usr/share/man/man1/chroot.1                        $LFS/usr/share/man/man8/chroot.8
     93sed -i 's/"1"/"8"/'                                           $LFS/usr/share/man/man8/chroot.8</userinput></screen>
    16194
    16295  </sect2>
    16396
    164   <sect2 id="contents-coreutils" role="content">
    165     <title>Contents of Coreutils</title>
     97  <sect2 role="content">
     98    <title/>
    16699
    167     <segmentedlist>
    168       <segtitle>Installed programs</segtitle>
    169       <segtitle>Installed library</segtitle>
    170       <segtitle>Installed directory</segtitle>
    171 
    172       <seglistitem>
    173         <seg>[, b2sum, base32, base64, basename, basenc, cat, chcon, chgrp, chmod, chown,
    174         chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors,
    175         dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups,
    176         head, hostid, id, install, join, link, ln, logname, ls, md5sum, mkdir,
    177         mkfifo, mknod, mktemp, mv, nice, nl, nohup, nproc, numfmt, od, paste,
    178         pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, realpath, rm,
    179         rmdir, runcon, seq, sha1sum, sha224sum, sha256sum, sha384sum,
    180         sha512sum, shred, shuf, sleep, sort, split, stat, stdbuf, stty, sum,
    181         sync, tac, tail, tee, test, timeout, touch, tr, true, truncate, tsort,
    182         tty, uname, unexpand, uniq, unlink, users, vdir, wc, who, whoami, and
    183         yes</seg>
    184         <seg>libstdbuf.so (in /usr/libexec/coreutils)</seg>
    185         <seg>/usr/libexec/coreutils</seg>
    186       </seglistitem>
    187     </segmentedlist>
    188 
    189     <variablelist>
    190       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    191       <?dbfo list-presentation="list"?>
    192       <?dbhtml list-presentation="table"?>
    193 
    194       <varlistentry id="base32">
    195         <term><command>base32</command></term>
    196         <listitem>
    197           <para>Encodes and decodes data according to the base32 specification
    198           (RFC 4648)</para>
    199           <indexterm zone="ch-system-coreutils base64">
    200             <primary sortas="b-base64">base64</primary>
    201           </indexterm>
    202         </listitem>
    203       </varlistentry>
    204 
    205       <varlistentry id="base64">
    206         <term><command>base64</command></term>
    207         <listitem>
    208           <para>Encodes and decodes data according to the base64 specification
    209           (RFC 4648)</para>
    210           <indexterm zone="ch-system-coreutils base64">
    211             <primary sortas="b-base64">base64</primary>
    212           </indexterm>
    213         </listitem>
    214       </varlistentry>
    215 
    216       <varlistentry id="b2sum">
    217         <term><command>b2sum</command></term>
    218         <listitem>
    219           <para>Prints or checks BLAKE2 (512-bit) checksums</para>
    220           <indexterm zone="ch-system-coreutils b2sum">
    221             <primary sortas="b-b2sum">b2sum</primary>
    222           </indexterm>
    223         </listitem>
    224       </varlistentry>
    225 
    226       <varlistentry id="basename">
    227         <term><command>basename</command></term>
    228         <listitem>
    229           <para>Strips any path and a given suffix from a file name</para>
    230           <indexterm zone="ch-system-coreutils basename">
    231             <primary sortas="b-basename">basename</primary>
    232           </indexterm>
    233         </listitem>
    234       </varlistentry>
    235 
    236       <varlistentry id="basenc">
    237         <term><command>basenc</command></term>
    238         <listitem>
    239           <para>Encodes or decodes data using various algorithms</para>
    240           <indexterm zone="ch-system-coreutils basenc">
    241             <primary sortas="b-basenc">basenc</primary>
    242           </indexterm>
    243         </listitem>
    244       </varlistentry>
    245 
    246       <varlistentry id="cat">
    247         <term><command>cat</command></term>
    248         <listitem>
    249           <para>Concatenates files to standard output</para>
    250           <indexterm zone="ch-system-coreutils cat">
    251             <primary sortas="b-cat">cat</primary>
    252           </indexterm>
    253         </listitem>
    254       </varlistentry>
    255 
    256       <varlistentry id="chcon">
    257         <term><command>chcon</command></term>
    258         <listitem>
    259           <para>Changes security context for files and directories</para>
    260           <indexterm zone="ch-system-coreutils chcon">
    261             <primary sortas="b-chcon">chcon</primary>
    262           </indexterm>
    263         </listitem>
    264       </varlistentry>
    265 
    266       <varlistentry id="chgrp">
    267         <term><command>chgrp</command></term>
    268         <listitem>
    269           <para>Changes the group ownership of files and directories</para>
    270           <indexterm zone="ch-system-coreutils chgrp">
    271             <primary sortas="b-chgrp">chgrp</primary>
    272           </indexterm>
    273         </listitem>
    274       </varlistentry>
    275 
    276       <varlistentry id="chmod">
    277         <term><command>chmod</command></term>
    278         <listitem>
    279           <para>Changes the permissions of each file to the given mode; the mode
    280           can be either a symbolic representation of the changes to make or an
    281           octal number representing the new permissions</para>
    282           <indexterm zone="ch-system-coreutils chmod">
    283             <primary sortas="b-chmod">chmod</primary>
    284           </indexterm>
    285         </listitem>
    286       </varlistentry>
    287 
    288       <varlistentry id="chown">
    289         <term><command>chown</command></term>
    290         <listitem>
    291           <para>Changes the user and/or group ownership of files and
    292           directories</para>
    293           <indexterm zone="ch-system-coreutils chown">
    294             <primary sortas="b-chown">chown</primary>
    295           </indexterm>
    296         </listitem>
    297       </varlistentry>
    298 
    299       <varlistentry id="chroot">
    300         <term><command>chroot</command></term>
    301         <listitem>
    302           <para>Runs a command with the specified directory as the
    303           <filename class="directory">/</filename> directory</para>
    304           <indexterm zone="ch-system-coreutils chroot">
    305             <primary sortas="b-chroot">chroot</primary>
    306           </indexterm>
    307         </listitem>
    308       </varlistentry>
    309 
    310       <varlistentry id="cksum">
    311         <term><command>cksum</command></term>
    312         <listitem>
    313           <para>Prints the Cyclic Redundancy Check (CRC) checksum and the byte
    314           counts of each specified file</para>
    315           <indexterm zone="ch-system-coreutils cksum">
    316             <primary sortas="b-cksum">cksum</primary>
    317           </indexterm>
    318         </listitem>
    319       </varlistentry>
    320 
    321       <varlistentry id="comm">
    322         <term><command>comm</command></term>
    323         <listitem>
    324           <para>Compares two sorted files, outputting in three columns the lines
    325           that are unique and the lines that are common</para>
    326           <indexterm zone="ch-system-coreutils comm">
    327             <primary sortas="b-comm">comm</primary>
    328           </indexterm>
    329         </listitem>
    330       </varlistentry>
    331 
    332       <varlistentry id="cp">
    333         <term><command>cp</command></term>
    334         <listitem>
    335           <para>Copies files</para>
    336           <indexterm zone="ch-system-coreutils cp">
    337             <primary sortas="b-cp">cp</primary>
    338           </indexterm>
    339         </listitem>
    340       </varlistentry>
    341 
    342       <varlistentry id="csplit">
    343         <term><command>csplit</command></term>
    344         <listitem>
    345           <para>Splits a given file into several new files, separating them
    346           according to given patterns or line numbers and outputting the byte
    347           count of each new file</para>
    348           <indexterm zone="ch-system-coreutils csplit">
    349             <primary sortas="b-csplit">csplit</primary>
    350           </indexterm>
    351         </listitem>
    352       </varlistentry>
    353 
    354       <varlistentry id="cut">
    355         <term><command>cut</command></term>
    356         <listitem>
    357           <para>Prints sections of lines, selecting the parts according to given
    358           fields or positions</para>
    359           <indexterm zone="ch-system-coreutils cut">
    360             <primary sortas="b-cut">cut</primary>
    361           </indexterm>
    362         </listitem>
    363       </varlistentry>
    364 
    365       <varlistentry id="date">
    366         <term><command>date</command></term>
    367         <listitem>
    368           <para>Displays the current time in the given format, or sets the
    369           system date</para>
    370           <indexterm zone="ch-system-coreutils date">
    371             <primary sortas="b-date">date</primary>
    372           </indexterm>
    373         </listitem>
    374       </varlistentry>
    375 
    376       <varlistentry id="dd">
    377         <term><command>dd</command> </term>
    378         <listitem>
    379           <para>Copies a file using the given block size and count, while
    380           optionally performing conversions on it</para>
    381           <indexterm zone="ch-system-coreutils dd">
    382             <primary sortas="b-dd">dd</primary>
    383           </indexterm>
    384         </listitem>
    385       </varlistentry>
    386 
    387       <varlistentry id="df">
    388         <term><command>df</command></term>
    389         <listitem>
    390           <para>Reports the amount of disk space available (and used) on all
    391           mounted file systems, or only on the file systems holding the selected
    392           files</para>
    393           <indexterm zone="ch-system-coreutils df">
    394             <primary sortas="b-df">df</primary>
    395           </indexterm>
    396         </listitem>
    397       </varlistentry>
    398 
    399       <varlistentry id="dir">
    400         <term><command>dir</command></term>
    401         <listitem>
    402           <para>Lists the contents of each given directory (the same as
    403           the <command>ls</command> command)</para>
    404           <indexterm zone="ch-system-coreutils dir">
    405             <primary sortas="b-dir">dir</primary>
    406           </indexterm>
    407         </listitem>
    408       </varlistentry>
    409 
    410       <varlistentry id="dircolors">
    411         <term><command>dircolors</command></term>
    412         <listitem>
    413           <para>Outputs commands to set the <envar>LS_COLOR</envar>
    414           environment variable to change the color scheme used by
    415           <command>ls</command></para>
    416           <indexterm zone="ch-system-coreutils dircolors">
    417             <primary sortas="b-dircolors">dircolors</primary>
    418           </indexterm>
    419         </listitem>
    420       </varlistentry>
    421 
    422       <varlistentry id="dirname">
    423         <term><command>dirname</command></term>
    424         <listitem>
    425           <para>Strips the non-directory suffix from a file name</para>
    426           <indexterm zone="ch-system-coreutils dirname">
    427             <primary sortas="b-dirname">dirname</primary>
    428           </indexterm>
    429         </listitem>
    430       </varlistentry>
    431 
    432       <varlistentry id="du">
    433         <term><command>du</command></term>
    434         <listitem>
    435           <para>Reports the amount of disk space used by the current directory,
    436           by each of the given directories (including all subdirectories) or by
    437           each of the given files</para>
    438           <indexterm zone="ch-system-coreutils du">
    439             <primary sortas="b-du">du</primary>
    440           </indexterm>
    441         </listitem>
    442       </varlistentry>
    443 
    444       <varlistentry id="echo">
    445         <term><command>echo</command></term>
    446         <listitem>
    447           <para>Displays the given strings</para>
    448           <indexterm zone="ch-system-coreutils echo">
    449             <primary sortas="b-echo">echo</primary>
    450           </indexterm>
    451         </listitem>
    452       </varlistentry>
    453 
    454       <varlistentry id="env">
    455         <term><command>env</command></term>
    456         <listitem>
    457           <para>Runs a command in a modified environment</para>
    458           <indexterm zone="ch-system-coreutils env">
    459             <primary sortas="b-env">env</primary>
    460           </indexterm>
    461         </listitem>
    462       </varlistentry>
    463 
    464       <varlistentry id="expand">
    465         <term><command>expand</command></term>
    466         <listitem>
    467           <para>Converts tabs to spaces</para>
    468           <indexterm zone="ch-system-coreutils expand">
    469             <primary sortas="b-expand">expand</primary>
    470           </indexterm>
    471         </listitem>
    472       </varlistentry>
    473 
    474       <varlistentry id="expr">
    475         <term><command>expr</command></term>
    476         <listitem>
    477           <para>Evaluates expressions</para>
    478           <indexterm zone="ch-system-coreutils expr">
    479             <primary sortas="b-expr">expr</primary>
    480           </indexterm>
    481         </listitem>
    482       </varlistentry>
    483 
    484       <varlistentry id="factor">
    485         <term><command>factor</command></term>
    486         <listitem>
    487           <para>Prints the prime factors of all specified integer numbers</para>
    488           <indexterm zone="ch-system-coreutils factor">
    489             <primary sortas="b-factor">factor</primary>
    490           </indexterm>
    491         </listitem>
    492       </varlistentry>
    493 
    494       <varlistentry id="false">
    495         <term><command>false</command></term>
    496         <listitem>
    497           <para>Does nothing, unsuccessfully; it always exits with a status code
    498           indicating failure</para>
    499           <indexterm zone="ch-system-coreutils false">
    500             <primary sortas="b-false">false</primary>
    501           </indexterm>
    502         </listitem>
    503       </varlistentry>
    504 
    505       <varlistentry id="fmt">
    506         <term><command>fmt</command></term>
    507         <listitem>
    508           <para>Reformats the paragraphs in the given files</para>
    509           <indexterm zone="ch-system-coreutils fmt">
    510             <primary sortas="b-fmt">fmt</primary>
    511           </indexterm>
    512         </listitem>
    513       </varlistentry>
    514 
    515       <varlistentry id="fold">
    516         <term><command>fold</command></term>
    517         <listitem>
    518           <para>Wraps the lines in the given files</para>
    519           <indexterm zone="ch-system-coreutils fold">
    520             <primary sortas="b-fold">fold</primary>
    521           </indexterm>
    522         </listitem>
    523       </varlistentry>
    524 
    525       <varlistentry id="groups">
    526         <term><command>groups</command></term>
    527         <listitem>
    528           <para>Reports a user's group memberships</para>
    529           <indexterm zone="ch-system-coreutils groups">
    530             <primary sortas="b-groups">groups</primary>
    531           </indexterm>
    532         </listitem>
    533       </varlistentry>
    534 
    535       <varlistentry id="head">
    536         <term><command>head</command></term>
    537         <listitem>
    538           <para>Prints the first ten lines (or the given number of lines)
    539           of each given file</para>
    540           <indexterm zone="ch-system-coreutils head">
    541             <primary sortas="b-head">head</primary>
    542           </indexterm>
    543         </listitem>
    544       </varlistentry>
    545 
    546       <varlistentry id="hostid">
    547         <term><command>hostid</command></term>
    548         <listitem>
    549           <para>Reports the numeric identifier (in hexadecimal) of the host</para>
    550           <indexterm zone="ch-system-coreutils hostid">
    551             <primary sortas="b-hostid">hostid</primary>
    552           </indexterm>
    553         </listitem>
    554       </varlistentry>
    555 
    556       <varlistentry id="id">
    557         <term><command>id</command></term>
    558         <listitem>
    559           <para>Reports the effective user ID, group ID, and group memberships
    560           of the current user or specified user</para>
    561           <indexterm zone="ch-system-coreutils id">
    562             <primary sortas="b-id">id</primary>
    563           </indexterm>
    564         </listitem>
    565       </varlistentry>
    566 
    567       <varlistentry id="install">
    568         <term><command>install</command> </term>
    569         <listitem>
    570           <para>Copies files while setting their permission modes and, if
    571           possible, their owner and group</para>
    572           <indexterm zone="ch-system-coreutils install">
    573             <primary sortas="b-install">install</primary>
    574           </indexterm>
    575         </listitem>
    576       </varlistentry>
    577 
    578       <varlistentry id="join">
    579         <term><command>join</command></term>
    580         <listitem>
    581           <para>Joins the lines that have identical join fields from two
    582           separate files</para>
    583           <indexterm zone="ch-system-coreutils join">
    584             <primary sortas="b-join">join</primary>
    585           </indexterm>
    586         </listitem>
    587       </varlistentry>
    588 
    589       <varlistentry id="link">
    590         <term><command>link</command></term>
    591         <listitem>
    592           <para>Creates a hard link with the given name to a file</para>
    593           <indexterm zone="ch-system-coreutils link">
    594             <primary sortas="b-link">link</primary>
    595           </indexterm>
    596         </listitem>
    597       </varlistentry>
    598 
    599       <varlistentry id="ln">
    600         <term><command>ln</command></term>
    601         <listitem>
    602           <para>Makes hard links or soft (symbolic) links between files</para>
    603           <indexterm zone="ch-system-coreutils ln">
    604             <primary sortas="b-ln">ln</primary>
    605           </indexterm>
    606         </listitem>
    607       </varlistentry>
    608 
    609       <varlistentry id="logname">
    610         <term><command>logname</command></term>
    611         <listitem>
    612           <para>Reports the current user's login name</para>
    613           <indexterm zone="ch-system-coreutils logname">
    614             <primary sortas="b-logname">logname</primary>
    615           </indexterm>
    616         </listitem>
    617       </varlistentry>
    618 
    619       <varlistentry id="ls">
    620         <term><command>ls</command></term>
    621         <listitem>
    622           <para>Lists the contents of each given directory</para>
    623           <indexterm zone="ch-system-coreutils ls">
    624             <primary sortas="b-ls">ls</primary>
    625           </indexterm>
    626         </listitem>
    627       </varlistentry>
    628 
    629       <varlistentry id="md5sum">
    630         <term><command>md5sum</command></term>
    631         <listitem>
    632           <para>Reports or checks Message Digest 5 (MD5) checksums</para>
    633           <indexterm zone="ch-system-coreutils md5sum">
    634             <primary sortas="b-md5sum">md5sum</primary>
    635           </indexterm>
    636         </listitem>
    637       </varlistentry>
    638 
    639       <varlistentry id="mkdir">
    640         <term><command>mkdir</command></term>
    641         <listitem>
    642           <para>Creates directories with the given names</para>
    643           <indexterm zone="ch-system-coreutils mkdir">
    644             <primary sortas="b-mkdir">mkdir</primary>
    645           </indexterm>
    646         </listitem>
    647       </varlistentry>
    648 
    649       <varlistentry id="mkfifo">
    650         <term><command>mkfifo</command></term>
    651         <listitem>
    652           <para>Creates First-In, First-Outs (FIFOs), a "named
    653           pipe" in UNIX parlance, with the given names</para>
    654           <indexterm zone="ch-system-coreutils mkfifo">
    655             <primary sortas="b-mkfifo">mkfifo</primary>
    656           </indexterm>
    657         </listitem>
    658       </varlistentry>
    659 
    660       <varlistentry id="mknod">
    661         <term><command>mknod</command></term>
    662         <listitem>
    663           <para>Creates device nodes with the given names; a device node is a
    664           character special file, a block special file, or a FIFO</para>
    665           <indexterm zone="ch-system-coreutils mknod">
    666             <primary sortas="b-mknod">mknod</primary>
    667           </indexterm>
    668         </listitem>
    669       </varlistentry>
    670 
    671       <varlistentry id="mktemp">
    672         <term><command>mktemp</command></term>
    673         <listitem>
    674           <para>Creates temporary files in a secure manner; it is used in scripts</para>
    675         <indexterm zone="ch-system-coreutils mktemp">
    676           <primary sortas="b-mktemp">mktemp</primary>
    677         </indexterm>
    678        </listitem>
    679      </varlistentry>
    680 
    681       <varlistentry id="mv">
    682         <term><command>mv</command></term>
    683         <listitem>
    684           <para>Moves or renames files or directories</para>
    685           <indexterm zone="ch-system-coreutils mv">
    686             <primary sortas="b-mv">mv</primary>
    687           </indexterm>
    688         </listitem>
    689       </varlistentry>
    690 
    691       <varlistentry id="nice">
    692         <term><command>nice</command></term>
    693         <listitem>
    694           <para>Runs a program with modified scheduling priority</para>
    695           <indexterm zone="ch-system-coreutils nice">
    696             <primary sortas="b-nice">nice</primary>
    697           </indexterm>
    698         </listitem>
    699       </varlistentry>
    700 
    701       <varlistentry id="nl">
    702         <term><command>nl</command></term>
    703         <listitem>
    704           <para>Numbers the lines from the given files</para>
    705           <indexterm zone="ch-system-coreutils nl">
    706             <primary sortas="b-nl">nl</primary>
    707           </indexterm>
    708         </listitem>
    709       </varlistentry>
    710 
    711       <varlistentry id="nohup">
    712         <term><command>nohup</command></term>
    713         <listitem>
    714           <para>Runs a command immune to hangups, with its output redirected to
    715           a log file</para>
    716           <indexterm zone="ch-system-coreutils nohup">
    717             <primary sortas="b-nohup">nohup</primary>
    718           </indexterm>
    719         </listitem>
    720       </varlistentry>
    721 
    722       <varlistentry id="nproc">
    723         <term><command>nproc</command></term>
    724         <listitem>
    725           <para>Prints the number of processing units available to a
    726           process</para>
    727           <indexterm zone="ch-system-coreutils nproc">
    728             <primary sortas="b-nproc">nproc</primary>
    729           </indexterm>
    730         </listitem>
    731       </varlistentry>
    732 
    733       <varlistentry id="numfmt">
    734         <term><command>numfmt</command></term>
    735         <listitem>
    736           <para>Converts numbers to or from human-readable strings</para>
    737           <indexterm zone="ch-system-coreutils numfmt">
    738             <primary sortas="b-numfmt">numfmt</primary>
    739           </indexterm>
    740         </listitem>
    741       </varlistentry>
    742 
    743       <varlistentry id="od">
    744         <term><command>od</command></term>
    745         <listitem>
    746           <para>Dumps files in octal and other formats</para>
    747           <indexterm zone="ch-system-coreutils od">
    748             <primary sortas="b-od">od</primary>
    749           </indexterm>
    750         </listitem>
    751       </varlistentry>
    752 
    753       <varlistentry id="paste">
    754         <term><command>paste</command></term>
    755         <listitem>
    756           <para>Merges the given files, joining sequentially corresponding lines
    757           side by side, separated by tab characters</para>
    758           <indexterm zone="ch-system-coreutils paste">
    759             <primary sortas="b-paste">paste</primary>
    760           </indexterm>
    761         </listitem>
    762       </varlistentry>
    763 
    764       <varlistentry id="pathchk">
    765         <term><command>pathchk</command></term>
    766         <listitem>
    767           <para>Checks if file names are valid or portable</para>
    768           <indexterm zone="ch-system-coreutils pathchk">
    769             <primary sortas="b-pathchk">pathchk</primary>
    770           </indexterm>
    771         </listitem>
    772       </varlistentry>
    773 
    774       <varlistentry id="pinky">
    775         <term><command>pinky</command></term>
    776         <listitem>
    777           <para>Is a lightweight finger client; it reports some information
    778           about the given users</para>
    779           <indexterm zone="ch-system-coreutils pinky">
    780             <primary sortas="b-pinky">pinky</primary>
    781           </indexterm>
    782         </listitem>
    783       </varlistentry>
    784 
    785       <varlistentry id="pr">
    786         <term><command>pr</command></term>
    787         <listitem>
    788           <para>Paginates and columnates files for printing</para>
    789           <indexterm zone="ch-system-coreutils pr">
    790             <primary sortas="b-pr">pr</primary>
    791           </indexterm>
    792         </listitem>
    793       </varlistentry>
    794 
    795       <varlistentry id="printenv">
    796         <term><command>printenv</command></term>
    797         <listitem>
    798           <para>Prints the environment</para>
    799           <indexterm zone="ch-system-coreutils printenv">
    800             <primary sortas="b-printenv">printenv</primary>
    801           </indexterm>
    802         </listitem>
    803       </varlistentry>
    804 
    805       <varlistentry id="printf">
    806         <term><command>printf</command></term>
    807         <listitem>
    808           <para>Prints the given arguments according to the given format, much
    809           like the C printf function</para>
    810           <indexterm zone="ch-system-coreutils printf">
    811             <primary sortas="b-printf">printf</primary>
    812           </indexterm>
    813         </listitem>
    814       </varlistentry>
    815 
    816       <varlistentry id="ptx">
    817         <term><command>ptx</command></term>
    818         <listitem>
    819           <para>Produces a permuted index from the contents of the given files,
    820           with each keyword in its context</para>
    821           <indexterm zone="ch-system-coreutils ptx">
    822             <primary sortas="b-ptx">ptx</primary>
    823           </indexterm>
    824         </listitem>
    825       </varlistentry>
    826 
    827       <varlistentry id="pwd">
    828         <term><command>pwd</command></term>
    829         <listitem>
    830           <para>Reports the name of the current working directory</para>
    831           <indexterm zone="ch-system-coreutils pwd">
    832             <primary sortas="b-pwd">pwd</primary>
    833           </indexterm>
    834         </listitem>
    835       </varlistentry>
    836 
    837       <varlistentry id="readlink">
    838         <term><command>readlink</command></term>
    839         <listitem>
    840           <para>Reports the value of the given symbolic link</para>
    841           <indexterm zone="ch-system-coreutils readlink">
    842             <primary sortas="b-readlink">readlink</primary>
    843           </indexterm>
    844         </listitem>
    845       </varlistentry>
    846 
    847       <varlistentry id="realpath">
    848         <term><command>realpath</command></term>
    849         <listitem>
    850           <para>Prints the resolved path</para>
    851           <indexterm zone="ch-system-coreutils realpath">
    852             <primary sortas="b-realpath">realpath</primary>
    853           </indexterm>
    854         </listitem>
    855       </varlistentry>
    856 
    857       <varlistentry id="rm">
    858         <term><command>rm</command></term>
    859         <listitem>
    860           <para>Removes files or directories</para>
    861           <indexterm zone="ch-system-coreutils rm">
    862             <primary sortas="b-rm">rm</primary>
    863           </indexterm>
    864         </listitem>
    865       </varlistentry>
    866 
    867       <varlistentry id="rmdir">
    868         <term><command>rmdir</command></term>
    869         <listitem>
    870           <para>Removes directories if they are empty</para>
    871           <indexterm zone="ch-system-coreutils rmdir">
    872             <primary sortas="b-rmdir">rmdir</primary>
    873           </indexterm>
    874         </listitem>
    875       </varlistentry>
    876 
    877       <varlistentry id="runcon">
    878         <term><command>runcon</command></term>
    879         <listitem>
    880           <para>Runs a command with specified security context</para>
    881           <indexterm zone="ch-system-coreutils runcon">
    882             <primary sortas="b-runcon">runcon</primary>
    883           </indexterm>
    884         </listitem>
    885       </varlistentry>
    886 
    887       <varlistentry id="seq">
    888         <term><command>seq</command></term>
    889         <listitem>
    890           <para>Prints a sequence of numbers within a given range and with a
    891           given increment</para>
    892           <indexterm zone="ch-system-coreutils seq">
    893             <primary sortas="b-seq">seq</primary>
    894           </indexterm>
    895         </listitem>
    896       </varlistentry>
    897 
    898       <varlistentry id="sha1sum">
    899         <term><command>sha1sum</command></term>
    900         <listitem>
    901           <para>Prints or checks 160-bit Secure Hash Algorithm 1 (SHA1)
    902           checksums</para>
    903           <indexterm zone="ch-system-coreutils sha1sum">
    904             <primary sortas="b-sha1sum">sha1sum</primary>
    905           </indexterm>
    906         </listitem>
    907       </varlistentry>
    908 
    909       <varlistentry id="sha224sum">
    910         <term><command>sha224sum</command></term>
    911         <listitem>
    912           <para>Prints or checks 224-bit Secure Hash Algorithm checksums</para>
    913           <indexterm zone="ch-system-coreutils sha224sum">
    914             <primary sortas="b-sha224sum">sha224sum</primary>
    915           </indexterm>
    916         </listitem>
    917       </varlistentry>
    918 
    919       <varlistentry id="sha256sum">
    920         <term><command>sha256sum</command></term>
    921         <listitem>
    922           <para>Prints or checks 256-bit Secure Hash Algorithm checksums</para>
    923           <indexterm zone="ch-system-coreutils sha256sum">
    924             <primary sortas="b-sha256sum">sha256sum</primary>
    925           </indexterm>
    926         </listitem>
    927       </varlistentry>
    928 
    929       <varlistentry id="sha384sum">
    930         <term><command>sha384sum</command></term>
    931         <listitem>
    932           <para>Prints or checks 384-bit Secure Hash Algorithm checksums</para>
    933           <indexterm zone="ch-system-coreutils sha384sum">
    934             <primary sortas="b-sha384sum">sha384sum</primary>
    935           </indexterm>
    936         </listitem>
    937       </varlistentry>
    938 
    939       <varlistentry id="sha512sum">
    940         <term><command>sha512sum</command></term>
    941         <listitem>
    942           <para>Prints or checks 512-bit Secure Hash Algorithm checksums</para>
    943           <indexterm zone="ch-system-coreutils sha512sum">
    944             <primary sortas="b-sha512sum">sha512sum</primary>
    945           </indexterm>
    946         </listitem>
    947       </varlistentry>
    948 
    949       <varlistentry id="shred">
    950         <term><command>shred</command></term>
    951         <listitem>
    952           <para>Overwrites the given files repeatedly with complex patterns,
    953           making it difficult to recover the data</para>
    954           <indexterm zone="ch-system-coreutils shred">
    955             <primary sortas="b-shred">shred</primary>
    956           </indexterm>
    957         </listitem>
    958       </varlistentry>
    959 
    960       <varlistentry id="shuf">
    961         <term><command>shuf</command></term>
    962         <listitem>
    963           <para>Shuffles lines of text</para>
    964           <indexterm zone="ch-system-coreutils shuf">
    965             <primary sortas="b-shuf">shuf</primary>
    966           </indexterm>
    967         </listitem>
    968       </varlistentry>
    969 
    970       <varlistentry id="sleep">
    971         <term><command>sleep</command></term>
    972         <listitem>
    973           <para>Pauses for the given amount of time</para>
    974           <indexterm zone="ch-system-coreutils sleep">
    975             <primary sortas="b-sleep">sleep</primary>
    976           </indexterm>
    977         </listitem>
    978       </varlistentry>
    979 
    980       <varlistentry id="sort">
    981         <term><command>sort</command></term>
    982         <listitem>
    983           <para>Sorts the lines from the given files</para>
    984           <indexterm zone="ch-system-coreutils sort">
    985             <primary sortas="b-sort">sort</primary>
    986           </indexterm>
    987         </listitem>
    988       </varlistentry>
    989 
    990       <varlistentry id="split">
    991         <term><command>split</command></term>
    992         <listitem>
    993           <para>Splits the given file into pieces, by size or by number of
    994           lines</para>
    995           <indexterm zone="ch-system-coreutils split">
    996             <primary sortas="b-split">split</primary>
    997           </indexterm>
    998         </listitem>
    999       </varlistentry>
    1000 
    1001       <varlistentry id="stat">
    1002         <term><command>stat</command></term>
    1003         <listitem>
    1004           <para>Displays file or filesystem status</para>
    1005           <indexterm zone="ch-system-coreutils stat">
    1006             <primary sortas="b-stat">stat</primary>
    1007           </indexterm>
    1008         </listitem>
    1009       </varlistentry>
    1010 
    1011       <varlistentry id="stdbuf">
    1012         <term><command>stdbuf</command></term>
    1013         <listitem>
    1014           <para>Runs commands with altered buffering operations for its standard
    1015           streams</para>
    1016           <indexterm zone="ch-system-coreutils stdbuf">
    1017             <primary sortas="b-stdbuf">stdbuf</primary>
    1018           </indexterm>
    1019         </listitem>
    1020       </varlistentry>
    1021 
    1022       <varlistentry id="stty">
    1023         <term><command>stty</command></term>
    1024         <listitem>
    1025           <para>Sets or reports terminal line settings</para>
    1026           <indexterm zone="ch-system-coreutils stty">
    1027             <primary sortas="b-stty">stty</primary>
    1028           </indexterm>
    1029         </listitem>
    1030       </varlistentry>
    1031 
    1032       <varlistentry id="sum">
    1033         <term><command>sum</command></term>
    1034         <listitem>
    1035           <para>Prints checksum and block counts for each given file</para>
    1036           <indexterm zone="ch-system-coreutils sum">
    1037             <primary sortas="b-sum">sum</primary>
    1038           </indexterm>
    1039         </listitem>
    1040       </varlistentry>
    1041 
    1042       <varlistentry id="sync">
    1043         <term><command>sync</command></term>
    1044         <listitem>
    1045           <para>Flushes file system buffers; it forces changed blocks to disk
    1046           and updates the super block</para>
    1047           <indexterm zone="ch-system-coreutils sync">
    1048             <primary sortas="b-sync">sync</primary>
    1049           </indexterm>
    1050         </listitem>
    1051       </varlistentry>
    1052 
    1053       <varlistentry id="tac">
    1054         <term><command>tac</command></term>
    1055         <listitem>
    1056           <para>Concatenates the given files in reverse</para>
    1057           <indexterm zone="ch-system-coreutils tac">
    1058             <primary sortas="b-tac">tac</primary>
    1059           </indexterm>
    1060         </listitem>
    1061       </varlistentry>
    1062 
    1063       <varlistentry id="tail">
    1064         <term><command>tail</command></term>
    1065         <listitem>
    1066           <para>Prints the last ten lines (or the given number of lines) of each
    1067           given file</para>
    1068           <indexterm zone="ch-system-coreutils tail">
    1069             <primary sortas="b-tail">tail</primary>
    1070           </indexterm>
    1071         </listitem>
    1072       </varlistentry>
    1073 
    1074       <varlistentry id="tee">
    1075         <term><command>tee</command></term>
    1076         <listitem>
    1077           <para>Reads from standard input while writing both to standard output
    1078           and to the given files</para>
    1079           <indexterm zone="ch-system-coreutils tee">
    1080             <primary sortas="b-tee">tee</primary>
    1081           </indexterm>
    1082         </listitem>
    1083       </varlistentry>
    1084 
    1085       <varlistentry id="test">
    1086         <term><command>test</command></term>
    1087         <listitem>
    1088           <para>Compares values and checks file types</para>
    1089           <indexterm zone="ch-system-coreutils test">
    1090             <primary sortas="b-test">test</primary>
    1091           </indexterm>
    1092         </listitem>
    1093       </varlistentry>
    1094 
    1095       <varlistentry id="timeout">
    1096         <term><command>timeout</command></term>
    1097         <listitem>
    1098           <para>Runs a command with a time limit</para>
    1099           <indexterm zone="ch-system-coreutils timeout">
    1100             <primary sortas="b-timeout">timeout</primary>
    1101           </indexterm>
    1102         </listitem>
    1103       </varlistentry>
    1104 
    1105       <varlistentry id="touch">
    1106         <term><command>touch</command></term>
    1107         <listitem>
    1108           <para>Changes file timestamps, setting the access and modification
    1109           times of the given files to the current time; files that do not exist
    1110           are created with zero length</para>
    1111           <indexterm zone="ch-system-coreutils touch">
    1112             <primary sortas="b-touch">touch</primary>
    1113           </indexterm>
    1114         </listitem>
    1115       </varlistentry>
    1116 
    1117       <varlistentry id="tr">
    1118         <term><command>tr</command></term>
    1119         <listitem>
    1120           <para>Translates, squeezes, and deletes the given characters from
    1121           standard input</para>
    1122           <indexterm zone="ch-system-coreutils tr">
    1123             <primary sortas="b-tr">tr</primary>
    1124           </indexterm>
    1125         </listitem>
    1126       </varlistentry>
    1127 
    1128       <varlistentry id="true">
    1129         <term><command>true</command></term>
    1130         <listitem>
    1131           <para>Does nothing, successfully; it always exits with a status code
    1132           indicating success</para>
    1133           <indexterm zone="ch-system-coreutils true">
    1134             <primary sortas="b-true">true</primary>
    1135           </indexterm>
    1136         </listitem>
    1137       </varlistentry>
    1138 
    1139       <varlistentry id="truncate">
    1140         <term><command>truncate</command></term>
    1141         <listitem>
    1142           <para>Shrinks or expands a file to the specified size</para>
    1143           <indexterm zone="ch-system-coreutils truncate">
    1144             <primary sortas="b-truncate">truncate</primary>
    1145           </indexterm>
    1146         </listitem>
    1147       </varlistentry>
    1148 
    1149       <varlistentry id="tsort">
    1150         <term><command>tsort</command></term>
    1151         <listitem>
    1152           <para>Performs a topological sort; it writes a completely ordered list
    1153           according to the partial ordering in a given file</para>
    1154           <indexterm zone="ch-system-coreutils tsort">
    1155             <primary sortas="b-tsort">tsort</primary>
    1156           </indexterm>
    1157         </listitem>
    1158       </varlistentry>
    1159 
    1160       <varlistentry id="tty">
    1161         <term><command>tty</command></term>
    1162         <listitem>
    1163           <para>Reports the file name of the terminal connected to standard
    1164           input</para>
    1165           <indexterm zone="ch-system-coreutils tty">
    1166             <primary sortas="b-tty">tty</primary>
    1167           </indexterm>
    1168         </listitem>
    1169       </varlistentry>
    1170 
    1171       <varlistentry id="uname">
    1172         <term><command>uname</command></term>
    1173         <listitem>
    1174           <para>Reports system information</para>
    1175           <indexterm zone="ch-system-coreutils uname">
    1176             <primary sortas="b-uname">uname</primary>
    1177           </indexterm>
    1178         </listitem>
    1179       </varlistentry>
    1180 
    1181       <varlistentry id="unexpand">
    1182         <term><command>unexpand</command></term>
    1183         <listitem>
    1184           <para>Converts spaces to tabs</para>
    1185           <indexterm zone="ch-system-coreutils unexpand">
    1186             <primary sortas="b-unexpand">unexpand</primary>
    1187           </indexterm>
    1188         </listitem>
    1189       </varlistentry>
    1190 
    1191       <varlistentry id="uniq">
    1192         <term><command>uniq</command></term>
    1193         <listitem>
    1194           <para>Discards all but one of successive identical lines</para>
    1195           <indexterm zone="ch-system-coreutils uniq">
    1196             <primary sortas="b-uniq">uniq</primary>
    1197           </indexterm>
    1198         </listitem>
    1199       </varlistentry>
    1200 
    1201       <varlistentry id="unlink">
    1202         <term><command>unlink</command></term>
    1203         <listitem>
    1204           <para>Removes the given file</para>
    1205           <indexterm zone="ch-system-coreutils unlink">
    1206             <primary sortas="b-unlink">unlink</primary>
    1207           </indexterm>
    1208         </listitem>
    1209       </varlistentry>
    1210 
    1211       <varlistentry id="users">
    1212         <term><command>users</command></term>
    1213         <listitem>
    1214           <para>Reports the names of the users currently logged on</para>
    1215           <indexterm zone="ch-system-coreutils users">
    1216             <primary sortas="b-users">users</primary>
    1217           </indexterm>
    1218         </listitem>
    1219       </varlistentry>
    1220 
    1221       <varlistentry id="vdir">
    1222         <term><command>vdir</command></term>
    1223         <listitem>
    1224           <para>Is the same as <command>ls -l</command></para>
    1225           <indexterm zone="ch-system-coreutils vdir">
    1226             <primary sortas="b-vdir">vdir</primary>
    1227           </indexterm>
    1228         </listitem>
    1229       </varlistentry>
    1230 
    1231       <varlistentry id="wc">
    1232         <term><command>wc</command></term>
    1233         <listitem>
    1234           <para>Reports the number of lines, words, and bytes for each given
    1235           file, as well as a total line when more than one file is given</para>
    1236           <indexterm zone="ch-system-coreutils wc">
    1237             <primary sortas="b-wc">wc</primary>
    1238           </indexterm>
    1239         </listitem>
    1240       </varlistentry>
    1241 
    1242       <varlistentry id="who">
    1243         <term><command>who</command></term>
    1244         <listitem>
    1245           <para>Reports who is logged on</para>
    1246           <indexterm zone="ch-system-coreutils who">
    1247             <primary sortas="b-who">who</primary>
    1248           </indexterm>
    1249         </listitem>
    1250       </varlistentry>
    1251 
    1252       <varlistentry id="whoami">
    1253         <term><command>whoami</command></term>
    1254         <listitem>
    1255           <para>Reports the user name associated with the current effective
    1256           user ID</para>
    1257           <indexterm zone="ch-system-coreutils whoami">
    1258             <primary sortas="b-whoami">whoami</primary>
    1259           </indexterm>
    1260         </listitem>
    1261       </varlistentry>
    1262 
    1263       <varlistentry id="yes">
    1264         <term><command>yes</command></term>
    1265         <listitem>
    1266           <para>Repeatedly outputs <quote>y</quote> or a given string until
    1267           killed</para>
    1268           <indexterm zone="ch-system-coreutils yes">
    1269             <primary sortas="b-yes">yes</primary>
    1270           </indexterm>
    1271         </listitem>
    1272       </varlistentry>
    1273 
    1274       <varlistentry id="libstdbuf">
    1275         <term><filename class="libraryfile">libstdbuf</filename></term>
    1276         <listitem>
    1277           <para>Library used by <command>stdbuf</command></para>
    1278           <indexterm zone="ch-system-coreutils libstdbuf">
    1279             <primary sortas="c-libstdbuf">libstdbuf</primary>
    1280           </indexterm>
    1281         </listitem>
    1282       </varlistentry>
    1283 
    1284     </variablelist>
     100    <para>Details on this package are located in
     101    <xref linkend="contents-coreutils" role="."/></para>
    1285102
    1286103  </sect2>
  • chapter06/diffutils.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-diffutils" role="wrap">
     8<sect1 id="ch-tools-diffutils" role="wrap">
    99  <?dbhtml filename="diffutils.html"?>
    1010
     
    1717  <title>Diffutils-&diffutils-version;</title>
    1818
    19   <indexterm zone="ch-system-diffutils">
     19  <indexterm zone="ch-tools-diffutils">
    2020    <primary sortas="a-Diffutils">Diffutils</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Diffutils package contains programs that show the differences
    27     between files or directories.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/diffutils.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&diffutils-ch6-sbu;</seg>
    35         <seg>&diffutils-ch6-du;</seg>
     36        <seg>&diffutils-tmp-sbu;</seg>
     37        <seg>&diffutils-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4446    <para>Prepare Diffutils for compilation:</para>
    4547
    46 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
    4749
    4850    <para>Compile the package:</para>
     
    5052<screen><userinput remap="make">make</userinput></screen>
    5153
    52     <para>To test the results, issue:</para>
    53 
    54 <screen><userinput remap="test">make check</userinput></screen>
    55 
    5654    <para>Install the package:</para>
    5755
    58 <screen><userinput remap="install">make install</userinput></screen>
     56<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    5957
    6058  </sect2>
    6159
     60  <sect2 role="content">
     61    <title/>
    6262
    63   <sect2 id="contents-diffutils" role="content">
    64     <title>Contents of Diffutils</title>
    65 
    66     <segmentedlist>
    67       <segtitle>Installed programs</segtitle>
    68 
    69       <seglistitem>
    70         <seg>cmp, diff, diff3, and sdiff</seg>
    71       </seglistitem>
    72     </segmentedlist>
    73 
    74     <variablelist>
    75       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    76       <?dbfo list-presentation="list"?>
    77       <?dbhtml list-presentation="table"?>
    78 
    79       <varlistentry id="cmp">
    80         <term><command>cmp</command></term>
    81         <listitem>
    82           <para>Compares two files and reports whether or in which bytes they
    83           differ</para>
    84           <indexterm zone="ch-system-diffutils cmp">
    85             <primary sortas="b-cmp">cmp</primary>
    86           </indexterm>
    87         </listitem>
    88       </varlistentry>
    89 
    90       <varlistentry id="diff">
    91         <term><command>diff</command></term>
    92         <listitem>
    93           <para>Compares two files or directories and reports which lines in
    94           the files differ</para>
    95           <indexterm zone="ch-system-diffutils diff">
    96             <primary sortas="b-diff">diff</primary>
    97           </indexterm>
    98         </listitem>
    99       </varlistentry>
    100 
    101       <varlistentry id="diff3">
    102         <term><command>diff3</command></term>
    103         <listitem>
    104             <para>Compares three files line by line</para>
    105             <indexterm zone="ch-system-diffutils diff3">
    106               <primary sortas="b-diff3">diff3</primary>
    107             </indexterm>
    108         </listitem>
    109       </varlistentry>
    110 
    111       <varlistentry id="sdiff">
    112         <term><command>sdiff</command></term>
    113         <listitem>
    114           <para>Merges two files and interactively outputs the results</para>
    115           <indexterm zone="ch-system-diffutils sdiff">
    116             <primary sortas="b-sdiff">sdiff</primary>
    117           </indexterm>
    118         </listitem>
    119       </varlistentry>
    120 
    121     </variablelist>
     63    <para>Details on this package are located in
     64    <xref linkend="contents-diffutils" role="."/></para>
    12265
    12366  </sect2>
  • chapter06/file.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-file" role="wrap">
     8<sect1 id="ch-tools-file" role="wrap">
    99  <?dbhtml filename="file.html"?>
    1010
     
    1717  <title>File-&file-version;</title>
    1818
    19   <indexterm zone="ch-system-file">
     19  <indexterm zone="ch-tools-file">
    2020    <primary sortas="a-File">File</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The File package contains a utility for determining the type of a given
    27     file or files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/file.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&file-ch6-sbu;</seg>
    35         <seg>&file-ch6-du;</seg>
     36        <seg>&file-tmp-sbu;</seg>
     37        <seg>&file-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4446    <para>Prepare File for compilation:</para>
    4547
    46 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
    4749
     50<!-- devs: if using - -build here, the build system wants to compile
     51     the signature file with "file" on the build system, but stops if it is not
     52     the same version. One possibility would be to build "file" on the build
     53     system first, but it is simpler to have the system think it is not
     54     cross-compiling, and use the just built "file". -->
    4855    <para>Compile the package:</para>
    4956
    5057<screen><userinput remap="make">make</userinput></screen>
    5158
    52     <para>To test the results, issue:</para>
    53 
    54 <screen><userinput remap="test">make check</userinput></screen>
    55 
    5659    <para>Install the package:</para>
    5760
    58 <screen><userinput remap="install">make install</userinput></screen>
     61<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    5962
    6063  </sect2>
    6164
    62 
    63   <sect2 id="contents-file" role="content">
    64     <title>Contents of File</title>
    65 
    66     <segmentedlist>
    67       <segtitle>Installed programs</segtitle>
    68       <segtitle>Installed library</segtitle>
    69 
    70       <seglistitem>
    71         <seg>file</seg>
    72         <seg>libmagic.so</seg>
    73       </seglistitem>
    74     </segmentedlist>
    75 
    76     <variablelist>
    77       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    78       <?dbfo list-presentation="list"?>
    79       <?dbhtml list-presentation="table"?>
    80 
    81       <varlistentry id="file">
    82         <term><command>file</command></term>
    83         <listitem>
    84           <para>Tries to classify each given file; it does this by performing
    85           several tests&mdash;file system tests, magic number tests, and language
    86           tests</para>
    87           <indexterm zone="ch-system-file file">
    88             <primary sortas="b-file">file</primary>
    89           </indexterm>
    90         </listitem>
    91       </varlistentry>
    92 
    93       <varlistentry id="libmagic">
    94         <term><filename class="libraryfile">libmagic</filename></term>
    95         <listitem>
    96           <para>Contains routines for magic number recognition, used by the
    97           <command>file</command> program</para>
    98           <indexterm zone="ch-system-file libmagic">
    99             <primary sortas="c-libmagic">libmagic</primary>
    100           </indexterm>
    101         </listitem>
    102       </varlistentry>
    103 
    104     </variablelist>
     65  <sect2 role="content">
     66    <title/>
     67    <para>Details on this package are located in<!-- TODO
     68    <xref linkend="contents-file" role="."/>      --></para>
    10569
    10670  </sect2>
  • chapter06/findutils.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-findutils" role="wrap">
     8<sect1 id="ch-tools-findutils" role="wrap">
    99  <?dbhtml filename="findutils.html"?>
    1010
     
    1717  <title>Findutils-&findutils-version;</title>
    1818
    19   <indexterm zone="ch-system-findutils">
     19  <indexterm zone="ch-tools-findutils">
    2020    <primary sortas="a-Findutils">Findutils</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Findutils package contains programs to find files. These programs
    27     are provided to recursively search through a directory tree and to
    28     create, maintain, and search a database (often faster than the recursive
    29     find, but unreliable if the database has not been recently updated).</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/findutils.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    3030
    3131    <segmentedlist>
     
    3434
    3535      <seglistitem>
    36         <seg>&findutils-ch6-sbu;</seg>
    37         <seg>&findutils-ch6-du;</seg>
     36        <seg>&findutils-tmp-sbu;</seg>
     37        <seg>&findutils-tmp-du;</seg>
    3838      </seglistitem>
    3939    </segmentedlist>
     
    4646    <para>Prepare Findutils for compilation:</para>
    4747
    48 <screen><userinput remap="configure">./configure --prefix=/usr --localstatedir=/var/lib/locate</userinput></screen>
    49 
    50     <variablelist>
    51       <title>The meaning of the configure options:</title>
    52 
    53       <varlistentry>
    54         <term><parameter>--localstatedir</parameter></term>
    55         <listitem>
    56           <para>This option changes the location of the <command>locate</command>
    57           database to be in <filename class="directory">/var/lib/locate</filename>,
    58           which is FHS-compliant.</para>
    59         </listitem>
    60       </varlistentry>
    61 
    62     </variablelist>
     48<screen><userinput remap="configure">./configure --prefix=/usr   \
     49            --host=$LFS_TGT \
     50            --build=$(build-aux/config.guess)</userinput></screen>
    6351
    6452    <para>Compile the package:</para>
     
    6654<screen><userinput remap="make">make</userinput></screen>
    6755
    68     <para>To test the results, issue:</para>
    69 
    70 <screen><userinput remap="test">chown -Rv tester .
    71 su tester -c "PATH=$PATH make check"</userinput></screen>
    72 
    7356    <para>Install the package:</para>
    7457
    75 <screen><userinput remap="install">make install</userinput></screen>
     58<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    7659
    77     <para revision="sysv">Some of the scripts in the LFS-Bootscripts package
    78     depend on <command>find</command>.  As <filename
    79     class="directory">/usr</filename> may not be available during the early
    80     stages of booting, this program needs to be on the root partition.  The
    81     <command>updatedb</command> script also needs to be modified to correct an
    82     explicit path:</para>
     60    <para>Move the excutable to its final expected location:</para>
    8361
    84     <para revision="systemd"> Some packages in BLFS and beyond expect the
    85     <command>find</command> program in <filename
    86     class="directory">/bin</filename>, so make sure it's placed there:</para>
    87 
    88 <screen><userinput remap="install">mv -v /usr/bin/find /bin
    89 sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb</userinput></screen>
     62<screen><userinput remap="install">mv -v $LFS/usr/bin/find $LFS/bin
     63sed -i 's|find:=${BINDIR}|find:=/bin|' $LFS/usr/bin/updatedb</userinput></screen>
    9064
    9165  </sect2>
    9266
    93   <sect2 id="contents-findutils" role="content">
    94     <title>Contents of Findutils</title>
     67  <sect2 role="content">
     68    <title/>
    9569
    96     <segmentedlist>
    97       <segtitle>Installed programs</segtitle>
    98       <segtitle>Installed directory</segtitle>
    99 
    100       <seglistitem>
    101         <seg>find, locate, updatedb, and xargs</seg>
    102         <seg>/var/lib/locate</seg>
    103       </seglistitem>
    104 
    105     </segmentedlist>
    106 
    107     <variablelist>
    108       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    109       <?dbfo list-presentation="list"?>
    110       <?dbhtml list-presentation="table"?>
    111 
    112       <varlistentry id="find">
    113         <term><command>find</command></term>
    114         <listitem>
    115           <para>Searches given directory trees for files matching the specified
    116           criteria</para>
    117           <indexterm zone="ch-system-findutils find">
    118             <primary sortas="b-find">find</primary>
    119           </indexterm>
    120         </listitem>
    121       </varlistentry>
    122 
    123       <varlistentry id="locate">
    124         <term><command>locate</command></term>
    125         <listitem>
    126           <para>Searches through a database of file names and reports the names
    127           that contain a given string or match a given pattern</para>
    128           <indexterm zone="ch-system-findutils locate">
    129             <primary sortas="b-locate">locate</primary>
    130           </indexterm>
    131         </listitem>
    132       </varlistentry>
    133 
    134       <varlistentry id="updatedb">
    135       <term><command>updatedb</command></term>
    136         <listitem>
    137           <para>Updates the <command>locate</command> database; it scans the
    138           entire file system (including other file systems that are currently
    139           mounted, unless told not to) and puts every file name it finds into
    140           the database</para>
    141           <indexterm zone="ch-system-findutils updatedb">
    142             <primary sortas="b-updatedb">updatedb</primary>
    143           </indexterm>
    144         </listitem>
    145       </varlistentry>
    146 
    147       <varlistentry id="xargs">
    148         <term><command>xargs</command></term>
    149         <listitem>
    150           <para>Can be used to apply a given command to a list of files</para>
    151           <indexterm zone="ch-system-findutils xargs">
    152             <primary sortas="b-xargs">xargs</primary>
    153           </indexterm>
    154         </listitem>
    155       </varlistentry>
    156 
    157     </variablelist>
     70    <para>Details on this package are located in
     71    <xref linkend="contents-findutils" role="."/></para>
    15872
    15973  </sect2>
  • chapter06/gawk.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-gawk" role="wrap">
     8<sect1 id="ch-tools-gawk" role="wrap">
    99  <?dbhtml filename="gawk.html"?>
    1010
     
    1717  <title>Gawk-&gawk-version;</title>
    1818
    19   <indexterm zone="ch-system-gawk">
     19  <indexterm zone="ch-tools-gawk">
    2020    <primary sortas="a-Gawk">Gawk</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Gawk package contains programs for manipulating text files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/gawk.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&gawk-ch6-sbu;</seg>
    34         <seg>&gawk-ch6-du;</seg>
     36        <seg>&gawk-tmp-sbu;</seg>
     37        <seg>&gawk-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4750    <para>Prepare Gawk for compilation:</para>
    4851
    49 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     52<screen><userinput remap="configure">./configure --prefix=/usr   \
     53            --host=$LFS_TGT \
     54            --build=$(./config.guess)</userinput></screen>
    5055
    5156    <para>Compile the package:</para>
     
    5358<screen><userinput remap="make">make</userinput></screen>
    5459
    55     <para>To test the results, issue:</para>
    56 
    57 <screen><userinput remap="test">make check</userinput></screen>
    58 
    5960    <para>Install the package:</para>
    6061
    61 <screen><userinput remap="install">make install</userinput></screen>
    62 
    63     <para>If desired, install the documentation:</para>
    64 
    65 <screen><userinput remap="install">mkdir -v /usr/share/doc/gawk-&gawk-version;
    66 cp    -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-&gawk-version;</userinput></screen>
     62<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6763
    6864  </sect2>
    6965
    70   <sect2 id="contents-gawk" role="content">
    71     <title>Contents of Gawk</title>
     66  <sect2 role="content">
     67    <title/>
    7268
    73     <segmentedlist>
    74       <segtitle>Installed programs</segtitle>
    75       <segtitle>Installed libraries</segtitle>
    76       <segtitle>Installed directories</segtitle>
    77 
    78       <seglistitem>
    79         <seg>awk (link to gawk), gawk, and awk-&gawk-version;</seg>
    80         <seg>filefuncs.so, fnmatch.so, fork.so, inplace.so, intdiv.so, ordchr.so,
    81         readdir.so, readfile.so, revoutput.so, revtwoway.so, rwarray.so,
    82         and time.so (all in /usr/lib/gawk)</seg>
    83         <seg>/usr/lib/gawk, /usr/libexec/awk, /usr/share/awk, and
    84         /usr/share/doc/gawk-&gawk-version;</seg>
    85       </seglistitem>
    86     </segmentedlist>
    87 
    88     <variablelist>
    89       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    90       <?dbfo list-presentation="list"?>
    91       <?dbhtml list-presentation="table"?>
    92 
    93       <varlistentry id="awk">
    94         <term><command>awk</command></term>
    95         <listitem>
    96           <para>A link to <command>gawk</command></para>
    97           <indexterm zone="ch-system-gawk awk">
    98             <primary sortas="b-awk">awk</primary>
    99           </indexterm>
    100         </listitem>
    101       </varlistentry>
    102 
    103       <varlistentry id="gawk">
    104         <term><command>gawk</command></term>
    105         <listitem>
    106           <para>A program for manipulating text files; it is the GNU
    107           implementation of <command>awk</command></para>
    108           <indexterm zone="ch-system-gawk gawk">
    109             <primary sortas="b-gawk">gawk</primary>
    110           </indexterm>
    111         </listitem>
    112       </varlistentry>
    113 
    114       <varlistentry id="gawk-version">
    115         <term><command>gawk-&gawk-version;</command></term>
    116         <listitem>
    117           <para>A hard link to <command>gawk</command></para>
    118           <indexterm zone="ch-system-gawk gawk-version">
    119             <primary sortas="b-gawk-&gawk-version;">gawk-&gawk-version;</primary>
    120           </indexterm>
    121         </listitem>
    122       </varlistentry>
    123 
    124     </variablelist>
     69    <para>Details on this package are located in
     70    <xref linkend="contents-gawk" role="."/></para>
    12571
    12672  </sect2>
  • chapter06/grep.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-grep" role="wrap">
     8<sect1 id="ch-tools-grep" role="wrap">
    99  <?dbhtml filename="grep.html"?>
    1010
     
    1717  <title>Grep-&grep-version;</title>
    1818
    19   <indexterm zone="ch-system-grep">
     19  <indexterm zone="ch-tools-grep">
    2020    <primary sortas="a-Grep">Grep</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Grep package contains programs for searching through files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/grep.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&grep-ch6-sbu;</seg>
    34         <seg>&grep-ch6-du;</seg>
     36        <seg>&grep-tmp-sbu;</seg>
     37        <seg>&grep-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4346    <para>Prepare Grep for compilation:</para>
    4447
    45 <screen><userinput remap="configure">./configure --prefix=/usr --bindir=/bin</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr   \
     49            --host=$LFS_TGT \
     50            --bindir=/bin</userinput></screen>
    4651
    4752    <para>Compile the package:</para>
     
    4954<screen><userinput remap="make">make</userinput></screen>
    5055
    51     <para>To test the results, issue:</para>
    52 
    53 <screen><userinput remap="test">make check</userinput></screen>
    54 
    5556    <para>Install the package:</para>
    5657
    57 <screen><userinput remap="install">make install</userinput></screen>
     58<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    5859
    5960  </sect2>
    6061
    61   <sect2 id="contents-grep" role="content">
    62     <title>Contents of Grep</title>
     62  <sect2 role="content">
     63    <title/>
    6364
    64     <segmentedlist>
    65       <segtitle>Installed programs</segtitle>
    66 
    67       <seglistitem>
    68         <seg>egrep, fgrep, and grep</seg>
    69       </seglistitem>
    70     </segmentedlist>
    71 
    72     <variablelist>
    73       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    74       <?dbfo list-presentation="list"?>
    75       <?dbhtml list-presentation="table"?>
    76 
    77       <varlistentry id="egrep">
    78         <term><command>egrep</command></term>
    79         <listitem>
    80           <para>Prints lines matching an extended regular expression</para>
    81           <indexterm zone="ch-system-grep egrep">
    82             <primary sortas="b-egrep">egrep</primary>
    83           </indexterm>
    84         </listitem>
    85       </varlistentry>
    86 
    87       <varlistentry id="fgrep">
    88         <term><command>fgrep</command></term>
    89         <listitem>
    90           <para>Prints lines matching a list of fixed strings</para>
    91           <indexterm zone="ch-system-grep fgrep">
    92             <primary sortas="b-fgrep">fgrep</primary>
    93           </indexterm>
    94         </listitem>
    95       </varlistentry>
    96 
    97       <varlistentry id="grep">
    98         <term><command>grep</command></term>
    99         <listitem>
    100           <para>Prints lines matching a basic regular expression</para>
    101           <indexterm zone="ch-system-grep grep">
    102             <primary sortas="b-grep">grep</primary>
    103           </indexterm>
    104         </listitem>
    105       </varlistentry>
    106 
    107     </variablelist>
     65    <para>Details on this package are located in
     66    <xref linkend="contents-grep" role="."/></para>
    10867
    10968  </sect2>
  • chapter06/gzip.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-gzip" role="wrap">
     8<sect1 id="ch-tools-gzip" role="wrap">
    99  <?dbhtml filename="gzip.html"?>
    1010
     
    1717  <title>Gzip-&gzip-version;</title>
    1818
    19   <indexterm zone="ch-system-gzip">
     19  <indexterm zone="ch-tools-gzip">
    2020    <primary sortas="a-Gzip">Gzip</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Gzip package contains programs for compressing and decompressing
    27     files.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/gzip.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&gzip-ch6-sbu;</seg>
    35         <seg>&gzip-ch6-du;</seg>
     36        <seg>&gzip-tmp-sbu;</seg>
     37        <seg>&gzip-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4446    <para>Prepare Gzip for compilation:</para>
    4547
    46 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     48<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen>
    4749
    4850    <para>Compile the package:</para>
     
    5052<screen><userinput remap="make">make</userinput></screen>
    5153
    52     <para>To test the results, issue:</para>
    53 
    54 <screen><userinput remap="test">make check</userinput></screen>
    55 
    56     <para>Two tests are known to fail in the LFS environment:
    57     help-version and zmore.</para>
    58 
    5954    <para>Install the package:</para>
    6055
    61 <screen><userinput remap="install">make install</userinput></screen>
     56<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6257
    63     <para>Move a program that needs to be on the root filesystem:</para>
     58    <para>Move the excutable to its final expected location:</para>
    6459
    65 <screen><userinput remap="install">mv -v /usr/bin/gzip /bin</userinput></screen>
     60<screen><userinput remap="install">mv -v $LFS/usr/bin/gzip $LFS/bin</userinput></screen>
    6661
    6762  </sect2>
    6863
    69   <sect2 id="contents-gzip" role="content">
    70     <title>Contents of Gzip</title>
     64  <sect2 role="content">
     65    <title/>
    7166
    72     <segmentedlist>
    73       <segtitle>Installed programs</segtitle>
    74 
    75       <seglistitem>
    76         <seg>gunzip, gzexe, gzip, uncompress (hard link with gunzip), zcat, zcmp,
    77         zdiff, zegrep, zfgrep, zforce, zgrep, zless, zmore, and znew</seg>
    78       </seglistitem>
    79     </segmentedlist>
    80 
    81     <variablelist>
    82       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    83       <?dbfo list-presentation="list"?>
    84       <?dbhtml list-presentation="table"?>
    85 
    86       <varlistentry id="gunzip">
    87         <term><command>gunzip</command></term>
    88         <listitem>
    89           <para>Decompresses gzipped files</para>
    90           <indexterm zone="ch-system-gzip gunzip">
    91             <primary sortas="b-gunzip">gunzip</primary>
    92           </indexterm>
    93         </listitem>
    94       </varlistentry>
    95 
    96       <varlistentry id="gzexe">
    97         <term><command>gzexe</command></term>
    98         <listitem>
    99           <para>Creates self-decompressing executable files</para>
    100           <indexterm zone="ch-system-gzip gzexe">
    101             <primary sortas="b-gzexe">gzexe</primary>
    102           </indexterm>
    103         </listitem>
    104       </varlistentry>
    105 
    106       <varlistentry id="gzip">
    107         <term><command>gzip</command></term>
    108         <listitem>
    109           <para>Compresses the given files using Lempel-Ziv (LZ77) coding</para>
    110           <indexterm zone="ch-system-gzip gzip">
    111             <primary sortas="b-gzip">gzip</primary>
    112           </indexterm>
    113         </listitem>
    114       </varlistentry>
    115 
    116       <varlistentry id="uncompress">
    117         <term><command>uncompress</command></term>
    118         <listitem>
    119           <para>Decompresses compressed files</para>
    120           <indexterm zone="ch-system-gzip uncompress">
    121             <primary sortas="b-uncompress">uncompress</primary>
    122           </indexterm>
    123         </listitem>
    124       </varlistentry>
    125 
    126       <varlistentry id="zcat">
    127         <term><command>zcat</command></term>
    128         <listitem>
    129           <para>Decompresses the given gzipped files to standard output</para>
    130           <indexterm zone="ch-system-gzip zcat">
    131             <primary sortas="b-zcat">zcat</primary>
    132           </indexterm>
    133         </listitem>
    134       </varlistentry>
    135 
    136       <varlistentry id="zcmp">
    137         <term><command>zcmp</command></term>
    138         <listitem>
    139           <para>Runs <command>cmp</command> on gzipped files</para>
    140           <indexterm zone="ch-system-gzip zcmp">
    141             <primary sortas="b-zcmp">zcmp</primary>
    142           </indexterm>
    143         </listitem>
    144       </varlistentry>
    145 
    146       <varlistentry id="zdiff">
    147         <term><command>zdiff</command></term>
    148         <listitem>
    149           <para>Runs <command>diff</command> on gzipped files</para>
    150           <indexterm zone="ch-system-gzip zdiff">
    151             <primary sortas="b-zdiff">zdiff</primary>
    152           </indexterm>
    153         </listitem>
    154       </varlistentry>
    155 
    156       <varlistentry id="zegrep">
    157         <term><command>zegrep</command></term>
    158         <listitem>
    159           <para>Runs <command>egrep</command> on gzipped files</para>
    160           <indexterm zone="ch-system-gzip zegrep">
    161             <primary sortas="b-zegrep">zegrep</primary>
    162           </indexterm>
    163         </listitem>
    164       </varlistentry>
    165 
    166       <varlistentry id="zfgrep">
    167         <term><command>zfgrep</command></term>
    168         <listitem>
    169           <para>Runs <command>fgrep</command> on gzipped files</para>
    170           <indexterm zone="ch-system-gzip zfgrep">
    171             <primary sortas="b-zfgrep">zfgrep</primary>
    172           </indexterm>
    173         </listitem>
    174       </varlistentry>
    175 
    176       <varlistentry id="zforce">
    177         <term><command>zforce</command></term>
    178         <listitem>
    179           <para>Forces a <filename class="extension">.gz</filename> extension on
    180           all given files that are gzipped files, so that <command>gzip</command>
    181           will not compress them again; this can be useful when file names were
    182           truncated during a file transfer</para>
    183           <indexterm zone="ch-system-gzip zforce">
    184             <primary sortas="b-zforce">zforce</primary>
    185           </indexterm>
    186         </listitem>
    187       </varlistentry>
    188 
    189       <varlistentry id="zgrep">
    190         <term><command>zgrep</command></term>
    191         <listitem>
    192           <para>Runs <command>grep</command> on gzipped files</para>
    193           <indexterm zone="ch-system-gzip zgrep">
    194             <primary sortas="b-zgrep">zgrep</primary>
    195           </indexterm>
    196         </listitem>
    197       </varlistentry>
    198 
    199       <varlistentry id="zless">
    200         <term><command>zless</command></term>
    201         <listitem>
    202           <para>Runs <command>less</command> on gzipped files</para>
    203           <indexterm zone="ch-system-gzip zless">
    204             <primary sortas="b-zless">zless</primary>
    205           </indexterm>
    206         </listitem>
    207       </varlistentry>
    208 
    209       <varlistentry id="zmore">
    210         <term><command>zmore</command></term>
    211         <listitem>
    212           <para>Runs <command>more</command> on gzipped files</para>
    213           <indexterm zone="ch-system-gzip zmore">
    214             <primary sortas="b-zmore">zmore</primary>
    215           </indexterm>
    216         </listitem>
    217       </varlistentry>
    218 
    219       <varlistentry id="znew">
    220         <term><command>znew</command></term>
    221         <listitem>
    222           <para>Re-compresses files from <command>compress</command> format to
    223           <command>gzip</command> format&mdash;<filename
    224           class="extension">.Z</filename> to <filename
    225           class="extension">.gz</filename></para>
    226           <indexterm zone="ch-system-gzip znew">
    227             <primary sortas="b-znew">znew</primary>
    228           </indexterm>
    229         </listitem>
    230       </varlistentry>
    231 
    232     </variablelist>
     67    <para>Details on this package are located in
     68    <xref linkend="contents-gzip" role="."/></para>
    23369
    23470  </sect2>
  • chapter06/introduction.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-introduction">
     8<sect1 id="ch-tools-introduction-cross">
    99  <?dbhtml filename="introduction.html"?>
    1010
    1111  <title>Introduction</title>
    1212
    13   <para>In this chapter, we enter the building site and start constructing the
    14   LFS system in earnest. That is, we chroot into the temporary mini Linux system,
    15   make a few final preparations, and then begin installing the packages.</para>
     13  <para>This chapter shows how to cross-compile basic utilities using
     14  the just built cross-toolchain. Those utilities are installed into
     15  their final location, but cannot be used yet. Basic tasks still rely on
     16  the host's tools. Nevertheless, the installed libraries are used when
     17  linking.</para>
    1618
    17   <para>The installation of this software is straightforward. Although in many
    18   cases the installation instructions could be made shorter and more generic,
    19   we have opted to provide the full instructions for every package to minimize
    20   the possibilities for mistakes.  The key to learning what makes a Linux system
    21   work is to know what each package is used for and why you (or the system)
    22   may need it.</para>
     19  <para>Using the utilities will be possible in next chapter after entering
     20  the <quote>chroot</quote> environment. But all the packages built in the
     21  present chapter need to be built before we do that. Therefore we cannot be
     22  independent of the host system yet.</para>
    2323
    24   <para>We do not recommend using optimizations.  They can make
    25   a program run slightly faster, but they may also cause compilation
    26   difficulties and problems when running the program.  If a package refuses to
    27   compile when using optimization, try to compile it without optimization and
    28   see if that fixes the problem. Even if the package does compile when using
    29   optimization, there is the risk it may have been compiled incorrectly because
    30   of the complex interactions between the code and build tools.  Also note that
    31   the <option>-march</option> and <option>-mtune</option> options using values
    32   not specified in the book have not been tested. This may cause problems with
    33   the toolchain packages (Binutils, GCC and Glibc).  The small potential gains
    34   achieved in using compiler optimizations are often outweighed by the risks.
    35   First-time builders of LFS are encouraged to build without custom
    36   optimizations. The subsequent system will still run very fast and be stable
    37   at the same time.</para>
    38 
    39   <para>The order that packages are installed in this chapter needs to be
    40   strictly followed to ensure that no program accidentally acquires a path
    41   referring to <filename class="directory">/tools</filename> hard-wired into
    42   it.  For the same reason, do not compile separate packages in parallel.
    43   Compiling in parallel may save time (especially on dual-CPU machines), but it
    44   could result in a program containing a hard-wired path to <filename
    45   class="directory">/tools</filename>, which will cause the program to stop
    46   working when that directory is removed.</para>
    47 
    48   <para>Before the installation instructions, each installation page provides
    49   information about the package, including a concise description of what it
    50   contains, approximately how long it will take to build, and how much disk
    51   space is required during this building process. Following the installation
    52   instructions, there is a list of programs and libraries (along with brief
    53   descriptions of these) that the package installs.</para>
    54 
    55   <note><para>The SBU values and required disk space includes
    56   test suite data for all applicable packages in Chapter&nbsp;6.</para></note>
    57 
    58   <sect2>
    59     <title>About libraries</title>
    60 
    61     <para>In general, the LFS editors discourage building and installing static
    62     libraries.  The original purpose for most static libraries has been made
    63     obsolete in a modern Linux system.  In addition linking a static library
    64     into a program can be detrimental.  If an update to the library is needed
    65     to remove a security problem, all programs that use the static library will
    66     need to be relinked to the new library.  Since the use of static libraries
    67     is not always obvious, the relevant programs (and the procedures needed to
    68     do the linking) may not even be known.</para>
    69 
    70     <para>In the procedures in Chapter&nbsp;6, we remove or disable installation of
    71     most static libraries. Usually this is done by passing a
    72     <option>--disable-static</option> option to <command>configure</command>.
    73     In other cases, alternate means are needed. In a few cases, especially
    74     glibc and gcc, the use of static libraries remains essential to the general
    75     package building process. </para>
    76 
    77     <para>For a more complete discussion of libraries, see the discussion
    78     <ulink url="&blfs-root;/view/&short-version;/introduction/libraries.html">
    79     Libraries: Static or shared?</ulink> in the BLFS book.</para>
    80 
    81   </sect2>
     24  <para>Once again, let us recall that improper setting of <envar>LFS</envar>
     25  together with building as root, may render your computer unusable.
     26  This whole chapter must be done as user <systemitem
     27  class="username">lfs</systemitem>, with the enviroment as described in
     28  <xref linkend="ch-preps-settingenviron"/>.</para>
    8229
    8330</sect1>
  • chapter06/m4.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-m4" role="wrap">
     8<sect1 id="ch-tools-m4" role="wrap">
    99  <?dbhtml filename="m4.html"?>
    1010
     
    1717  <title>M4-&m4-version;</title>
    1818
    19   <indexterm zone="ch-system-m4">
     19  <indexterm zone="ch-tools-m4">
    2020    <primary sortas="a-M4">M4</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The M4 package contains a macro processor.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/m4.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2730
    2831    <segmentedlist>
     
    3134
    3235      <seglistitem>
    33         <seg>&m4-ch6-sbu;</seg>
    34         <seg>&m4-ch6-du;</seg>
     36        <seg>&m4-tmp-sbu;</seg>
     37        <seg>&m4-tmp-du;</seg>
    3538      </seglistitem>
    3639    </segmentedlist>
     
    4144    <title>Installation of M4</title>
    4245
    43     <para>First, make some fixes required by glibc-2.28:</para>
     46    <para>First, make some fixes introduced by glibc-2.28:</para>
    4447
    4548<screen><userinput remap="pre">sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
     
    4851    <para>Prepare M4 for compilation:</para>
    4952
    50 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     53<screen><userinput remap="configure">./configure --prefix=/usr   \
     54            --host=$LFS_TGT \
     55            --build=$(build-aux/config.guess)</userinput></screen>
    5156
    5257    <para>Compile the package:</para>
     
    5459<screen><userinput remap="make">make</userinput></screen>
    5560
    56     <para>To test the results, issue:</para>
    57 
    58 <screen><userinput remap="test">make check</userinput></screen>
    59 
    6061    <para>Install the package:</para>
    6162
    62 <screen><userinput remap="install">make install</userinput></screen>
     63<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6364
    6465  </sect2>
    6566
    66   <sect2 id="contents-m4" role="content">
    67     <title>Contents of M4</title>
    68 
    69     <segmentedlist>
    70       <segtitle>Installed program</segtitle>
    71 
    72       <seglistitem>
    73         <seg>m4</seg>
    74       </seglistitem>
    75     </segmentedlist>
    76 
    77     <variablelist>
    78       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    79       <?dbfo list-presentation="list"?>
    80       <?dbhtml list-presentation="table"?>
    81 
    82       <varlistentry id="m4">
    83          <!-- Don't remove the extra space, it prevet a FOP warning. -->
    84         <term><command>m4 </command></term>
    85         <listitem>
    86           <para>Copies the given files while expanding the macros that they
    87           contain [These macros are either built-in or user-defined and can
    88           take any number of arguments. Besides performing macro expansion,
    89           <command>m4</command> has built-in functions for including named
    90           files, running Unix commands, performing integer arithmetic,
    91           manipulating text, recursion, etc. The <command>m4</command> program
    92           can be used either as a front-end to a compiler or as a macro processor
    93           in its own right.]</para>
    94           <indexterm zone="ch-system-m4 m4">
    95             <primary sortas="b-m4">m4</primary>
    96           </indexterm>
    97         </listitem>
    98       </varlistentry>
    99 
    100     </variablelist>
     67  <sect2 role="content">
     68    <title/>
     69    <para>Details on this package are located in
     70    <xref linkend="contents-m4" role="."/></para>
    10171
    10272  </sect2>
  • chapter06/make.xml

    r560065f r675606b  
    55  %general-entities;
    66]>
    7 
    8 <sect1 id="ch-system-make" role="wrap">
     7<sect1 id="ch-tools-make" role="wrap">
    98  <?dbhtml filename="make.html"?>
    109
     
    1716  <title>Make-&make-version;</title>
    1817
    19   <indexterm zone="ch-system-make">
     18  <indexterm zone="ch-tools-make">
    2019    <primary sortas="a-Make">Make</primary>
     20    <secondary>tools</secondary>
    2121  </indexterm>
    2222
     
    2424    <title/>
    2525
    26     <para>The Make package contains a program for compiling packages.</para>
     26    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     27    href="../chapter08/make.xml"
     28    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2729
    2830    <segmentedlist>
     
    3133
    3234      <seglistitem>
    33         <seg>&make-ch6-sbu;</seg>
    34         <seg>&make-ch6-du;</seg>
     35        <seg>&make-tmp-sbu;</seg>
     36        <seg>&make-tmp-du;</seg>
    3537      </seglistitem>
    3638    </segmentedlist>
     
    4042  <sect2 role="installation">
    4143    <title>Installation of Make</title>
    42 <!--
    43     <para>Again, work around an error caused by glibc-2.27 and later:</para>
    4444
    45 <screen><userinput remap="pre">sed -i '211,217 d; 219,229 d; 232 d' glob/glob.c</userinput></screen>
    46 -->
    4745    <para>Prepare Make for compilation:</para>
    4846
    49 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
     47<screen><userinput remap="configure">./configure --prefix=/usr   \
     48            --without-guile \
     49            --host=$LFS_TGT \
     50            --build=$(build-aux/config.guess)</userinput></screen>
     51
     52    <variablelist>
     53      <title>The meaning of the new configure option:</title>
     54
     55      <varlistentry>
     56        <term><parameter>--without-guile</parameter></term>
     57        <listitem>
     58          <para>Although we are cross-compiling, configure tries to use
     59          guile from the build host if it finds it. This makes compilation
     60          fail, so this switch prevents using it.</para>
     61        </listitem>
     62      </varlistentry>
     63    </variablelist>
    5064
    5165    <para>Compile the package:</para>
     
    5367<screen><userinput remap="make">make</userinput></screen>
    5468
    55     <para>The test suite needs to know where supporting perl files are located.
    56     We use an environment variable to accomplish this.  To test the
    57     results, issue:</para>
    58 
    59 <screen><userinput remap="test">make check</userinput></screen>
    60 
    6169    <para>Install the package:</para>
    6270
    63 <screen><userinput remap="install">make install</userinput></screen>
     71<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
    6472
    6573  </sect2>
    6674
     75  <sect2 role="content">
     76    <title/>
    6777
    68   <sect2 id="contents-make" role="content">
    69     <title>Contents of Make</title>
    70 
    71     <segmentedlist>
    72       <segtitle>Installed program</segtitle>
    73 
    74       <seglistitem>
    75         <seg>make</seg>
    76       </seglistitem>
    77     </segmentedlist>
    78 
    79     <variablelist>
    80       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    81       <?dbfo list-presentation="list"?>
    82       <?dbhtml list-presentation="table"?>
    83 
    84       <varlistentry id="make">
    85         <term><command>make</command></term>
    86         <listitem>
    87           <para>Automatically determines which pieces of a package need to
    88           be (re)compiled and then issues the relevant commands</para>
    89           <indexterm zone="ch-system-make make">
    90             <primary sortas="b-make">make</primary>
    91           </indexterm>
    92         </listitem>
    93       </varlistentry>
    94 
    95     </variablelist>
     78    <para>Details on this package are located in
     79    <xref linkend="contents-make" role="."/></para>
    9680
    9781  </sect2>
  • chapter06/ncurses.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-ncurses" role="wrap">
     8<sect1 id="ch-tools-ncurses" role="wrap">
    99  <?dbhtml filename="ncurses.html"?>
    1010
     
    1717  <title>Ncurses-&ncurses-version;</title>
    1818
    19   <indexterm zone="ch-system-ncurses">
     19  <indexterm zone="ch-tools-ncurses">
    2020    <primary sortas="a-Ncurses">Ncurses</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Ncurses package contains libraries for terminal-independent
    27     handling of character screens.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    href="../chapter08/ncurses.xml"
     29    xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    2830
    2931    <segmentedlist>
     
    3234
    3335      <seglistitem>
    34         <seg>&ncurses-ch6-sbu;</seg>
    35         <seg>&ncurses-ch6-du;</seg>
     36        <seg>&ncurses-tmp-sbu;</seg>
     37        <seg>&ncurses-tmp-du;</seg>
    3638      </seglistitem>
    3739    </segmentedlist>
     
    4244    <title>Installation of Ncurses</title>
    4345
    44     <para>Don't install a static library that is not handled by configure:</para>
     46    <para>First, ensure that <command>gawk</command> is found first during configuration:</para>
    4547
    46 <screen><userinput remap="pre">sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in</userinput></screen>
     48<screen><userinput remap="pre">sed -i s/mawk// configure</userinput></screen>
     49
     50    <para>Then, run the following commands to build the <quote>tic</quote>
     51    program on the build host:</para>
     52
     53<screen><userinput remap="pre">mkdir build
     54pushd build
     55  ../configure
     56  make -C include
     57  make -C progs tic
     58popd</userinput></screen>
    4759
    4860    <para>Prepare Ncurses for compilation:</para>
    4961
    50 <screen><userinput remap="configure">./configure --prefix=/usr           \
    51             --mandir=/usr/share/man \
    52             --with-shared           \
    53             --without-debug         \
    54             --without-normal        \
    55             --enable-pc-files       \
     62<screen><userinput remap="configure">./configure --prefix=/usr                \
     63            --host=$LFS_TGT              \
     64            --build=$(./config.guess)    \
     65            --mandir=/usr/share/man      \
     66            --with-manpage-format=normal \
     67            --with-shared                \
     68            --without-debug              \
     69            --without-ada                \
     70            --without-normal             \
    5671            --enable-widec</userinput></screen>
    5772
    5873    <variablelist>
    5974      <title>The meaning of the new configure options:</title>
     75
     76      <varlistentry>
     77        <term><parameter>--with-manpage-format=normal</parameter></term>
     78        <listitem>
     79          <para>This prevents Ncurses installing compressed manual
     80          pages, which may happen if the host distribution itself
     81          has compressed manual pages.</para>
     82        </listitem>
     83      </varlistentry>
     84
     85      <varlistentry>
     86        <term><parameter>--without-ada</parameter></term>
     87        <listitem>
     88          <para>This ensures that Ncurses does not build support for the Ada
     89          compiler which may be present on the host but will not be available
     90          once we enter the <command>chroot</command> environment.</para>
     91        </listitem>
     92      </varlistentry>
    6093
    6194      <varlistentry>
     
    70103          only in 8-bit locales. Wide-character and normal libraries are
    71104          source-compatible, but not binary-compatible.</para>
    72         </listitem>
    73       </varlistentry>
    74 
    75       <varlistentry>
    76         <term><parameter>--enable-pc-files</parameter></term>
    77         <listitem>
    78           <para>This switch generates and installs .pc files for pkg-config.
    79           </para>
    80105        </listitem>
    81106      </varlistentry>
     
    95120<screen><userinput remap="make">make</userinput></screen>
    96121
    97     <para>This package has a test suite, but it can only be run after the
    98     package has been installed.  The tests reside in the
    99     <filename class="directory">test/</filename> directory.  See the
    100     <filename>README</filename> file in that directory for further details.
    101     </para>
    102 
    103122    <para>Install the package:</para>
    104 
    105 <screen><userinput remap="install">make install</userinput></screen>
     123<!-- TODO: check and document -->
     124<screen><userinput remap="install">make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
     125ln -s libncursesw.so $LFS/usr/lib/libncurses.so</userinput></screen>
    106126
    107127    <para>Move the shared libraries to the
     
    109129    expected to reside:</para>
    110130
    111 <screen><userinput remap="install">mv -v /usr/lib/libncursesw.so.6* /lib</userinput></screen>
     131<screen><userinput remap="install">mv -v $LFS/usr/lib/libncursesw.so.6* $LFS/lib</userinput></screen>
    112132
    113133    <para>Because the libraries have been moved, one symlink points to
    114134    a non-existent file. Recreate it:</para>
    115135
    116 <screen><userinput remap="install">ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so</userinput></screen>
     136<screen><userinput remap="install">ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so</userinput></screen>
    117137
    118     <para>Many applications still expect the linker to be able to find
    119     non-wide-character Ncurses libraries. Trick such applications into linking with
    120     wide-character libraries by means of symlinks and linker scripts:</para>
    121 
    122 <screen><userinput remap="install">for lib in ncurses form panel menu ; do
    123     rm -vf                    /usr/lib/lib${lib}.so
    124     echo "INPUT(-l${lib}w)" &gt; /usr/lib/lib${lib}.so
    125     ln -sfv ${lib}w.pc        /usr/lib/pkgconfig/${lib}.pc
    126 done</userinput></screen>
    127 
    128     <para>Finally, make sure that old applications that look for
    129     <filename class="libraryfile">-lcurses</filename> at build time are still
    130     buildable:</para>
    131 
    132 <screen><userinput remap="install">rm -vf                     /usr/lib/libcursesw.so
    133 echo "INPUT(-lncursesw)" &gt; /usr/lib/libcursesw.so
    134 ln -sfv libncurses.so      /usr/lib/libcurses.so</userinput></screen>
    135 
    136     <para>If desired, install the Ncurses documentation:</para>
    137 
    138 <screen><userinput remap="install">mkdir -v       /usr/share/doc/ncurses-&ncurses-version;
    139 cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version;</userinput></screen>
    140 
    141     <note>
    142 
    143       <para>The instructions above don't create non-wide-character Ncurses
    144       libraries since no package installed by compiling from sources would link
    145       against them at runtime. However, the only known binary-only
    146       applications that link against non-wide-character Ncurses libraries
    147       require version 5.  If you must have such libraries because of some binary-only
    148       application or to be compliant with LSB, build the package again with the
    149       following commands:</para>
    150 
    151 <screen role="nodump"><userinput>make distclean
    152 ./configure --prefix=/usr    \
    153             --with-shared    \
    154             --without-normal \
    155             --without-debug  \
    156             --without-cxx-binding \
    157             --with-abi-version=5
    158 make sources libs
    159 cp -av lib/lib*.so.5* /usr/lib</userinput></screen>
    160     </note>
    161138
    162139  </sect2>
    163140
    164   <sect2 id="contents-ncurses" role="content">
    165     <title>Contents of Ncurses</title>
     141  <sect2 role="content">
     142    <title/>
    166143
    167     <segmentedlist>
    168       <segtitle>Installed programs</segtitle>
    169       <segtitle>Installed libraries</segtitle>
    170       <segtitle>Installed directories</segtitle>
    171 
    172       <seglistitem>
    173         <seg>
    174            captoinfo (link to tic),
    175            clear,
    176            infocmp,
    177            infotocap (link to tic),
    178            ncursesw6-config,
    179            reset (link to tset),
    180            tabs,
    181            tic,
    182            toe,
    183            tput, and
    184            tset
    185         </seg>
    186         <seg>
    187            libcursesw.so (symlink and linker script to libncursesw.so),
    188            libformw.so,
    189            libmenuw.so,
    190            libncursesw.so,
    191            libncurses++w.a,
    192            libpanelw.so, and their non-wide-character counterparts without "w"
    193               in the library names.</seg>
    194         <seg>
    195            /usr/share/tabset,
    196            /usr/share/terminfo, and
    197            /usr/share/doc/ncurses-&ncurses-version;
    198         </seg>
    199       </seglistitem>
    200     </segmentedlist>
    201 
    202     <variablelist>
    203       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
    204       <?dbfo list-presentation="list"?>
    205       <?dbhtml list-presentation="table"?>
    206 
    207       <varlistentry id="captoinfo">
    208         <term><command>captoinfo</command></term>
    209         <listitem>
    210           <para>Converts a termcap description into a terminfo description</para>
    211           <indexterm zone="ch-system-ncurses captoinfo">
    212             <primary sortas="b-captoinfo">captoinfo</primary>
    213           </indexterm>
    214         </listitem>
    215       </varlistentry>
    216 
    217       <varlistentry id="clear">
    218         <term><command>clear</command></term>
    219         <listitem>
    220           <para>Clears the screen, if possible</para>
    221           <indexterm zone="ch-system-ncurses clear">
    222             <primary sortas="b-clear">clear</primary>
    223           </indexterm>
    224         </listitem>
    225       </varlistentry>
    226 
    227       <varlistentry id="infocmp">
    228         <term><command>infocmp</command></term>
    229         <listitem>
    230           <para>Compares or prints out terminfo descriptions</para>
    231           <indexterm zone="ch-system-ncurses infocmp">
    232             <primary sortas="b-infocmp">infocmp</primary>
    233           </indexterm>
    234         </listitem>
    235       </varlistentry>
    236 
    237       <varlistentry id="infotocap">
    238         <term><command>infotocap</command></term>
    239         <listitem>
    240           <para>Converts a terminfo description into a termcap description</para>
    241           <indexterm zone="ch-system-ncurses infotocap">
    242             <primary sortas="b-infotocap">infotocap</primary>
    243           </indexterm>
    244         </listitem>
    245       </varlistentry>
    246 
    247       <varlistentry id="ncursesw6-config">
    248         <term><command>ncursesw6-config</command></term>
    249         <listitem>
    250           <para>Provides configuration information for ncurses</para>
    251           <indexterm zone="ch-system-ncurses ncursesw6-config">
    252             <primary sortas="b-ncursesw6-config">ncursesw6-config</primary>
    253           </indexterm>
    254         </listitem>
    255       </varlistentry>
    256 
    257       <varlistentry id="reset">
    258         <term><command>reset</command></term>
    259         <listitem>
    260           <para>Reinitializes a terminal to its default values</para>
    261           <indexterm zone="ch-system-ncurses reset">
    262             <primary sortas="b-reset">reset</primary>
    263           </indexterm>
    264         </listitem>
    265       </varlistentry>
    266 
    267       <varlistentry id="tabs">
    268         <term><command>tabs</command></term>
    269         <listitem>
    270           <para>Clears and sets tab stops on a terminal</para>
    271           <indexterm zone="ch-system-ncurses tabs">
    272             <primary sortas="b-tabs">tabs</primary>
    273           </indexterm>
    274         </listitem>
    275       </varlistentry>
    276 
    277       <varlistentry id="tic">
    278         <term><command>tic</command></term>
    279         <listitem>
    280           <para>The terminfo entry-description compiler that translates a
    281           terminfo file from source format into the binary format needed for the
    282           ncurses library routines [A terminfo file contains information on the
    283           capabilities of a certain terminal.]</para>
    284           <indexterm zone="ch-system-ncurses tic">
    285             <primary sortas="b-tic">tic</primary>
    286           </indexterm>
    287         </listitem>
    288       </varlistentry>
    289 
    290       <varlistentry id="toe">
    291         <term><command>toe</command></term>
    292         <listitem>
    293           <para>Lists all available terminal types, giving the primary name and
    294           description for each</para>
    295           <indexterm zone="ch-system-ncurses toe">
    296             <primary sortas="b-toe">toe</primary>
    297           </indexterm>
    298         </listitem>
    299       </varlistentry>
    300 
    301       <varlistentry id="tput">
    302         <term><command>tput</command></term>
    303         <listitem>
    304           <para>Makes the values of terminal-dependent capabilities available to
    305           the shell; it can also be used to reset or initialize a terminal or
    306           report its long name</para>
    307           <indexterm zone="ch-system-ncurses tput">
    308             <primary sortas="b-tput">tput</primary>
    309           </indexterm>
    310         </listitem>
    311       </varlistentry>
    312 
    313       <varlistentry id="tset">
    314         <term><command>tset</command></term>
    315         <listitem>
    316           <para>Can be used to initialize terminals</para>
    317           <indexterm zone="ch-system-ncurses tset">
    318             <primary sortas="b-tset">tset</primary>
    319           </indexterm>
    320         </listitem>
    321       </varlistentry>
    322 
    323       <varlistentry id="libcursesw">
    324         <term><filename class="libraryfile">libcursesw</filename></term>
    325         <listitem>
    326           <para>A link to <filename>libncursesw</filename></para>
    327           <indexterm zone="ch-system-ncurses libcursesw">
    328             <primary sortas="c-libcursesw">libcursesw</primary>
    329           </indexterm>
    330         </listitem>
    331       </varlistentry>
    332 
    333       <varlistentry id="libncursesw">
    334         <term><filename class="libraryfile">libncursesw</filename></term>
    335         <listitem>
    336           <para>Contains functions to display text in many complex ways on a
    337           terminal screen; a good example of the use of these functions is the
    338           menu displayed during the kernel's <command>make
    339           menuconfig</command></para>
    340           <indexterm zone="ch-system-ncurses libncursesw">
    341             <primary sortas="c-libncursesw">libncursesw</primary>
    342           </indexterm>
    343         </listitem>
    344       </varlistentry>
    345 
    346       <varlistentry id="libformw">
    347         <term><filename class="libraryfile">libformw</filename></term>
    348         <listitem>
    349           <para>Contains functions to implement forms</para>
    350           <indexterm zone="ch-system-ncurses libformw">
    351             <primary sortas="c-libformw">libformw</primary>
    352           </indexterm>
    353         </listitem>
    354       </varlistentry>
    355 
    356       <varlistentry id="libmenuw">
    357         <term><filename class="libraryfile">libmenuw</filename></term>
    358         <listitem>
    359           <para>Contains functions to implement menus</para>
    360           <indexterm zone="ch-system-ncurses libmenuw">
    361             <primary sortas="c-libmenuw">libmenuw</primary>
    362           </indexterm>
    363         </listitem>
    364       </varlistentry>
    365 
    366       <varlistentry id="libpanelw">
    367         <term><filename class="libraryfile">libpanelw</filename></term>
    368         <listitem>
    369           <para>Contains functions to implement panels</para>
    370           <indexterm zone="ch-system-ncurses libpanelw">
    371             <primary sortas="c-libpanelw">libpanelw</primary>
    372           </indexterm>
    373         </listitem>
    374       </varlistentry>
    375 
    376     </variablelist>
     144    <para>Details on this package are located in
     145    <xref linkend="contents-ncurses" role="."/></para>
    377146
    378147  </sect2>
  • chapter06/patch.xml

    r560065f r675606b  
    66]>
    77
    8 <sect1 id="ch-system-patch" role="wrap">
     8<sect1 id="ch-tools-patch" role="wrap">
    99  <?dbhtml filename="patch.html"?>
    1010
     
    1717  <title>Patch-&patch-version;</title>
    1818
    19   <indexterm zone="ch-system-patch">
     19  <indexterm zone="ch-tools-patch">
    2020    <primary sortas="a-Patch">Patch</primary>
     21    <secondary>tools</secondary>
    2122  </indexterm>
    2223
     
    2425    <title/>
    2526
    26     <para>The Patch package contains a program for modifying or creating files
    27     by applying a <quote>patch</quote> file typically created by the
    28     <command>diff</command> program.</para>
     27    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     28    hr