Changeset c093e6b


Ignore:
Timestamp:
10/01/2022 10:30:12 PM (19 months ago)
Author:
Thomas Trepl (Moody) <thomas@…>
Branches:
multilib
Children:
f3b2f16
Parents:
f29824e (diff), 4349661 (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:

Automatic merge of trunk into multilib

Files:
1 added
47 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rf29824e rc093e6b  
    2727  PDF_OUTPUT      ?= LFS-BOOK.pdf
    2828  NOCHUNKS_OUTPUT ?= LFS-BOOK.html
    29   DUMPDIR         ?= ~/cross-lfs-commands
     29  DUMPDIR         ?= ~/lfs-commands
    3030else
    3131  BASEDIR         ?= ~/lfs-systemd
     
    151151               --noent                      \
    152152               --postvalid                  \
    153                     -o $(RENDERTMP)/lfs-full.xml \
     153               -o $(RENDERTMP)/lfs-full.xml \
    154154               $(RENDERTMP)/lfs-html2.xml
    155155
     
    162162        $(Q)xsltproc --nonet                              \
    163163                --stringparam profile.condition html \
    164                      --output $(RENDERTMP)/lfs-html.xml   \
     164                --output $(RENDERTMP)/lfs-html.xml   \
    165165                stylesheets/lfs-xsl/profile.xsl      \
    166                      $(RENDERTMP)/lfs-full.xml
     166                $(RENDERTMP)/lfs-full.xml
    167167
    168168wget-list: $(BASEDIR)/wget-list $(BASEDIR)/wget-list-$(REV)
     
    173173        $(Q)xsltproc --xinclude --nonet            \
    174174                --output $(BASEDIR)/wget-list \
    175                      stylesheets/wget-list.xsl     \
     175                stylesheets/wget-list.xsl     \
    176176                chapter03/chapter03.xml
    177177
     
    213213        $(Q)./git-version.sh $(REV)
    214214
    215 #dump-commands: validate
    216 #       @echo "Dumping book commands..."
    217 #       $(Q)xsltproc --nonet                     \
    218 #      --output $(RENDERTMP)/lfs-html.xml    \
    219 #      --stringparam profile.revision $(REV) \
    220 #      stylesheets/lfs-xsl/profile.xsl       \
    221 #      $(RENDERTMP)/lfs-full.xml
    222 
    223 #       $(Q)rm -rf $(DUMPDIR)
    224 
    225 #       $(Q)xsltproc --output $(DUMPDIR)/          \
    226 #                stylesheets/dump-commands.xsl \
    227 #                $(RENDERTMP)/lfs-html.xml
    228 #       @echo "Dumping book commands complete in $(DUMPDIR)"
    229 
    230 all: book nochunks pdf # dump-commands
     215dump-commands: validate
     216        @echo "Dumping book commands..."
     217
     218        $(Q)rm -rf $(DUMPDIR)
     219
     220        $(Q)xsltproc --output $(DUMPDIR)/          \
     221                stylesheets/dump-commands.xsl \
     222                $(RENDERTMP)/lfs-full.xml
     223        @echo "Dumping book commands complete in $(DUMPDIR)"
     224
     225all: book nochunks pdf dump-commands
    231226
    232227.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list version
  • appendices/dependencies.xml

    rf29824e rc093e6b  
    11871187        <seglistitem>
    11881188          <seg>
    1189             <ulink url="&blfs-book;general/pcre.html">PCRE</ulink>
     1189            <ulink url="&blfs-book;general/pcre2.html">PCRE2</ulink>
    11901190            and
    11911191            <ulink url="&blfs-book;general/libsigsegv.html">libsigsegv</ulink>
     
    23572357        <segtitle>&runtime;</segtitle>
    23582358        <seglistitem>
    2359           <seg>Glibc and Patch</seg>
     2359          <seg>Glibc</seg>
    23602360        </seglistitem>
    23612361      </segmentedlist>
  • bootscripts/ChangeLog

    rf29824e rc093e6b  
     12022-09-30 Bruce Dubbs <bdubbs@linuxfromscratch.org>
     2   * Mount /dev/shm as a tmpfs.
     3
    142022-07-23 Thomas Trepl <thomas@linuxfromscratch.org>
    25   * Mark an raid array clean when root (/) has been remounted
  • bootscripts/lfs/init.d/mountvirtfs

    rf29824e rc093e6b  
    3939      fi
    4040
    41       mkdir -p /run/lock /run/shm
    42       chmod 1777 /run/shm /run/lock
     41      mkdir -p   /run/lock
     42      chmod 1777 /run/lock
    4343
    4444      log_info_msg "Mounting virtual file systems: ${INFO}/run"
     
    5959      fi
    6060
    61       ln -sfn /run/shm /dev/shm
     61      mkdir -p /dev/shm
     62      log_info_msg2 " ${INFO}/dev/shm"
     63      mount -o nosuid,nodev /dev/shm || failed=1
    6264
    6365      (exit ${failed})
  • bootscripts/lfs/init.d/swap

    rf29824e rc093e6b  
    2121# Default-Start:       S
    2222# Default-Stop:        0 6
    23 # Short-Description:   Mounts and unmounts swap partitions.
    24 # Description:         Mounts and unmounts swap partitions defined in
     23# Short-Description:   Activates and deactivates swap partitions.
     24# Description:         Activates and deactivates swap partitions defined in
    2525#                      /etc/fstab.
    2626# X-LFS-Provided-By:   LFS
  • chapter01/changelog.xml

    rf29824e rc093e6b  
    4040    appropriate for the entry or if needed the entire day's listitem.
    4141    -->
     42
     43    <listitem>
     44      <para>2022-10-01</para>
     45      <itemizedlist>
     46        <listitem>
     47          <para>[bdubbs] - Update to iana-etc-20220922. Addresses
     48          <ulink url="&lfs-ticket-root;5006">#5006</ulink>.</para>
     49        </listitem>
     50        <listitem>
     51          <para>[bdubbs] - Update to tzdata-2022d. Fixes
     52          <ulink url="&lfs-ticket-root;5119">#5119</ulink>.</para>
     53        </listitem>
     54        <listitem>
     55          <para>[bdubbs] - Update to readline-8.2. Fixes
     56          <ulink url="&lfs-ticket-root;5121">#5121</ulink>.</para>
     57        </listitem>
     58        <listitem>
     59          <para>[bdubbs] - Update to linux-5.19.12. Fixes
     60          <ulink url="&lfs-ticket-root;5115">#5115</ulink>.</para>
     61        </listitem>
     62        <listitem>
     63          <para>[bdubbs] - Update to libffi-3.4.3. Fixes
     64          <ulink url="&lfs-ticket-root;5116">#5116</ulink>.</para>
     65        </listitem>
     66        <listitem>
     67          <para>[bdubbs] - Update to libcap-2.66. Fixes
     68          <ulink url="&lfs-ticket-root;512">#5120</ulink>.</para>
     69        </listitem>
     70        <listitem revision="systemd">
     71          <para>[bdubbs] - Update to dbus-1.14.2. Fixes
     72          <ulink url="&lfs-ticket-root;5123">#5123</ulink>.</para>
     73        </listitem>
     74        <listitem>
     75          <para>[bdubbs] - Update to bc-6.0.4. Fixes
     76          <ulink url="&lfs-ticket-root;5114">#5114</ulink>.</para>
     77        </listitem>
     78        <listitem>
     79          <para>[bdubbs] - Update to bash-5.2. Fixes
     80          <ulink url="&lfs-ticket-root;5122">#5122</ulink>.</para>
     81        </listitem>
     82      </itemizedlist>
     83    </listitem>
     84
     85    <listitem>
     86      <para>2022-09-22</para>
     87      <itemizedlist>
     88        <listitem>
     89          <para>[bdubbs] - Update to expat-2.4.9 (Security Update). Fixes
     90          <ulink url="&lfs-ticket-root;5117">#5117</ulink>.</para>
     91        </listitem>
     92      </itemizedlist>
     93    </listitem>
     94
     95    <listitem>
     96      <para>2022-09-20</para>
     97      <itemizedlist>
     98        <listitem>
     99          <para>[bdubbs] - Adapt instructions depending on
     100          host setup of /dev/shm when creating virtual filesystems
     101          for chroot.</para>
     102        </listitem>
     103      </itemizedlist>
     104    </listitem>
    42105
    43106    <listitem>
  • chapter01/how.xml

    rf29824e rc093e6b  
    4747  work your way through <xref linkend="chapter-cross-tools"/> and beyond.</para>
    4848
    49   <para><xref linkend="chapter-cross-tools"/>,  explains the installation of
     49  <para><xref linkend="chapter-cross-tools"/>  explains the installation of
    5050  the initial tool chain, (binutils, gcc, and glibc) using cross compilation
    5151  techniques to isolate the new tools from the host system.</para>
     
    6262  provided in <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
    6363
    64   <para>In <xref linkend="chapter-building-system"/>, The
     64  <para>In <xref linkend="chapter-building-system"/> the
    6565  full LFS system is built. Another advantage provided by the chroot
    6666  environment is that it allows you to continue using the host system
  • chapter01/whatsnew.xml

    rf29824e rc093e6b  
    1212  <title>What's new since the last release</title>
    1313
     14  <para>In 11.3 release, <parameter>--enable-default-pie</parameter>
     15  and <parameter>--enable-default-ssp</parameter> are enabled for GCC.
     16  They can mitigate some type of malicious attacks but they cannot provide
     17  a full protection.  In case if you are reading a programming textbook,
     18  you may need to disable PIE and SSP with GCC options
     19  <parameter>-fno-pie -no-pie -fno-stack-protection</parameter>
     20  because some textbooks assume they were disabled by default.</para>
     21
    1422  <para>Below is a list of package updates made since the previous
    1523  release of the book.</para>
     
    3947      <para>Automake-&automake-version;</para>
    4048    </listitem>-->
    41     <!--<listitem>
     49    <listitem>
    4250      <para>Bash &bash-version;</para>
    43     </listitem>-->
     51    </listitem>
    4452    <listitem>
    4553      <para>Bc &bc-version;</para>
     
    6371      <para>DejaGNU-&dejagnu-version;</para>
    6472    </listitem>-->
    65     <!--<listitem revision="systemd">
     73    <listitem revision="systemd">
    6674      <para>D-Bus-&dbus-version;</para>
    67     </listitem>-->
     75    </listitem>
    6876    <!--<listitem>
    6977      <para>Diffutils-&diffutils-version;</para>
     
    7583       <para>Eudev-&eudev-version;</para>
    7684    </listitem>-->
    77     <!--<listitem>
     85    <listitem>
    7886       <para>Expat-&expat-version;</para>
    79     </listitem>-->
     87    </listitem>
    8088    <!--<listitem>
    8189       <para>Expect-&expect-version;</para>
     
    123131      <para>Gzip-&gzip-version;</para>
    124132    </listitem>-->
    125     <!--<listitem>
     133    <listitem>
    126134      <para>IANA-Etc-&iana-etc-version;</para>
    127    </listitem>-->
     135    </listitem>
    128136    <!--<listitem>
    129137      <para>Inetutils-&inetutils-version;</para>
     
    150158      <para>LFS-Bootscripts-&lfs-bootscripts-version;</para>
    151159    </listitem>-->
    152     <!--<listitem>
     160    <listitem>
    153161      <para>Libcap-&libcap-version;</para>
    154     </listitem>-->
     162    </listitem>
    155163    <!--<listitem>
    156164      <para>Libelf-&elfutils-version; (from elfutils)</para>
    157165    </listitem>-->
    158     <!--<listitem>
     166    <listitem>
    159167      <para>Libffi-&libffi-version;</para>
    160     </listitem>-->
     168    </listitem>
    161169    <!--<listitem>
    162170      <para>Libpipeline-&libpipeline-version;</para>
     
    219227      <para>Python-&python-version;</para>
    220228    </listitem>
    221     <!--<listitem>
     229    <listitem>
    222230      <para>Readline-&readline-version;</para>
    223     </listitem>-->
     231    </listitem>
    224232    <!--<listitem>
    225233      <para>Sed-&sed-version;</para>
     
    246254      <para>Texinfo-&texinfo-version;</para>
    247255    </listitem>-->
    248     <!--<listitem>
     256    <listitem>
    249257      <para>Tzdata-&tzdata-version;</para>
    250     </listitem>-->
     258    </listitem>
    251259    <!--<listitem>
    252260      <para>Util-Linux-&util-linux-version;</para>
  • chapter02/aboutlfs.xml

    rf29824e rc093e6b  
    1515  throughout the LFS build process. It should be set to the name of the
    1616  directory where you will be building your LFS system - we will use
    17   <filename class="directory">/mnt/lfs</filename> as an example, but the
    18   directory choice is up to you. If you are building LFS on a separate
     17  <filename class="directory">/mnt/lfs</filename> as an example, but you may
     18  choose any directory name you want. If you are building LFS on a separate
    1919  partition, this directory will be the mount point for the partition.
    2020  Choose a directory location and set the variable with the
     
    2626  <command>mkdir -v $LFS/tools</command> can be typed literally. The shell
    2727  will automatically replace <quote>$LFS</quote> with
    28   <quote>/mnt/lfs</quote> (or whatever the variable was set to) when it
     28  <quote>/mnt/lfs</quote> (or whatever value the variable was set to) when it
    2929  processes the command line.</para>
    3030
     
    5050  enter the export command above.  In addition, the shell specified in the
    5151  <filename>/etc/passwd</filename> file for all users that need the
    52   <envar>LFS</envar> variable needs to be bash to ensure that the
     52  <envar>LFS</envar> variable must be bash to ensure that the
    5353  <filename>/root/.bash_profile</filename> file is incorporated as a part of
    5454  the login process.</para>
     
    6060  the <filename>.bashrc</filename> file for the user and
    6161  <systemitem class="username">root</systemitem>.  In addition,
    62   some distributions have instructions to not run the <filename>.bashrc</filename>
    63   instructions in a non-interactive bash invocation.  Be sure to add the
    64   export command before the test for non-interactive use.</para>
     62  some distributions use an "if" test, and do not run the remaining <filename>.bashrc</filename>
     63  instructions for a non-interactive bash invocation.  Be sure to place the
     64  export command ahead of the test for non-interactive use.</para>
    6565
    6666  </note>
  • chapter02/creatingfilesystem.xml

    rf29824e rc093e6b  
    1111  <title>Creating a File System on the Partition</title>
    1212
    13   <para>Now that a blank partition has been set up, the file system can be
    14   created.  LFS can use any file system recognized by the Linux kernel, but the
    15   most common types are ext3 and ext4.  The choice of file system can be
    16   complex and depends on the characteristics of the files and the size of
     13  <para>A partition is just a range of sectors on a disk drive, delimited by
     14  boundaries set in a partition table. Before the operating system can use
     15  a partition to store any files, the partition must be formatted to contain a file
     16  system, typically consisting of a label, directory blocks, data blocks, and
     17  an indexing scheme to locate a particular file on demand. The file system
     18  also helps the OS keep track of free space on the partition, reserve the
     19  needed sectors when a new file is created or an existing file is extended,
     20  and recycle the free data segments created when files are deleted. It may
     21  also provide support for data redundancy, and for error recovery.</para>
     22 
     23  <para>LFS can use any file system recognized by the Linux kernel, but the
     24  most common types are ext3 and ext4.  The choice of the right file system can be
     25  complex; it depends on the characteristics of the files and the size of
    1726  the partition.  For example:</para>
    1827
     
    3443    <varlistentry>
    3544      <term>ext4</term>
    36       <listitem><para>is the latest version of the ext file system family of
    37       partition types.  It provides several new capabilities including
    38       nano-second timestamps, creation and use of very large files (16 TB), and
    39       speed improvements.</para>
     45      <listitem><para>is the latest version of the ext family of
     46      file systems.  It provides several new capabilities including
     47      nano-second timestamps, creation and use of very large files
     48      (up to 16 TB), and speed improvements.</para>
    4049      </listitem>
    4150    </varlistentry>
     
    4352
    4453  <para>Other file systems, including FAT32, NTFS, ReiserFS, JFS, and XFS are
    45   useful for specialized purposes.  More information about these file systems
    46   can be found at <ulink
     54  useful for specialized purposes. More information about these file systems,
     55  and many others, can be found at <ulink
    4756  url="https://en.wikipedia.org/wiki/Comparison_of_file_systems"/>.</para>
    4857
    49   <para>LFS assumes that the root file system (/) is of type ext4.  To create
     58  <para>LFS assumes that the root file system (/) is of type ext4. To create
    5059  an <systemitem class="filesystem">ext4</systemitem> file system on the LFS
    51   partition, run the following:</para>
     60  partition, issue the following command:</para>
    5261
    5362<screen role="nodump"><userinput>mkfs -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable></userinput></screen>
  • chapter02/creatingpartition.xml

    rf29824e rc093e6b  
    9595    <para>Swapping is never good. For mechanical hard drives you can generally
    9696    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
     97    observing how the system reacts to commands. With an SSD you will not
     98    be able to hear swapping, but you can tell how much swap space is being used
     99    by running the <command>top</command> or <command>free</command> programs.  Use of
     100    an SSD for a swap partition should be avoided if possible.  The first
    101101    reaction to swapping should be to check for an unreasonable command such as
    102102    trying to edit a five gigabyte file. If swapping becomes a normal
     
    113113    loader. This partition will normally be labeled 'BIOS Boot' if using
    114114    <command>fdisk</command> or have a code of <emphasis>EF02</emphasis> if
    115     using <command>gdisk</command>.</para>
     115    using the <command>gdisk</command> command.</para>
    116116
    117117    <note><para>The Grub Bios partition must be on the drive that the BIOS
    118     uses to boot the system.  This is not necessarily the same drive where the
    119     LFS root partition is located. Disks on a system may use different
    120     partition table types.  The requirement for this partition depends
     118    uses to boot the system.  This is not necessarily the drive that holds
     119    the LFS root partition. The disks on a system may use different
     120    partition table types. The necessity of the Grub Bios partition depends
    121121    only on the partition table type of the boot disk.</para></note>
    122122    </sect3>
     
    134134      store kernels and other booting information.  To minimize potential boot
    135135      problems with larger disks, make this the first physical partition on
    136       your first disk drive.  A partition size of 200 megabytes is quite
     136      your first disk drive.  A partition size of 200 megabytes is
    137137      adequate.</para></listitem>
    138138
     
    151151      <filename class="directory">/lib</filename>, and
    152152      <filename class="directory">/sbin</filename> are symlinks to their
    153       counterpart in <filename class="directory">/usr</filename>.
    154       So <filename class="directory">/usr</filename> contains all binaries
     153      counterparts in <filename class="directory">/usr</filename>.
     154      So <filename class="directory">/usr</filename> contains all the binaries
    155155      needed for the system to run.  For LFS a separate partition for
    156156      <filename class="directory">/usr</filename> is normally not needed.
    157       If you need it anyway, you should make a partition large enough to
    158       fit all programs and libraries in the system. The root partition can be
     157      If you create it anyway, you should make a partition large enough to
     158      fit all the programs and libraries in the system. The root partition can be
    159159      very small (maybe just one gigabyte) in this configuration, so it's
    160160      suitable for a thin client or diskless workstation (where
    161161      <filename class="directory">/usr</filename> is mounted from a remote
    162       server).  However you should take care that an initramfs (not covered by
    163       LFS) will be needed to boot a system with separate
     162      server). However, you should be aware that an initramfs (not covered by
     163      LFS) will be needed to boot a system with a separate
    164164      <filename class="directory">/usr</filename> partition.</para></listitem>
    165165
    166166      <listitem><para>/opt &ndash; This directory is most useful for
    167       BLFS where multiple installations of large packages like Gnome or KDE can
     167      BLFS, where multiple large packages like KDE or Texlive can
    168168      be installed without embedding the files in the /usr hierarchy.  If
    169169      used, 5 to 10 gigabytes is generally adequate.</para>
    170170      </listitem>
    171171
    172       <listitem><para>/tmp &ndash; A separate /tmp directory is rare, but
    173       useful if configuring a thin client.  This partition, if used, will
    174       usually not need to exceed a couple of gigabytes.</para></listitem>
     172      <listitem revision='sysv'><para>/tmp &ndash; A separate /tmp directory
     173      is rare, but useful if configuring a thin client.  This partition, if
     174      used, will usually not need to exceed a couple of
     175      gigabytes.  If you have enough RAM, you can mount a
     176      <systemitem class='filesystem'>tmpfs</systemitem> on /tmp to make
     177      access to temporary files faster.</para></listitem>
     178
     179      <listitem revision='systemd'><para>/tmp &ndash; By default, systemd
     180      mounts a <systemitem class='filesystem'>tmpfs</systemitem> here.
     181      If you want to override that behavior, follow
     182      <xref linkend='systemd-no-tmpfs'/> when configuring the LFS
     183      system.</para></listitem>
    175184
    176185      <listitem><para>/usr/src &ndash; This partition is very
    177186      useful for providing a location to store BLFS source files and
    178       share them across LFS builds.  It can also be used as a location
    179       for building BLFS packages.  A reasonably large partition of 30-50
    180       gigabytes allows plenty of room.</para></listitem>
     187      share them across LFS builds. It can also be used as a location
     188      for building BLFS packages. A reasonably large partition of 30-50
     189      gigabytes provides plenty of room.</para></listitem>
    181190
    182191    </itemizedlist>
    183192
    184     <para>Any separate partition that you want automatically mounted upon boot
    185     needs to be specified in the <filename>/etc/fstab</filename>.  Details
    186     about how to specify partitions will be discussed in <xref
    187     linkend="ch-bootable-fstab"/>.  </para>
     193    <para>Any separate partition that you want automatically mounted when the
     194    system starts must be specified in the <filename>/etc/fstab</filename> file.
     195    Details about how to specify partitions will be discussed in <xref
     196    linkend="ch-bootable-fstab"/>.</para>
    188197
    189198    </sect3>
  • chapter02/hostreqs.xml

    rf29824e rc093e6b  
    3737    <listitem>
    3838      <para><emphasis role="strong">Bison-2.7</emphasis> (/usr/bin/yacc
    39       should be a link to bison or small script that executes bison)</para>
     39      should be a link to bison or a small script that executes bison)</para>
    4040    </listitem>
    4141
  • chapter02/mounting.xml

    rf29824e rc093e6b  
    1111  <title>Mounting the New Partition</title>
    1212
    13   <para>Now that a file system has been created, the partition needs to
    14   be made accessible. In order to do this, the partition needs to be
    15   mounted at a chosen mount point. For the purposes of this book, it is
    16   assumed that the file system is mounted under the directory specified by the
    17   <envar>LFS</envar> environment variable as described in the previous section.
     13  <para>Now that a file system has been created, the partition must
     14  be mounted so the host system can access it. This book assumes that
     15  the file system is mounted at the directory specified by the
     16  <envar>LFS</envar> environment variable described in the previous section.
    1817  </para>
     18 
     19  <para>Strictly speaking, one cannot "mount a partition". One mounts the <emphasis>file
     20  system</emphasis> embedded in that partition. But since a single partition can't contain
     21  more than one file system, people often speak of the partition and the
     22  associated file system as if they were one and the same.</para>
    1923
    20   <para>Create the mount point and mount the LFS file system by running:</para>
     24  <para>Create the mount point and mount the LFS file system with these commands:</para>
    2125
    2226<screen role="nodump"><userinput>mkdir -pv $LFS
    2327mount -v -t ext4 /dev/<replaceable>&lt;xxx&gt;</replaceable> $LFS</userinput></screen>
    2428
    25   <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the designation of the LFS
     29  <para>Replace <replaceable>&lt;xxx&gt;</replaceable> with the name of the LFS
    2630  partition.</para>
    2731
    28   <para>If using multiple partitions for LFS (e.g., one for <filename
    29   class="directory">/</filename> and another for <filename
    30   class="directory">/home</filename>), mount them using:</para>
     32  <para>If you are using multiple partitions for LFS (e.g., one for
     33  <filename class="directory">/</filename> and another for <filename
     34  class="directory">/home</filename>), mount them like this:</para>
    3135
    3236<screen role="nodump"><userinput>mkdir -pv $LFS
     
    4448  without any parameters to see what options are set for the mounted LFS
    4549  partition. If <option>nosuid</option> and/or <option>nodev</option> are set,
    46   the partition will need to be remounted.</para>
     50  the partition must be remounted.</para>
    4751
    48   <warning><para>The above instructions assume that you will not be restarting
     52  <warning><para>The above instructions assume that you will not restart
    4953  your computer throughout the LFS process.  If you shut down your system,
    5054  you will either need to remount the LFS partition each time you restart
    51   the build process or modify your host system's /etc/fstab file to automatically
    52   remount it upon boot.  For example:
     55  the build process, or modify the host system's &fstab; file to automatically
     56  remount it when you reboot. For example, you might add this line to your
     57  &fstab; file:
    5358
    5459<screen role="nodump">/dev/<replaceable>&lt;xxx&gt;</replaceable>  /mnt/lfs ext4   defaults      1     1</screen>
     
    6873  <systemitem class="filesystem">swap</systemitem> partition.</para>
    6974
    70   <para>Now that there is an established place to work, it is time to
     75  <para>Now that the new LFS partition is open for business, it's time to
    7176  download the packages.</para>
    7277
  • chapter02/stages.xml

    rf29824e rc093e6b  
    3535
    3636  <sect2>
    37   <title>Chapter&nbsp;5&ndash;6</title>
     37  <title>Chapters&nbsp;5&ndash;6</title>
    3838
    3939    <itemizedlist>
     
    4545        <para>These two chapters <emphasis>must</emphasis> be done as user
    4646        <systemitem class="username">lfs</systemitem>.
    47         A <command>su - lfs</command> needs to be done before any task in these
    48         chapters. Failing to do that, you are at risk of installing packages to the
     47        A <command>su - lfs</command> command must be issued before any task in these
     48        chapters. If you don't do that, you are at risk of installing packages to the
    4949        host, and potentially rendering it unusable.</para>
    5050      </listitem>
     
    5555         doubt about installing a package, ensure any previously expanded
    5656         tarballs are removed, then re-extract the package files, and complete all
    57          instructions in that section.</para>
     57         the instructions in that section.</para>
    5858      </listitem>
    5959    </itemizedlist>
     
    6161
    6262  <sect2>
    63   <title>Chapter&nbsp;7&ndash;10</title>
     63  <title>Chapters&nbsp;7&ndash;10</title>
    6464
    6565    <itemizedlist>
     
    7070      <listitem>
    7171        <para>A few operations, from <quote>Changing Ownership</quote> to
    72         <quote>Entering the Chroot Environment</quote> must be done as the
     72        <quote>Entering the Chroot Environment</quote>, must be done as the
    7373        <systemitem class="username">root</systemitem> user, with the LFS
    7474        environment variable set for the &root; user.</para>
     
    7878         <para> When entering chroot, the LFS environment variable must be set
    7979         for <systemitem class="username">root</systemitem>. The LFS
    80          variable is not used afterwards.</para>
     80         variable is not used after entering the chroot environment.</para>
    8181      </listitem>
    8282
  • chapter03/introduction.xml

    rf29824e rc093e6b  
    1414  order to build a basic Linux system. The listed version numbers correspond to
    1515  versions of the software that are known to work, and this book is based on
    16   their use. We highly recommend against using different versions because the build
     16  their use. We highly recommend against using different versions, because the build
    1717  commands for one version may not work with a different version, unless the
    18   different version is specified by a LFS errata or security advisory.
     18  different version is specified by an LFS erratum or security advisory.
    1919  The newest package versions may also have problems that require
    2020  work-arounds. These work-arounds will be developed and stabilized in the
     
    2222
    2323  <para>For some packages, the release tarball and the (Git or SVN)
    24   repository snapshot tarball for this release may be published with
    25   similar file name.  A release tarball contains generated files (for
    26   example, <command>configure</command> script generated by
     24  repository snapshot tarball for that release may be published with
     25  similar file names.  A release tarball contains generated files (for
     26  example, a <command>configure</command> script generated by
    2727  <command>autoconf</command>), in addition to the contents of the
    2828  corresponding repository snapshot.  The book uses release tarballs
     
    7070    <listitem>
    7171      <para>For stable versions of the book, a tarball of all the needed files
    72       can be downloaded from one of the LFS files mirrors listed at
     72      can be downloaded from one of the mirror sites listed at
    7373      <ulink url="https://www.linuxfromscratch.org/mirrors.html#files"/>.</para>
    7474    </listitem>
  • chapter03/packages.xml

    rf29824e rc093e6b  
    1616    package should be used to avoid security vulnerabilities.</para>
    1717
    18     <para>The upstreams may remove old releases, especially when these
     18    <para>The upstream sources may remove old releases, especially when those
    1919    releases contain a security vulnerability.  If one URL below is not
    2020    reachable, you should read the security advisories first to figure out
     
    2222    not, try to download the removed package from a mirror.  Although it's
    2323    possible to download an old release from a mirror even if this release
    24     has been removed because of a vulnerability, it's not recommended to
    25     use a release known to be vulnerable for building your system.</para>
     24    has been removed because of a vulnerability, it's not a good idea to
     25    use a release known to be vulnerable when building your system.</para>
    2626  </note>
    2727
     
    463463
    464464        <note>
    465           <para>The Linux kernel is updated relatively often, many times due to
     465          <para>The Linux kernel is updated quite frequently, many times due to
    466466          discoveries of security vulnerabilities.  The latest available
    467467          <!--&linux-major-version;.&linux-minor-version;.x--> stable kernel
  • chapter04/aboutsbus.xml

    rf29824e rc093e6b  
    1414  it takes to compile and install each package. Because Linux From
    1515  Scratch can be built on many different systems, it is impossible to
    16   provide accurate time estimates. The biggest package (Glibc) will
     16  provide absolute time estimates. The biggest package (Glibc) will
    1717  take approximately 20 minutes on the fastest systems, but could take
    1818  up to three days on slower systems! Instead of providing actual times,
     
    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-cross-tools"/>. The
    24   time it takes to compile this package is what will be referred to as the
    25   Standard Build Unit or SBU. All other compile times will be expressed relative
    26   to this time.</para>
     23  is binutils in <xref linkend="chapter-cross-tools"/>. The
     24  time it takes to compile this package is what we will refer to as the
     25  Standard Build Unit or SBU. All other compile times will be expressed in
     26  terms of this unit of time.</para>
    2727
    2828  <para>For example, consider a package whose compilation time is 4.5
    29   SBUs. This means that if a system took 10 minutes to compile and
     29  SBUs. This means that if your system took 10 minutes to compile and
    3030  install the first pass of binutils, it will take
    31   <emphasis>approximately</emphasis> 45 minutes to build this example package.
    32   Fortunately, most build times are shorter than the one for binutils.</para>
     31  <emphasis>approximately</emphasis> 45 minutes to build the example package.
     32  Fortunately, most build times are shorter than one SBU.</para>
    3333
    34   <para>In general, SBUs are not entirely accurate because they depend on many
     34  <para>SBUs are not entirely accurate because they depend on many
    3535  factors, including the host system's version of GCC.  They are provided here
    3636  to give an estimate of how long it might take to install a package, but the
     
    4646    <screen role="nodump"><userinput>export MAKEFLAGS='-j4'</userinput></screen>
    4747
    48     <para>or just building with:</para>
     48    <para>or by building with:</para>
    4949
    5050    <screen role="nodump"><userinput>make -j4</userinput></screen>
     
    5353    book will vary even more than they normally would.  In some cases, the make
    5454    step will simply fail.  Analyzing the output of the build process will also
    55     be more difficult because the lines of different processes will be
    56     interleaved.  If you run into a problem with a build step, revert back to a
     55    be more difficult because the lines from different processes will be
     56    interleaved.  If you run into a problem with a build step, revert to a
    5757    single processor build to properly analyze the error messages.</para>
    5858  </note>
  • chapter04/abouttestsuites.xml

    rf29824e rc093e6b  
    2828    <para>Running the test suites in <xref linkend="chapter-cross-tools"/>
    2929    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>
     30    is pointless; since the test programs are compiled with a cross-compiler,
     31    they probably can't run on the build host.</para>
    3232  </note>
    3333
    3434  <para>A common issue with running the test suites for binutils and GCC
    35   is running out of pseudo terminals (PTYs). This can result in a high
     35  is running out of pseudo terminals (PTYs). This can result in a large
    3636  number of failing tests. This may happen for several reasons, but the
    3737  most likely cause is that the host system does not have the
     
    4040  <ulink url="&lfs-root;lfs/faq.html#no-ptys"/>.</para>
    4141
    42   <para>Sometimes package test suites will fail, but for reasons which the
     42  <para>Sometimes package test suites will fail for reasons which the
    4343  developers are aware of and have deemed non-critical. Consult the logs located
    4444  at <ulink url="&test-results;"/> to verify whether or not these failures are
    45   expected. This site is valid for all tests throughout this book.</para>
     45  expected. This site is valid for all test suites throughout this book.</para>
    4646
    4747</sect1>
  • chapter04/addinguser.xml

    rf29824e rc093e6b  
    1515  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
    17   working environment, create a new user called <systemitem
     17  working environment, we will create a new user called <systemitem
    1818  class="username">lfs</systemitem> as a member of a new group (also named
    19   <systemitem class="groupname">lfs</systemitem>) and use this user during
     19  <systemitem class="groupname">lfs</systemitem>) and run commands as &lfs-user; during
    2020  the installation process. As <systemitem class="username">root</systemitem>,
    2121  issue the following commands to add the new user:</para>
     
    2525
    2626  <variablelist>
    27     <title>The meaning of the command line options:</title>
     27    <title>This is what the command line options mean:</title>
    2828
    2929    <varlistentry>
     
    5555      <listitem>
    5656        <para>This parameter prevents possible copying of files from a skeleton
    57         directory (default is <filename class="directory">/etc/skel</filename>)
     57        directory (the default is <filename class="directory">/etc/skel</filename>)
    5858        by changing the input location to the special null device.</para>
    5959      </listitem>
     
    6969  </variablelist>
    7070
    71   <para>To log in as <systemitem class="username">lfs</systemitem> (as opposed
    72   to switching to user <systemitem class="username">lfs</systemitem> when logged
    73   in as <systemitem class="username">root</systemitem>, which does not require
    74   the <systemitem class="username">lfs</systemitem> user to have a password),
    75   give <systemitem class="username">lfs</systemitem> a password:</para>
     71  <para>If you want to log in as &lfs-user; or switch to &lfs-user; from a
     72  non-&root; user (as opposed to switching to user &lfs-user;
     73  when logged in as &root;, which does not require the &lfs-user; user to
     74  have a password), you need to set a password of &lfs-user;.  Issue the
     75  following command as the &root; user to set the password:</para>
    7676
    7777<screen role="nodump"><userinput>passwd lfs</userinput></screen>
    7878
    7979  <para>Grant <systemitem class="username">lfs</systemitem> full access to
    80   all directories under <filename class="directory">$LFS</filename> by making
    81   <systemitem class="username">lfs</systemitem> the directory owner:</para>
     80  all the directories under <filename class="directory">$LFS</filename> by making
     81  <systemitem class="username">lfs</systemitem> the owner:</para>
    8282
    8383<screen><userinput>chown -v lfs $LFS/{usr{,/*},lib,var,etc,bin,sbin,tools}
     
    8989<screen arch="ml_all" ><userinput>chown -v lfs $LFS/{lib32,libx32}</userinput></screen>
    9090
    91   <note><para>In some host systems, the following command does not complete
    92   properly and suspends the login to the &lfs-user; user to the background.
     91<note><para>In some host systems, the following <command>su</command> command does not complete
     92  properly and suspends the login for the &lfs-user; user to the background.
    9393  If the prompt "lfs:~$" does not appear immediately, entering the
    9494  <command>fg</command> command will fix the issue.</para></note>
    9595
    96   <para>Next, login as user <systemitem class="username">lfs</systemitem>.
    97   This can be done via a virtual console, through a display manager, or with
    98   the following substitute/switch user command:</para>
     96  <para>Next, start a shell running as user &lfs-user;. This can be done by
     97  logging in as &lfs-user; on a virtual console, or with the following
     98  substitute/switch user command:</para>
    9999
    100100<screen role="nodump"><userinput>su - lfs</userinput></screen>
     
    102102  <para>The <quote><parameter>-</parameter></quote> instructs
    103103  <command>su</command> to start a login shell as opposed to a non-login shell.
    104   The difference between these two types of shells can be found in detail in
     104  The difference between these two types of shells is described in detail in
    105105  <filename>bash(1)</filename> and <command>info bash</command>.</para>
    106106
  • chapter04/creatingminlayout.xml

    rf29824e rc093e6b  
    1111  <title>Creating a limited directory layout in LFS filesystem</title>
    1212
    13   <para>The first task performed in the LFS partition is to create a limited
    14   directory hierarchy so that programs compiled in <xref
     13  <para>In this section, we begin populating the LFS filesystem with the
     14  pieces that will constitute the final Linux system. The first step is to
     15  create a limited directory hierarchy, so that the programs compiled in <xref
    1516  linkend="chapter-temporary-tools"/> (as well as glibc and libstdc++ in <xref
    16   linkend="chapter-cross-tools"/>) may be installed in their final
    17   location. This is needed so that those temporary programs be overwritten
    18   when rebuilding them in <xref linkend="chapter-building-system"/>.</para>
     17  linkend="chapter-cross-tools"/>) can be installed in their final
     18  location. We do this so those temporary programs will be overwritten when
     19  the final versions are built in <xref linkend="chapter-building-system"/>.</para>
    1920
    20   <para>Create the required directory layout by running the following as
     21  <para>Create the required directory layout by issuing the following commands as
    2122  <systemitem class="username">root</systemitem>:</para>
    2223
     
    3940
    4041  <para>Programs in <xref linkend="chapter-temporary-tools"/> will be compiled
    41   with a cross-compiler (more details in section <xref
    42   linkend="ch-tools-toolchaintechnotes"/>). In order to separate this
    43   cross-compiler from the other programs, it will be installed in a special
    44   directory. Create this directory with:</para>
     42  with a cross-compiler (more details can be found in section <xref
     43  linkend="ch-tools-toolchaintechnotes"/>). This cross-compiler will be installed
     44  in a special directory, to separate it from the other programs. Still acting as
     45  &root;, create that directory with this command:</para>
    4546
    4647<screen><userinput>mkdir -pv $LFS/tools</userinput></screen>
  • chapter04/introduction.xml

    rf29824e rc093e6b  
    1313  <para>In this chapter, we will perform a few additional tasks to prepare
    1414  for building the temporary system. We will create a set of directories in
    15   <filename class="directory">$LFS</filename> for the installation of the
    16   temporary tools, add an unprivileged user to reduce risk,
     15  <filename class="directory">$LFS</filename> (in which we will install the
     16  temporary tools), add an unprivileged user,
    1717  and create an appropriate build environment for that user. We will also
    18   explain the unit of time we use to measure how long LFS packages take to
    19   build, or <quote>SBUs</quote>, and give some information about package
     18  explain the units of time (<quote>SBUs</quote>) we use to measure how
     19  long it takes to build LFS packages, and provide some information about package
    2020  test suites.</para>
    2121
  • chapter04/settingenviron.xml

    rf29824e rc093e6b  
    2020EOF</userinput></screen>
    2121
    22   <para>When logged on as user <systemitem class="username">lfs</systemitem>,
    23   the initial shell is usually a <emphasis>login</emphasis> shell which reads
     22  <para>When logged on as user <systemitem class="username">lfs</systemitem>
     23  or switched to the &lfs-user; user using a <command>su</command> command
     24  with <quote><parameter>-</parameter></quote> option,
     25  the initial shell is a <emphasis>login</emphasis> shell which reads
    2426  the <filename>/etc/profile</filename> of the host (probably containing some
    2527  settings and environment variables) and then <filename>.bash_profile</filename>.
     
    3335
    3436  <para>The new instance of the shell is a <emphasis>non-login</emphasis>
    35   shell, which does not read, and execute, the contents of <filename>/etc/profile</filename> or
     37  shell, which does not read, and execute, the contents of the <filename>/etc/profile</filename> or
    3638  <filename>.bash_profile</filename> files, but rather reads, and executes, the
    3739  <filename>.bashrc</filename> file instead. Create the
     
    7476  <command>bash</command>'s hash function. Hashing is ordinarily a useful
    7577  feature&mdash;<command>bash</command> uses a hash table to remember the
    76   full path of executable files to avoid searching the <envar>PATH</envar>
     78  full path to executable files to avoid searching the <envar>PATH</envar>
    7779  time and again to find the same executable. However, the new tools should
    78   be used as soon as they are installed. By switching off the hash function,
    79   the shell will always search the <envar>PATH</envar> when a program is to
     80  be used as soon as they are installed. Switching off the hash function forces
     81  the shell to search the <envar>PATH</envar> whenever a program is to
    8082  be run. As such, the shell will find the newly compiled tools in
    8183  <filename class="directory">$LFS/tools/bin</filename> as soon as they are
     
    130132      <term><parameter>PATH=/usr/bin</parameter></term>
    131133      <listitem>
    132   <para>Many modern linux distributions have merged <filename
     134  <para>Many modern Linux distributions have merged <filename
    133135  class="directory">/bin</filename> and <filename
    134136  class="directory">/usr/bin</filename>. When this is the case, the standard
    135   <envar>PATH</envar> variable needs just to be set to <filename
     137  <envar>PATH</envar> variable should be set to <filename
    136138  class="directory">/usr/bin/</filename> for the <xref
    137139  linkend="chapter-temporary-tools"/> environment. When this is not the
     
    156158  of <xref linkend="chapter-cross-tools"/> is picked up by the shell
    157159  immediately after its installation. This, combined with turning off hashing,
    158   limits the risk that the compiler from the host be used instead of the
     160  limits the risk that the compiler from the host is used instead of the
    159161  cross-compiler.</para>
    160162      </listitem>
     
    210212
    211213  <para>Finally, to have the environment fully prepared for building the
    212   temporary tools, source the just-created user profile:</para>
     214  temporary tools, force the <command>bash</command> shell to read
     215  the new user profile:</para>
    213216
    214217<screen><userinput>source ~/.bash_profile</userinput></screen>
  • chapter07/cleanup.xml

    rf29824e rc093e6b  
    1919<screen><userinput>rm -rf /usr/share/{info,man,doc}/*</userinput></screen>
    2020
    21     <para>Second, the libtool .la files are only useful when linking with static
    22     libraries. They are unneeded and potentially harmful when using dynamic
    23     shared libraries, especially when using non-autotools build systems.
    24     While still in chroot, remove those files now:</para>
     21    <para>Second, on a modern Linux system, the libtool .la files are only
     22    useful for libltdl.  No libraries in LFS are expected to be loaded by
     23    libltdl, and it's known that some .la files can cause BLFS packages
     24    fail to build.  Remove those files now:</para>
    2525
    2626<screen><userinput>find /usr/{lib,libexec} -name \*.la -delete</userinput><userinput arch="ml_32">
     
    9999    <para>Before making a backup, unmount the virtual file systems:</para>
    100100
    101 <screen role="nodump"><userinput>umount $LFS/dev/pts
     101<screen role="nodump"><userinput>mountpoint -q $LFS/dev/shm &amp;&amp; umount $LFS/dev/shm
     102umount $LFS/dev/pts
    102103umount $LFS/{sys,proc,run,dev}</userinput></screen>
    103104
  • chapter07/creatingdirs.xml

    rf29824e rc093e6b  
    1111  <title>Creating Directories</title>
    1212
    13   <para>It is time to create the full structure in the LFS file system.</para>
     13  <para>It is time to create the full directory structure in the LFS file system.</para>
    1414
    15   <note><para>Some of the directories mentioned in this section may be
    16   already created earlier with explicit instructions or when installing some
     15  <note><para>Some of the directories mentioned in this section may have
     16  already been created earlier with explicit instructions, or when installing some
    1717  packages.  They are repeated below for completeness.</para></note>
    1818
     
    4646
    4747  <para>Directories are, by default, created with permission mode 755, but
    48   this is not desirable for all directories. In the commands above, two
     48  this is not desirable everywhere. In the commands above, two
    4949  changes are made&mdash;one to the home directory of user <systemitem
    5050  class="username">root</systemitem>, and another to the directories for
     
    5252
    5353  <para>The first mode change ensures that not just anybody can enter
    54   the <filename class="directory">/root</filename> directory&mdash;the
    55   same as a normal user would do with his or her home directory. The
     54  the <filename class="directory">/root</filename> directory&mdash;just
     55  like a normal user would do with his or her own home directory. The
    5656  second mode change makes sure that any user can write to the
    5757  <filename class="directory">/tmp</filename> and <filename
     
    6363    <title>FHS Compliance Note</title>
    6464
    65     <para>The directory tree is based on the Filesystem Hierarchy Standard
     65    <para>This directory tree is based on the Filesystem Hierarchy Standard
    6666    (FHS) (available at <ulink
    6767    url="https://refspecs.linuxfoundation.org/fhs.shtml"/>).  The FHS also specifies
    68     the optional existence of some directories such as <filename
     68    the optional existence of additional directories such as <filename
    6969    class="directory">/usr/local/games</filename> and <filename
    70     class="directory">/usr/share/games</filename>.  We create only the
    71     directories that are needed. However, feel free to create these
    72     directories.  </para>
     70    class="directory">/usr/share/games</filename>.  In LFS, we create only the
     71    directories that are really necessary. However, feel free to create more
     72    directories, if you wish.  </para>
    7373
    7474  </sect2>
  • chapter07/introduction.xml

    rf29824e rc093e6b  
    1212
    1313  <para>This chapter shows how to build the last missing bits of the temporary
    14   system: the tools needed by the build machinery of various packages.  Now
     14  system: the tools needed to build the various packages.  Now
    1515  that all circular dependencies have been resolved, a <quote>chroot</quote>
    1616  environment, completely isolated from the host operating system (except for
     
    1818
    1919  <para>For proper operation of the isolated environment, some communication
    20   with the running kernel must be established. This is done through the
    21   so-called <emphasis>Virtual Kernel File Systems</emphasis>, which must be
    22   mounted when entering the chroot environment. You may want to check
    23   that they are mounted by issuing <command>findmnt</command>.</para>
     20  with the running kernel must be established. This is done via the
     21  so-called <emphasis>Virtual Kernel File Systems</emphasis>, which will be
     22  mounted before entering the chroot environment. You may want to verify
     23  that they are mounted by issuing the <command>findmnt</command> command.</para>
    2424
    2525  <para>Until <xref linkend="ch-tools-chroot"/>, the commands must be
     
    2828  are run as &root;, fortunately without access to the OS of the computer
    2929  you built LFS on. Be careful anyway, as it is easy to destroy the whole
    30   LFS system with badly formed commands.</para>
     30  LFS system with bad commands.</para>
    3131
    3232</sect1>
  • chapter07/kernfs.xml

    rf29824e rc093e6b  
    1515  </indexterm>
    1616
    17     <para>Various file systems exported by the kernel are used to communicate to
    18     and from the kernel itself. These file systems are virtual in that no disk
     17    <para>Applications running in user space utilize various file
     18    systems exported by the kernel to communicate
     19    with the kernel itself. These file systems are virtual: no disk
    1920    space is used for them. The content of the file systems resides in
    20     memory.</para>
     21    memory. These file systems must be mounted in the $LFS directory tree
     22    so the applications can find them in the chroot environment.</para>
    2123
    22     <para>Begin by creating directories onto which the file systems will be
     24    <para>Begin by creating directories on which the file systems will be
    2325    mounted:</para>
    2426
     
    2830    <title>Mounting and Populating /dev</title>
    2931
    30       <para>During a normal boot, the kernel automatically mounts the
    31       <systemitem class="filesystem">devtmpfs</systemitem> filesystem on the
    32       <filename class="directory">/dev</filename> directory, and allow the
    33       devices to be created dynamically on that virtual filesystem as they
    34       are detected or accessed. Device creation is generally done during the
    35       boot process by the kernel and Udev.
    36       Since this new system does not yet have Udev and
    37       has not yet been booted, it is necessary to mount and populate
    38       <filename class="directory">/dev</filename> manually. This is
    39       accomplished by bind mounting the host system's
     32      <para>During a normal boot of the LFS system, the kernel automatically
     33      mounts the <systemitem class="filesystem">devtmpfs</systemitem>
     34      filesystem on the
     35      <filename class="directory">/dev</filename> directory; the kernel
     36      creates device nodes on that virtual filesystem during the boot process
     37      or when a device is first detected or accessed. The udev daemon may
     38      change the owner or permission of the device nodes created by the
     39      kernel, or create new device nodes or symlinks to ease the work of
     40      distro maintainers or system administrators.  (See
     41      <xref linkend='ch-config-udev-device-node-creation'/> for details.)
     42      If the host kernel supports &devtmpfs;, we can simply mount a
     43      &devtmpfs; at <filename class='directory'>$LFS/dev</filename> and rely
     44      on the kernel to populate it (the LFS building process does not need
     45      the additional work onto &devtmpfs; by udev daemon).</para>
     46
     47      <para>But, some host kernels may lack &devtmpfs; support and these
     48      host distros maintain the content of
     49      <filename class="directory">/dev</filename> with different methods.
     50      So the only host-agnostic way for populating
     51      <filename class="directory">$LFS/dev</filename> is
     52      bind mounting the host system's
    4053      <filename class="directory">/dev</filename> directory. A bind mount is
    4154      a special type of mount that allows you to create a mirror of a
    42       directory or mount point to some other location. Use the following
    43       command to achieve this:</para>
     55      directory or mount point at some other location. Use the following
     56      command to do this:</para>
    4457
    4558<screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen>
     
    90103      directory needs to be created.</para>
    91104
     105      <para>In other host systems <filename>/dev/shm</filename> is a mount point
     106      for a tmpfs. In that case the mount of /dev above will only create
     107      /dev/shm as a directory in the chroot environment. In this situation
     108      we must explicitly mount a tmpfs:</para>
     109
    92110<screen><userinput>if [ -h $LFS/dev/shm ]; then
    93111  mkdir -pv $LFS/$(readlink $LFS/dev/shm)
     112else
     113  mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
    94114fi</userinput></screen>
    95115
  • chapter08/autoconf.xml

    rf29824e rc093e6b  
    4141  <sect2 role="installation">
    4242    <title>Installation of Autoconf</title>
    43 <!--
    44     <para>First, apply a patch fixes several problems that occur with the latest
    45     perl, libtool, and bash versions.</para>
    4643
    47 <screen><userinput remap="pre">patch -Np1 -i ../&autoconf-fixes-patch;</userinput></screen>
    48 -->
     44    <para>First, fix several problems with the tests caused by bash-5.2 and later:</para>
     45
     46    <screen><userinput remap="pre">sed -e 's/SECONDS|/&amp;SHLVL|/'               \
     47    -e '/BASH_ARGV=/a\        /^SHLVL=/ d' \
     48    -i.orig tests/local.at</userinput></screen>
     49
    4950    <para>Prepare Autoconf for compilation:</para>
    5051
  • chapter08/binutils.xml

    rf29824e rc093e6b  
    179179<screen><userinput remap="test">make -k check</userinput></screen>
    180180
    181 <para>Twelve tests fail in the <command>gold</command> testsuite when the
     181    <para>Twelve tests fail in the <command>gold</command> testsuite when the
    182182    <option>--enable-default-pie</option> and
    183     <option>--enable-default-ssp</option> options are passed to GCC. There
    184     is also a known failure in the <command>as</command> tests.</para>
    185     <!-- Fixed in 2.39
    186          https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=01ae03b
    187     <para>One gold test, <filename>pr17704a_test</filename>, is known to
    188     fail if <parameter>CONFIG_IA32_EMULATION</parameter> is disabled in the
    189     kernel configuration of the host system.</para>
    190  -->
     183    <option>--enable-default-ssp</option> options are passed to GCC.
     184    <!-- Caused by egrep deprecation.  Note that we don't "patch" temp grep.
     185         And it seems unworthy to add a sed into temp grep just for one test
     186         failure.  (I don't really agree to "patch" grep in the first place,
     187         anyway.) -->
     188    The test named <filename>ar with versioned solib</filename> is also
     189    known to fail.</para>
     190
    191191    <para>Install the package:</para>
    192192
  • chapter08/cleanup.xml

    rf29824e rc093e6b  
    1717  <para>There are also several files installed in the /usr/lib and /usr/libexec
    1818  directories with a file name extension of .la. These are "libtool archive"
    19   files. As already said, they are only useful when linking with static
    20   libraries. They are unneeded, and potentially harmful, when using dynamic
    21   shared libraries, specially when using also non-autotools build systems.
    22   To remove them, run:</para>
     19  files. As already said, on a modern Linux system the libtool .la files are
     20  only useful for libltdl.  No libraries in LFS are expected to be loaded
     21  by libltdl, and it's known that some .la files can cause BLFS packages
     22  fail to build.  Remove those files now:</para>
    2323
    2424<screen><userinput>find /usr/lib /usr/libexec -name \*.la -delete</userinput><userinput arch="ml_32,ml_all">
  • chapter08/gawk.xml

    rf29824e rc093e6b  
    4747    <para>Now fix a programming error identified upstream:</para>
    4848
    49 <screen><userinput remap="pre">sed -i -i '241i UPREF(m);' interpret.h</userinput></screen>
     49<screen><userinput remap="pre">sed -i '241i UPREF(m);' interpret.h</userinput></screen>
    5050
    5151    <para>Prepare Gawk for compilation:</para>
  • chapter08/gcc.xml

    rf29824e rc093e6b  
    133133        binary programs that can be loaded anywhere in memory.  Without PIE,
    134134        the security feature named ASLR (Address Space Layout Randomization)
    135         can be applied for the shared libraries, but not the exectutable
     135        can be applied for the shared libraries, but not the executable
    136136        itself.  Enabling PIE allows ASLR for the executables in addition to
    137137        the shared libraries, and mitigates some attacks based on fixed
  • chapter08/libelf.xml

    rf29824e rc093e6b  
    5959<screen><userinput remap="test">make check</userinput></screen>
    6060
    61 <!--    <para>One test, run-elfclassify.sh, is known to fail.</para>-->
     61    <para>One test named <filename>run-low_high_pc.sh</filename> is known to
     62    fail on 32-bit x86 system.</para>
    6263
    6364    <para>Install only Libelf:</para>
  • chapter08/pkgmgt.xml

    rf29824e rc093e6b  
    1212
    1313  <para>Package Management is an often requested addition to the LFS Book. A
    14   Package Manager allows tracking the installation of files making it easy to
     14  Package Manager tracks the installation of files, making it easier to
    1515  remove and upgrade packages. As well as the binary and library files, a
    1616  package manager will handle the installation of configuration files.  Before
     
    1818  any particular package manager. What it provides is a roundup of the more
    1919  popular techniques and how they work. The perfect package manager for you may
    20   be among these techniques or may be a combination of two or more of these
     20  be among these techniques, or it may be a combination of two or more of these
    2121  techniques. This section briefly mentions issues that may arise when upgrading
    2222  packages.</para>
     
    3333    <listitem>
    3434      <para>There are multiple solutions for package management, each having
    35       its strengths and drawbacks.  Including one that satisfies all audiences
     35      its strengths and drawbacks.  Finding one solution that satisfies all audiences
    3636      is difficult.</para>
    3737    </listitem>
     
    4040  <para>There are some hints written on the topic of package management. Visit
    4141  the <ulink url="&hints-root;">Hints Project</ulink> and see if one of them
    42   fits your need.</para>
     42  fits your needs.</para>
    4343
    4444  <sect2 id='pkgmgmt-upgrade-issues'>
     
    5252    <itemizedlist>
    5353      <listitem>
    54         <para>If Linux kernel needs to be upgraded (for example, from
    55         5.10.17 to 5.10.18 or 5.11.1), nothing else need to be rebuilt.
    56         The system will keep working fine thanks to the well-defined border
    57         between kernel and userspace.  Specifically, Linux API headers
    58         need not to be (and should not be, see the next item) upgraded
    59         alongside the kernel.  You'll need to reboot your system to use the
     54        <para>If the Linux kernel needs to be upgraded (for example, from
     55        5.10.17 to 5.10.18 or 5.11.1), nothing else needs to be rebuilt.
     56        The system will keep working fine thanks to the well-defined interface
     57        between the kernel and user space.  Specifically, Linux API headers
     58        need not be (and should not be, see the next item) upgraded
     59        along with the kernel.  You will merely need to reboot your system to use the
    6060        upgraded kernel.</para>
    6161      </listitem>
    6262
    6363      <listitem>
    64         <para>If Linux API headers or Glibc needs to be upgraded to a newer
    65         version, (e.g.  from glibc-2.31 to glibc-2.32), it is safer to
     64        <para>If Linux API headers or glibc need to be upgraded to a newer
     65        version, (e.g.,  from glibc-2.31 to glibc-2.32), it is safer to
    6666        rebuild LFS.  Though you <emphasis>may</emphasis> be able to rebuild
    6767        all the packages in their dependency order, we do not recommend
     
    7171      <listitem> <para>If a package containing a shared library is updated, and
    7272      if the name of the library changes, then any packages dynamically
    73       linked to the library need to be recompiled in order to link against the
     73      linked to the library must be recompiled, to link against the
    7474      newer library.  (Note that there is no correlation between the package
    7575      version and the name of the library.) For example, consider a package
    76       foo-1.2.3 that installs a shared library with name <filename
    77       class='libraryfile'>libfoo.so.1</filename>. If you upgrade the package to
    78       a newer version foo-1.2.4 that installs a shared library with name
     76      foo-1.2.3 that installs a shared library with the name <filename
     77      class='libraryfile'>libfoo.so.1</filename>. Suppose you upgrade the package to
     78      a newer version foo-1.2.4 that installs a shared library with the name
    7979      <filename class='libraryfile'>libfoo.so.2</filename>. In this case, any
    8080      packages that are dynamically linked to <filename
    8181      class='libraryfile'>libfoo.so.1</filename> need to be recompiled to link
    8282      against <filename class='libraryfile'>libfoo.so.2</filename> in order to
    83       use the new library version. You should not remove the previous
    84       libraries unless all the dependent packages are recompiled.</para>
     83      use the new library version. You should not remove the old
     84      libraries until all the dependent packages have been recompiled.</para>
    8585      </listitem>
    8686
    8787      <listitem> <para>If a package containing a shared library is updated,
    88       and the name of library doesn't change, but the version number of the
     88      and the name of the library doesn't change, but the version number of the
    8989      library <emphasis role="bold">file</emphasis> decreases (for example,
    90       the name of the library is kept named
     90      the library is still named
    9191      <filename class='libraryfile'>libfoo.so.1</filename>,
    92       but the name of library file is changed from
     92      but the name of the library file is changed from
    9393      <filename class='libraryfile'>libfoo.so.1.25</filename> to
    9494      <filename class='libraryfile'>libfoo.so.1.24</filename>),
    9595      you should remove the library file from the previously installed version
    96       (<filename class='libraryfile'>libfoo.so.1.25</filename> in the case).
    97       Or, a <command>ldconfig</command> run (by yourself using a command
     96      (<filename class='libraryfile'>libfoo.so.1.25</filename> in this case).
     97      Otherwise, a <command>ldconfig</command> command (invokeed by yourself from the command
    9898      line, or by the installation of some package) will reset the symlink
    9999      <filename class='libraryfile'>libfoo.so.1</filename> to point to
    100       the old library file because it seems having a <quote>newer</quote>
    101       version, as its version number is larger.  This situation may happen if
    102       you have to downgrade a package, or the package changes the versioning
    103       scheme of library files suddenly.</para> </listitem>
     100      the old library file because it seems to be a <quote>newer</quote>
     101      version; its version number is larger.  This situation may arise if
     102      you have to downgrade a package, or if the authors change the versioning
     103      scheme for library files.</para> </listitem>
    104104
    105105      <listitem><para>If a package containing a shared library is updated,
    106       and the name of library doesn't change, but a severe issue
     106      and the name of the library doesn't change, but a severe issue
    107107      (especially, a security vulnerability) is fixed, all running programs
    108108      linked to the shared library should be restarted.  The following
    109109      command, run as <systemitem class="username">root</systemitem> after
    110       updating, will list what is using the old versions of those libraries
     110      the update is cmplete, will list which processes are using the old versions of those libraries
    111111      (replace <replaceable>libfoo</replaceable> with the name of the
    112112      library):</para>
     
    116116
    117117      <para>
    118         If <application>OpenSSH</application> is being used for accessing
    119         the system and it is linked to the updated library, you need to
    120         restart <command>sshd</command> service, then logout, login again,
    121         and rerun that command to confirm nothing is still using the
     118        If <application>OpenSSH</application> is being used to access
     119        the system and it is linked to the updated library, you must
     120        restart the <command>sshd</command> service, then logout, login again,
     121        and rerun the preceding ps command to confirm that nothing is still using the
    122122        deleted libraries.
    123123      </para>
     
    125125      <para revision='systemd'>
    126126        If the <command>systemd</command> daemon (running as PID 1) is
    127         linked to the updated library, you can restart it without reboot
     127        linked to the updated library, you can restart it without rebooting
    128128        by running <command>systemctl daemon-reexec</command> as the
    129129        <systemitem class='username'>root</systemitem> user.
     
    131131
    132132      <listitem>
    133         <para>If a binary or a shared library is overwritten, the processes
    134         using the code or data in the binary or library may crash.  The
    135         correct way to update a binary or a shared library without causing
     133        <para>If an executable program or a shared library is overwritten, the processes
     134        using the code or data in that program or library may crash.  The
     135        correct way to update a program or a shared library without causing
    136136        the process to crash is to remove it first, then install the new
    137         version into position. The <command>install</command> command
    138         provided by <application>Coreutils</application> has already
    139         implemented this and most packages use it to install binaries and
     137        version. The <command>install</command> command
     138        provided by <application>coreutils</application> has already
     139        implemented this, and most packages use that command to install binary files and
    140140        libraries.  This means that you won't be troubled by this issue most of the time.
    141141        However, the install process of some packages (notably Mozilla JS
    142         in BLFS) just overwrites the file if it exists and causes a crash, so
     142        in BLFS) just overwrites the file if it exists; this causes a crash. So
    143143        it's safer to save your work and close unneeded running processes
    144         before updating a package.</para>
     144        before updating a package.</para> <!-- binary is an adjective, not a noun. -->
    145145      </listitem>
    146146    </itemizedlist>
     
    153153    <para>The following are some common package management techniques. Before
    154154    making a decision on a package manager, do some research on the various
    155     techniques, particularly the drawbacks of the particular scheme.</para>
     155    techniques, particularly the drawbacks of each particular scheme.</para>
    156156
    157157    <sect3>
    158158      <title>It is All in My Head!</title>
    159159
    160       <para>Yes, this is a package management technique. Some folks do not find
    161       the need for a package manager because they know the packages intimately
    162       and know what files are installed by each package. Some users also do not
     160      <para>Yes, this is a package management technique. Some folks do not
     161      need a package manager because they know the packages intimately
     162      and know which files are installed by each package. Some users also do not
    163163      need any package management because they plan on rebuilding the entire
    164       system when a package is changed.</para>
     164      system whenever a package is changed.</para>
    165165
    166166    </sect3>
     
    169169      <title>Install in Separate Directories</title>
    170170
    171       <para>This is a simplistic package management that does not need any extra
    172       package to manage the installations. Each package is installed in a
     171      <para>This is a simplistic package management technique that does not need a
     172      special program to manage the packages. Each package is installed in a
    173173      separate directory. For example, package foo-1.1 is installed in
    174174      <filename class='directory'>/usr/pkg/foo-1.1</filename>
    175175      and a symlink is made from <filename>/usr/pkg/foo</filename> to
    176       <filename class='directory'>/usr/pkg/foo-1.1</filename>. When installing
    177       a new version foo-1.2, it is installed in
     176      <filename class='directory'>/usr/pkg/foo-1.1</filename>. When
     177      a new version foo-1.2 comes along, it is installed in
    178178      <filename class='directory'>/usr/pkg/foo-1.2</filename> and the previous
    179179      symlink is replaced by a symlink to the new version.</para>
     
    182182      <envar>LD_LIBRARY_PATH</envar>, <envar>MANPATH</envar>,
    183183      <envar>INFOPATH</envar> and <envar>CPPFLAGS</envar> need to be expanded to
    184       include <filename>/usr/pkg/foo</filename>. For more than a few packages,
     184      include <filename>/usr/pkg/foo</filename>. If you install more than a few packages,
    185185      this scheme becomes unmanageable.</para>
    186186
     
    191191
    192192      <para>This is a variation of the previous package management technique.
    193       Each package is installed similar to the previous scheme. But instead of
    194       making the symlink, each file is symlinked into the
     193      Each package is installed as in the previous scheme. But instead of
     194      making the symlink via a generic package name, each file is symlinked into the
    195195      <filename class='directory'>/usr</filename> hierarchy. This removes the
    196196      need to expand the environment variables. Though the symlinks can be
    197       created by the user to automate the creation, many package managers have
    198       been written using this approach. A few of the popular ones include Stow,
     197      created by the user, many package managers use this approach, and
     198      automate the creation of the symlinks. A few of the popular ones include Stow,
    199199      Epkg, Graft, and Depot.</para>
    200200
    201       <para>The installation needs to be faked, so that the package thinks that
     201      <para>The installation script needs to be fooled, so the package thinks
    202202      it is installed in <filename class="directory">/usr</filename> though in
    203203      reality it is installed in the
     
    217217      instead of <filename class='libraryfile'>/usr/lib/libfoo.so.1</filename>
    218218      as you would expect. The correct approach is to use the
    219       <envar>DESTDIR</envar> strategy to fake installation of the package. This
     219      <envar>DESTDIR</envar> variable to direct the installation. This
    220220      approach works as follows:</para>
    221221
     
    225225
    226226      <para>Most packages support this approach, but there are some which do not.
    227       For the non-compliant packages, you may either need to manually install the
    228       package, or you may find that it is easier to install some problematic
     227      For the non-compliant packages, you may either need to install the
     228      package manually, or you may find that it is easier to install some problematic
    229229      packages into <filename class='directory'>/opt</filename>.</para>
    230230
     
    238238      <command>find</command> command with the appropriate options can generate
    239239      a log of all the files installed after the timestamp file was created. A
    240       package manager written with this approach is install-log.</para>
     240      package manager that uses this approach is install-log.</para>
    241241
    242242      <para>Though this scheme has the advantage of being simple, it has two
    243243      drawbacks. If, during installation, the files are installed with any
    244244      timestamp other than the current time, those files will not be tracked by
    245       the package manager. Also, this scheme can only be used when one package
    246       is installed at a time. The logs are not reliable if two packages are
    247       being installed on two different consoles.</para>
     245      the package manager. Also, this scheme can only be used when packages
     246      are installed one at a time. The logs are not reliable if two packages are
     247      installed simultaneously from two different consoles.</para>
    248248
    249249    </sect3>
     
    263263      executables need to be dynamically linked without the suid or sgid bit.
    264264      Preloading the library may cause some unwanted side-effects during
    265       installation. Therefore, it is advised that one performs some tests to
    266       ensure that the package manager does not break anything and logs all the
     265      installation. Therefore, it's a good idea to perform some tests to
     266      ensure that the package manager does not break anything, and that it logs all the
    267267      appropriate files.</para>
    268268
    269       <para>The second technique is to use <command>strace</command>, which
    270       logs all system calls made during the execution of the installation
     269      <para>Another technique is to use <command>strace</command>, which
     270      logs all the system calls made during the execution of the installation
    271271      scripts.</para>
    272272    </sect3>
     
    276276
    277277      <para>In this scheme, the package installation is faked into a separate
    278       tree as described in the Symlink style package management. After the
     278      tree as previously described in the symlink style package management section. After the
    279279      installation, a package archive is created using the installed files.
    280       This archive is then used to install the package either on the local
    281       machine or can even be used to install the package on other machines.</para>
     280      This archive is then used to install the package on the local
     281      machine or even on other machines.</para>
    282282
    283283      <para>This approach is used by most of the package managers found in the
     
    290290      url="&hints-root;fakeroot.txt"/>.</para>
    291291
    292       <para>Creation of package files that include dependency information is
    293       complex and is beyond the scope of LFS.</para>
    294 
    295       <para>Slackware uses a <command>tar</command> based system for package
     292      <para>The creation of package files that include dependency information is
     293      complex, and beyond the scope of LFS.</para>
     294
     295      <para>Slackware uses a <command>tar</command>-based system for package
    296296      archives.  This system purposely does not handle package dependencies
    297297      as more complex package managers do.  For details of Slackware package
     
    323323    simple as using <command>tar</command> on the LFS partition that contains
    324324    the root directory (about 250MB uncompressed for a base LFS build), copying
    325     that file via network transfer or CD-ROM to the new system and expanding
    326     it.  From that point, a few configuration files will have to be changed.
     325    that file via network transfer or CD-ROM / USB stick to the new system, and expanding
     326    it.  After that, a few configuration files will have to be changed.
    327327    Configuration files that may need to be updated include:
    328328    <filename>/etc/hosts</filename>,
     
    343343    </para>
    344344
    345     <para>A custom kernel may need to be built for the new system depending on
     345    <para>A custom kernel may be needed for the new system, depending on
    346346    differences in system hardware and the original kernel
    347347    configuration.</para>
     
    349349    <note><para>There have been some reports of issues when copying between
    350350    similar but not identical architectures. For instance, the instruction set
    351     for an Intel system is not identical with an AMD processor and later
    352     versions of some processors may have instructions that are unavailable in
     351    for an Intel system is not identical with the AMD processor's instructions, and later
     352    versions of some processors may provide instructions that are unavailable with
    353353    earlier versions.</para></note>
    354354
    355     <para>Finally the new system has to be made bootable via <xref
     355    <para>Finally, the new system has to be made bootable via <xref
    356356    linkend="ch-bootable-grub"/>.</para>
    357357
  • chapter09/systemd-custom.xml

    rf29824e rc093e6b  
    4747  </sect2>
    4848
    49   <sect2>
     49  <sect2 id='systemd-no-tmpfs'>
    5050    <title>Disabling tmpfs for /tmp</title>
    5151
  • chapter09/udev.xml

    rf29824e rc093e6b  
    9494    </sect3>
    9595
    96     <sect3>
     96    <sect3 id='ch-config-udev-device-node-creation'>
    9797      <title>Device Node Creation</title>
    9898
  • chapter10/fstab.xml

    rf29824e rc093e6b  
    3333tmpfs          /run         tmpfs    defaults            0     0
    3434devtmpfs       /dev         devtmpfs mode=0755,nosuid    0     0
     35tmpfs          /dev/shm     tmpfs    nosuid,nodev        0     0
    3536
    3637# End /etc/fstab</literal>
  • chapter10/kernel.xml

    rf29824e rc093e6b  
    118118  Graphics support ---&gt;
    119119   Frame buffer Devices ---&gt;
    120       [*] Support for frame buffer devices ----
     120      &lt;*&gt; Support for frame buffer devices ---&gt;
     121   Console display driver support ---&gt;
     122      [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE]
    121123  Generic Driver Options  ---&gt;
    122124   [ ] Support for uevent helper [CONFIG_UEVENT_HELPER]
     
    157159   Frame buffer Devices ---&gt;
    158160      &lt;*&gt; Support for frame buffer devices ---&gt;
     161   Console display driver support ---&gt;
     162      [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE]
    159163File systems  ---&gt;
    160164   [*] Inotify support for userspace [CONFIG_INOTIFY_USER]
     
    303307
    304308      <varlistentry>
     309        <term><parameter>Framebuffer Console support</parameter></term>
     310        <listitem>
     311          <para>This is needed to display the Linux console on a frame
     312          buffer device.  To allow the kernel to print debug messages at an
     313          early boot stage, it shouldn't be built as a kernel module
     314          unless an initramfs will be used. And, if
     315          <option>CONFIG_DRM</option> (Direct Rendering Manager) is enabled,
     316          it's likely <option>CONFIG_DRM_FBDEV_EMULATION</option> (Enable
     317          legacy fbdev support for your modesetting driver) should be
     318          enabled as well.</para>
     319        </listitem>
     320      </varlistentry>
     321
     322      <varlistentry>
    305323        <term><parameter>Support x2apic</parameter></term>
    306324        <listitem>
     
    350368
    351369    <caution>
    352       <para>If the host system has a separate /boot partition, the files copied
    353       below should go there. The easiest way to do that is to bind /boot on the
    354       host (outside chroot) to /mnt/lfs/boot before proceeding.  As the
    355       &root; user in the <emphasis>host system</emphasis>:</para>
    356 
    357 <screen role="nodump"><userinput>mount --bind /boot /mnt/lfs/boot</userinput></screen>
     370      <para>If you've decided to use a separate &boot-dir; partition for the
     371      LFS system (maybe sharing a &boot-dir; partition with the host
     372      distro) , the files copied below should go there. The easiest way to
     373      do that is to create the entry for &boot-dir; in &fstab; first (read
     374      the previous section for details), then issue the following command
     375      as the &root; user in the
     376      <emphasis>chroot environment</emphasis>:</para>
     377
     378<screen role="nodump"><userinput>mount /boot</userinput></screen>
     379
     380      <para>The path to the device node is omitted in the command because
     381      <command>mount</command> can read it from &fstab;.</para>
    358382    </caution>
    359383
  • chapter11/chapter11.xml

    rf29824e rc093e6b  
    1616  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="reboot.xml"/>
    1717  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="whatnow.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="afterlfs.xml"/>
    1819
    1920</chapter>
  • chapter11/reboot.xml

    rf29824e rc093e6b  
    1010
    1111  <title>Rebooting the System</title>
     12  <para>
     13    Now that all of the software has been installed, it is time to reboot
     14    your computer. However, there are still a few things to check.
     15    Here are some suggestions:</para>
    1216
    13   <para>Now that all of the software has been installed, it is time to reboot
    14   your computer. However, you should be aware of a few things. The system you
     17
     18<!--
     19  The system you
    1520  have created in this book is quite minimal, and most likely will not have
    1621  the functionality you would need to be able to continue forward. By installing
     
    1823  environment, you can leave yourself in a much better position to continue on
    1924  once you reboot into your new LFS installation. Here are some suggestions:</para>
    20 
     25-->
    2126  <itemizedlist>
    22 
     27<!--
    2328    <listitem><para>A text mode browser such as <ulink
    2429    url='&blfs-book;basicnet/lynx.html'>Lynx</ulink>
     
    6166    url='&blfs-book;basicnet/wpa_supplicant.html'>wpa_supplicant</ulink>.
    6267    </para></listitem>
     68-->
     69    <listitem>
     70      <para>
     71        Install any <ulink
     72        url='&blfs-book;postlfs/firmware.html'>firmware</ulink> needed if the
     73        kernel driver for your hardware requires some firmware files to function
     74        properly.
     75      </para>
     76    </listitem>
    6377
    64     <listitem><para>Install <ulink
    65     url='&blfs-book;postlfs/firmware.html'>firmwares</ulink> if the kernel
    66     driver for your hardware require some firmware to function properly.
    67     </para></listitem>
    68 
    69     <listitem><para>Finally, a review of the following configuration files
    70     is also appropriate at this point.</para>
     78    <listitem>
     79      <para>
     80        A review of the following configuration files
     81        is also appropriate at this point.
     82      </para>
    7183
    7284      <itemizedlist>
     
    8799
    88100  <para>Now that we have said that, let's move on to booting our shiny new LFS
    89   installation for the first time! First exit from the chroot environment:</para>
     101  installation for the first time! <emphasis>First exit from the chroot
     102  environment</emphasis>:</para>
    90103
    91104<screen><userinput>logout</userinput></screen>
    92 <!-- We need to show the user the details...
    93   <para>Unmount the LFS file system hierarchy:</para>
    94 
    95 <screen><userinput>umount -Rv $LFS</userinput></screen>
    96 -->
     105<!-- We need to show the user the details...-->
    97106
    98107  <para>Then unmount the virtual file systems:</para>
     
    107116  partitions before unmounting the main one, like this:</para>
    108117
    109 <screen role="nodump"><userinput>umount -v $LFS/usr
    110 umount -v $LFS/home
     118<screen role="nodump"><userinput>umount -v $LFS/home
    111119umount -v $LFS</userinput></screen>
    112120
     
    115123<screen role="nodump"><userinput>umount -v $LFS</userinput></screen>
    116124
    117   <para>Now, reboot the system with:</para>
     125  <para>Now, reboot the system.</para>
    118126
    119 <screen role="nodump"><userinput>shutdown -r now</userinput></screen>
     127<!-- Commented out because we don't have a host system requirement on
     128     its init, and different init system may recommend different commands
     129     for reboot.  -->
     130<!--<screen role="nodump"><userinput>shutdown -r now</userinput></screen>-->
    120131
    121132  <para>Assuming the GRUB boot loader was set up as outlined earlier, the menu
  • chapter11/theend.xml

    rf29824e rc093e6b  
    6161EOF</userinput></screen>
    6262
    63   <para>Be sure to put some sort of customization for the fields
    64   'DISTRIB_CODENAME' and 'VERSION_CODENAME' to make the system uniquely
    65   yours.</para>
     63  <para>Be sure to customize the fields 'DISTRIB_CODENAME' and
     64  'VERSION_CODENAME' to make the system uniquely yours.</para>
    6665
    6766</sect1>
  • chapter11/whatnow.xml

    rf29824e rc093e6b  
    99  <?dbhtml filename="whatnow.html"?>
    1010
    11   <title>What Now?</title>
     11  <title>Additional Resources</title>
    1212
    1313  <para>Thank you for reading this LFS book. We hope that you have
     
    3939
    4040        <listitem>
    41           <para><ulink url="https://seclists.org/oss-sec/">Open Source Security Mailing List</ulink></para>
     41          <para><ulink url="https://seclists.org/oss-sec/">Open Source Security
     42          Mailing List</ulink></para>
    4243
    4344          <para>This is a mailing list for discussion of security flaws,
     
    4748      </itemizedlist>
    4849    </listitem>
    49 
     50<!--
    5051    <listitem>
    5152      <para>Beyond Linux From Scratch</para>
     
    5657      </para>
    5758    </listitem>
    58 
     59-->
    5960    <listitem>
    6061      <para>LFS Hints</para>
  • general.ent

    rf29824e rc093e6b  
    122122<!ENTITY root            "<systemitem class='username'>root</systemitem>">
    123123<!ENTITY lfs-user        "<systemitem class='username'>lfs</systemitem>">
     124<!ENTITY devtmpfs        "<systemitem class='filesystem'>devtmpfs</systemitem>">
     125<!ENTITY fstab           "<filename>/etc/fstab</filename>">
     126<!ENTITY boot-dir        "<filename class='directory'>/boot</filename>">
     127<!ENTITY ch-final        "<xref linkend='chapter-building-system'/>">
     128<!ENTITY ch-tmp-cross    "<xref linkend='chapter-temporary-tools'/>">
     129<!ENTITY ch-tmp-chroot   "<xref linkend='chapter-chroot-temporary-tools'/>">
    124130
    125131<!ENTITY % packages-entities SYSTEM "packages.ent">
  • lfs-latest-git.php

    rf29824e rc093e6b  
    3535     // Isolate the version and put in an array
    3636     $slice = preg_replace( $regex_replace, "$1", $line );
    37      if ( $slice == $line ) continue;
     37     if ( strcmp( $slice, $line ) == 0 ) continue;
    3838
    3939     array_push( $a, $slice );
     
    267267     return find_max( $lines, "/^\d/", "/^(\d[\d\.]+\d)\/.*$/" );
    268268
     269  if ( $package == "iana-etc" )
     270     return find_max( $lines, "/^\s*20\d\d/", "/^\s+(\d+).*$/" );
     271
     272  if ( $package == "meson" )
     273     return find_max( $lines, "/^\s+\d\./", "/^\s+([\d\.]+)$/" );
     274
     275  if ( $package == "shadow" )
     276     return find_max( $lines, "/^\s+\d\./", "/^\s+([\d\.]+)$/" );
     277
    269278  if ( $package == "XML-Parser" )
    270279  {
     
    292301     return str_replace( "_", ".", $max );
    293302  }
     303
     304  if ( $package == "libffi" )
     305     return find_max( $lines, "/v\d/", "/^.*v([\d\.]+)$/" );
    294306
    295307  if ( $package == "procps-ng" )
  • packages.ent

    rf29824e rc093e6b  
    4949<!ENTITY automake-fin-sbu "less than 0.1 SBU (about 7.7 SBU with tests)">
    5050
    51 <!ENTITY bash-version "5.1.16">
    52 <!ENTITY bash-size "10,277 KB">
     51<!ENTITY bash-version "5.2">
     52<!ENTITY bash-size "10,695 KB">
    5353<!ENTITY bash-url "&gnu;bash/bash-&bash-version;.tar.gz">
    54 <!ENTITY bash-md5 "c17b20a09fc38d67fb303aeb6c130b4e">
     54<!ENTITY bash-md5 "cfb4cf795fc239667f187b3d6b3d396f">
    5555<!ENTITY bash-home "&gnu-software;bash/">
    5656<!ENTITY bash-tmp-du "64 MB">
     
    5959<!ENTITY bash-fin-sbu "1.4 SBU">
    6060
    61 <!ENTITY bc-version "6.0.2">
     61<!ENTITY bc-version "6.0.4">
    6262<!ENTITY bc-size "442 KB">
    6363<!ENTITY bc-url "https://github.com/gavinhoward/bc/releases/download/&bc-version;/bc-&bc-version;.tar.xz">
    64 <!ENTITY bc-md5 "101e62dd9c2b90bf18c38d858aa36f0d">
     64<!ENTITY bc-md5 "1e1c90de1a11f3499237425de1673ef1">
    6565<!ENTITY bc-home "https://git.yzena.com/gavin/bc">
    6666<!ENTITY bc-fin-du "7.4 MB">
     
    115115<!ENTITY coreutils-fin-sbu "2.8 SBU">
    116116
    117 <!ENTITY dbus-version "1.14.0">
     117<!ENTITY dbus-version "1.14.2">
    118118<!ENTITY dbus-size "1,332 KB">
    119119<!ENTITY dbus-url "https://dbus.freedesktop.org/releases/dbus/dbus-&dbus-version;.tar.xz">
    120 <!ENTITY dbus-md5 "ddd5570aff05191dbee8e42d751f1b7d">
     120<!ENTITY dbus-md5 "2d9a6b441e6f844d41c35a004f0ef50b">
    121121<!ENTITY dbus-home "https://www.freedesktop.org/wiki/Software/dbus">
    122122<!ENTITY dbus-fin-du "19 MB">
     
    164164<!ENTITY eudev-fin-sbu "0.2 SBU">
    165165
    166 <!ENTITY expat-version "2.4.8">
    167 <!ENTITY expat-size "444 KB">
     166<!ENTITY expat-version "2.4.9">
     167<!ENTITY expat-size "449 KB">
    168168<!ENTITY expat-url "&sourceforge;expat/expat-&expat-version;.tar.xz">
    169 <!ENTITY expat-md5 "0584a7318a4c007f7ec94778799d72fe">
     169<!ENTITY expat-md5 "8d7fcf7d02d08bf79d9ae5c21cc72c03">
    170170<!ENTITY expat-home "https://libexpat.github.io/">
    171171<!ENTITY expat-fin-du "12 MB">
     
    318318<!ENTITY gzip-fin-sbu "0.3 SBU">
    319319
    320 <!ENTITY iana-etc-version "20220812">
     320<!ENTITY iana-etc-version "20220922">
    321321<!ENTITY iana-etc-size "584 KB">
    322322<!ENTITY iana-etc-url "https://github.com/Mic92/iana-etc/releases/download/&iana-etc-version;/iana-etc-&iana-etc-version;.tar.gz">
    323 <!ENTITY iana-etc-md5 "851a53efd53c77d0ad7b3d2b68d8a3fc">
     323<!ENTITY iana-etc-md5 "2fdc746cfc1bc10f841760fd6a92618c">
    324324<!ENTITY iana-etc-home "https://www.iana.org/protocols">
    325325<!ENTITY iana-etc-fin-du "4.8 MB">
     
    392392<!ENTITY less-fin-sbu "less than 0.1 SBU">
    393393
    394 <!ENTITY lfs-bootscripts-version "20220723">      <!-- Scripts depend on this format -->
     394<!ENTITY lfs-bootscripts-version "20220920">      <!-- Scripts depend on this format -->
    395395<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB">
    396396<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.xz">
     
    400400<!ENTITY lfs-bootscripts-cfg-sbu "less than 0.1 SBU">
    401401
    402 <!ENTITY libcap-version "2.65">
    403 <!ENTITY libcap-size "176 KB">
     402<!ENTITY libcap-version "2.66">
     403<!ENTITY libcap-size "178 KB">
    404404<!ENTITY libcap-url "&kernel;linux/libs/security/linux-privs/libcap2/libcap-&libcap-version;.tar.xz">
    405 <!ENTITY libcap-md5 "3543e753dd941255c4def6cc67a462bb">
     405<!ENTITY libcap-md5 "00afd6e13bc94b2543b1a70770bdb41f">
    406406<!ENTITY libcap-home "https://sites.google.com/site/fullycapable/">
    407407<!ENTITY libcap-fin-du "2.7 MB">
    408408<!ENTITY libcap-fin-sbu "less than 0.1 SBU">
    409409
    410 <!ENTITY libffi-version "3.4.2">
    411 <!ENTITY libffi-size "1,320 KB">
     410<!ENTITY libffi-version "3.4.3">
     411<!ENTITY libffi-size "1,327 KB">
    412412<!ENTITY libffi-url "https://github.com/libffi/libffi/releases/download/v&libffi-version;/libffi-&libffi-version;.tar.gz">
    413 <!ENTITY libffi-md5 "294b921e6cf9ab0fbaea4b639f8fdbe8">
     413<!ENTITY libffi-md5 "b57b0ac1d1072681cee9148a417bd2ec">
    414414<!ENTITY libffi-home "https://sourceware.org/libffi/">
    415415<!ENTITY libffi-fin-du "10 MB">
     
    434434<!ENTITY linux-major-version "5">
    435435<!ENTITY linux-minor-version "19">
    436 <!ENTITY linux-patch-version "8">
     436<!ENTITY linux-patch-version "12">
    437437<!--<!ENTITY linux-version "&linux-major-version;.&linux-minor-version;">-->
    438438<!ENTITY linux-version "&linux-major-version;.&linux-minor-version;.&linux-patch-version;">
    439 <!ENTITY linux-size "128,547 KB">
     439<!ENTITY linux-size "128,599 KB">
    440440<!ENTITY linux-url "&kernel;linux/kernel/v&linux-major-version;.x/linux-&linux-version;.tar.xz">
    441 <!ENTITY linux-md5 "ae08d14f9b7ed3d47c0d22b6d235507a">
     441<!ENTITY linux-md5 "6a8c953d04986027b033bc92185745bf">
    442442<!ENTITY linux-home "https://www.kernel.org/">
    443443<!-- measured for 5.13.4 / gcc-11.1.0 on x86_64 : minimum is
     
    612612<!ENTITY python-docs-size "7,176 KB">
    613613
    614 <!ENTITY readline-version "8.1.2">
    615 <!ENTITY readline-soversion "8.1"><!-- used for stripping -->
    616 <!ENTITY readline-size "2,923 KB">
     614<!ENTITY readline-version "8.2">
     615<!ENTITY readline-soversion "8.2"><!-- used for stripping -->
     616<!ENTITY readline-size "2,973 KB">
    617617<!ENTITY readline-url "&gnu;readline/readline-&readline-version;.tar.gz">
    618 <!ENTITY readline-md5 "12819fa739a78a6172400f399ab34f81">
     618<!ENTITY readline-md5 "4aa1b31be779e6b84f9a96cb66bc50f6">
    619619<!ENTITY readline-home "https://tiswww.case.edu/php/chet/readline/rltop.html">
    620620<!ENTITY readline-fin-du "15 MB">
     
    704704<!ENTITY texinfo-fin-sbu "0.6 SBU">
    705705
    706 <!ENTITY tzdata-version "2022c">
    707 <!ENTITY tzdata-size "423 KB">
     706<!ENTITY tzdata-version "2022d">
     707<!ENTITY tzdata-size "424 KB">
    708708<!ENTITY tzdata-url "https://www.iana.org/time-zones/repository/releases/tzdata&tzdata-version;.tar.gz">
    709 <!ENTITY tzdata-md5 "4e3b2369b68e713ba5d3f7456f20bfdb">
     709<!ENTITY tzdata-md5 "e55dbeb2121230a0ae7c58dbb47ae8c8">
    710710<!ENTITY tzdata-home "https://www.iana.org/time-zones">
    711711
  • part3intro/generalinstructions.xml

    rf29824e rc093e6b  
    1212  <title>General Compilation Instructions</title>
    1313
    14   <para>When building packages there are several assumptions made within
    15   the instructions:</para>
     14  <para>Here are some things you should know about building each package:</para>
    1615
    1716  <itemizedlist>
    1817
    1918  <listitem>
    20     <para>Several of the packages are patched before compilation, but only when
     19    <para>Several packages are patched before compilation, but only when
    2120    the patch is needed to circumvent a problem. A patch is often needed in
    22     both this and the following chapters, but sometimes in only one location.
     21    both the current and the following chapters, but sometimes, when the same package
     22    is built more than once, the patch is not needed right away.
    2323    Therefore, do not be concerned if instructions for a downloaded patch seem
    2424    to be missing.  Warning messages about <emphasis>offset</emphasis> or
    2525    <emphasis>fuzz</emphasis> may also be encountered when applying a patch. Do
    26     not worry about these warnings, as the patch was still successfully
     26    not worry about these warnings; the patch was still successfully
    2727    applied.</para>
    2828  </listitem>
    2929
    3030  <listitem>
    31     <para>During the compilation of most packages, there will be several
    32     warnings that scroll by on the screen. These are normal and can safely be
    33     ignored.  These warnings are as they appear&mdash;warnings about
     31    <para>During the compilation of most packages, some
     32    warnings will scroll by on the screen. These are normal and can safely be
     33    ignored.  These warnings are usually about
    3434    deprecated, but not invalid, use of the C or C++ syntax. C standards change
    35     fairly often, and some packages still use the older standard. This is not a
    36     problem, but does prompt the warning.</para>
     35    fairly often, and some packages have not yet been updated. This is not a
     36    serious problem, but it does cause the warnings to appear.</para>
    3737  </listitem>
    3838
     
    7070
    7171        <listitem override='bullet'><para><command>/usr/bin/yacc</command> is a
    72         symbolic link to <command>bison</command> or a small script that
     72        symbolic link to <command>bison</command>, or to a small script that
    7373        executes bison.</para></listitem>
    7474
     
    7777
    7878    <important>
    79       <para>To re-emphasize the build process:</para>
     79      <para>Here is a synopsis of the build process.</para>
    8080
    8181      <orderedlist numeration="arabic" spacing="compact">
    8282        <listitem>
    8383          <para>Place all the sources and patches in a directory that will be
    84           accessible from the chroot environment such as
     84          accessible from the chroot environment, such as
    8585          <filename class="directory">/mnt/lfs/sources/</filename>.<!-- Do
    8686          <emphasis>not</emphasis> put sources in
     
    8888        </listitem>
    8989        <listitem>
    90           <para>Change to the sources directory.</para>
     90          <para>Change to the <filename class="directory">/mnt/lfs/sources/</filename> directory.</para>
    9191        </listitem>
    9292        <listitem id='buildinstr' xreflabel='Package build instructions'>
     
    9898              <xref linkend="chapter-temporary-tools"/>, ensure you are
    9999              the <emphasis>lfs</emphasis> user when extracting the package.</para>
    100               <para>All methods to get the source code tree being built
    101               in-position, except extracting the package tarball, are not
    102               supported. Notably, using <command>cp -R</command> to copy the
     100            <para>Do not use any method except the <command>tar</command> command
     101              to extract the source code. Notably, using the <command>cp -R</command>
     102              command to copy the
    103103              source code tree somewhere else can destroy links and
    104               timestamps in the sources tree and cause building
    105               failure.</para>
     104              timestamps in the source tree, and cause the build to fail.</para>
    106105            </listitem>
    107106            <listitem>
     
    110109            </listitem>
    111110            <listitem>
    112               <para>Follow the book's instructions for building the package.</para>
     111              <para>Follow the instructions for building the package.</para>
    113112            </listitem>
    114113            <listitem>
    115               <para>Change back to the sources directory.</para>
     114              <para>Change back to the sources directory when the build is complete.</para>
    116115            </listitem>
    117116            <listitem>
  • part3intro/introduction.xml

    rf29824e rc093e6b  
    1111  <title>Introduction</title>
    1212
    13   <para>This part is divided into three stages: first building a cross
    14   compiler and its associated libraries; second, use this cross toolchain
     13  <para>This part is divided into three stages: first, building a cross
     14  compiler and its associated libraries; second, using this cross toolchain
    1515  to build several utilities in a way that isolates them from the host
    16   distribution; third, enter the chroot environment, which further improves
    17   host isolation, and build the remaining tools needed to build the final
     16  distribution; and third, entering the chroot environment (which further improves
     17  host isolation) and constructing the remaining tools needed to build the final
    1818  system.</para>
    1919
    20   <important><para>With this part begins the real work of building a new
    21   system. It requires much care in ensuring that the instructions are
    22   followed exactly as the book shows them. You should try to understand
    23   what they do, and whatever your eagerness to finish your build, you should
    24   refrain from blindly type them as shown, but rather read documentation when
     20  <important><para>This is where the real work of building a new system
     21  begins. Be very careful to follow the instructions exactly as the book
     22  shows them. You should try to understand what each command does,
     23  and no matter how eager you are to finish your build, you should
     24  refrain from blindly typing the commands as shown. Read the documentation when
    2525  there is something you do not understand. Also, keep track of your typing
    26   and of the output of commands, by sending them to a file, using the
    27   <command>tee</command> utility. This allows for better diagnosing
    28   if something gets wrong.</para></important>
     26  and of the output of commands, by using the <command>tee</command> utility
     27  to send the terminal output to a file. This makes debugging easier
     28  if something goes wrong.</para></important>
    2929
    30   <para>The next section gives a technical introduction to the build process,
    31   while the following one contains <emphasis role="strong">very
     30  <para>The next section is a technical introduction to the build process,
     31  while the following one presents <emphasis role="strong">very
    3232  important</emphasis> general instructions.</para>
    3333
  • part3intro/toolchaintechnotes.xml

    rf29824e rc093e6b  
    1212
    1313  <para>This section explains some of the rationale and technical details
    14   behind the overall build method. It is not essential to immediately
     14  behind the overall build method. Don't try to immediately
    1515  understand everything in this section. Most of this information will be
    16   clearer after performing an actual build. This section can be referred
    17   to at any time during the process.</para>
     16  clearer after performing an actual build. Come back and re-read this chapter
     17  at any time during the build process.</para>
    1818
    1919  <para>The overall goal of <xref linkend="chapter-cross-tools"/> 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
     20  linkend="chapter-temporary-tools"/> is to produce a temporary area
     21  containing a set of tools that are known to be good, and that are isolated from the host system.
     22  By using the <command>chroot</command> command, the compilations in the remaining chapters
     23  will be isolated within that environment, ensuring a clean, trouble-free
    2424  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
     25  minimize the risks for new readers, and to provide the most educational value
    2626  at the same time.</para>
    2727
    28   <para>The build process is based on the process of
     28  <para>This build process is based on
    2929  <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,
     30  to build a compiler and its associated toolchain for a machine different from
     31  the one that is used for the build. This is not strictly necessary for LFS,
    3232  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
     33  used for the build. But cross-compilation has one great advantage:
    3434  anything that is cross-compiled cannot depend on the host environment.</para>
    3535
     
    4040    <note>
    4141      <para>
    42         The LFS book is not, and does not contain a general tutorial to
    43         build a cross (or native) toolchain. Don't use the command in the
    44         book for a cross toolchain which will be used for some purpose other
     42        The LFS book is not (and does not contain) a general tutorial to
     43        build a cross (or native) toolchain. Don't use the commands in the
     44        book for a cross toolchain for some purpose other
    4545        than building LFS, unless you really understand what you are doing.
    4646      </para>
    4747    </note>
    4848
    49     <para>Cross-compilation involves some concepts that deserve a section on
    50     their own. Although this section may be omitted in a first reading,
    51     coming back to it later will be beneficial to your full understanding of
     49    <para>Cross-compilation involves some concepts that deserve a section of
     50    their own. Although this section may be omitted on a first reading,
     51    coming back to it later will help you gain a fuller understanding of
    5252    the process.</para>
    5353
    54     <para>Let us first define some terms used in this context:</para>
     54    <para>Let us first define some terms used in this context.</para>
    5555
    5656    <variablelist>
    57       <varlistentry><term>build</term><listitem>
     57      <varlistentry><term>The build</term><listitem>
    5858        <para>is the machine where we build programs. Note that this machine
    59         is referred to as the <quote>host</quote> in other
    60         sections.</para></listitem>
     59        is also referred to as the <quote>host</quote>.</para></listitem>
    6160      </varlistentry>
    6261
    63       <varlistentry><term>host</term><listitem>
     62      <varlistentry><term>The host</term><listitem>
    6463        <para>is the machine/system where the built programs will run. Note
    6564        that this use of <quote>host</quote> is not the same as in other
     
    6766      </varlistentry>
    6867
    69       <varlistentry><term>target</term><listitem>
     68      <varlistentry><term>The target</term><listitem>
    7069        <para>is only used for compilers. It is the machine the compiler
    71         produces code for. It may be different from both build and
    72         host.</para></listitem>
     70        produces code for. It may be different from both the build and
     71        the host.</para></listitem>
    7372      </varlistentry>
    7473
     
    7675
    7776    <para>As an example, let us imagine the following scenario (sometimes
    78     referred to as <quote>Canadian Cross</quote>): we may have a
     77    referred to as <quote>Canadian Cross</quote>): we have a
    7978    compiler on a slow machine only, let's call it machine A, and the compiler
    80     ccA. We may have also a fast machine (B), but with no compiler, and we may
    81     want to produce code for another slow machine (C). To build a
    82     compiler for machine C, we would have three stages:</para>
     79    ccA. We also have a fast machine (B), but no compiler for (B), and we
     80    want to produce code for a third, slow machine (C). We will build a
     81    compiler for machine C in three stages.</para>
    8382
    8483    <informaltable align="center">
     
    9695          <row>
    9796            <entry>1</entry><entry>A</entry><entry>A</entry><entry>B</entry>
    98             <entry>build cross-compiler cc1 using ccA on machine A</entry>
     97            <entry>Build cross-compiler cc1 using ccA on machine A.</entry>
    9998          </row>
    10099          <row>
    101100            <entry>2</entry><entry>A</entry><entry>B</entry><entry>C</entry>
    102             <entry>build cross-compiler cc2 using cc1 on machine A</entry>
     101            <entry>Build cross-compiler cc2 using cc1 on machine A.</entry>
    103102          </row>
    104103          <row>
    105104            <entry>3</entry><entry>B</entry><entry>C</entry><entry>C</entry>
    106             <entry>build compiler ccC using cc2 on machine B</entry>
     105            <entry>Build compiler ccC using cc2 on machine B.</entry>
    107106          </row>
    108107        </tbody>
     
    110109    </informaltable>
    111110
    112     <para>Then, all the other programs needed by machine C can be compiled
     111    <para>Then, all the programs needed by machine C can be compiled
    113112    using cc2 on the fast machine B. Note that unless B can run programs
    114     produced for C, there is no way to test the built programs until machine
    115     C itself is running. For example, for testing ccC, we may want to add a
     113    produced for C, there is no way to test the newly built programs until machine
     114    C itself is running. For example, to run a test suite on ccC, we may want to add a
    116115    fourth stage:</para>
    117116
     
    130129          <row>
    131130            <entry>4</entry><entry>C</entry><entry>C</entry><entry>C</entry>
    132             <entry>rebuild  and test ccC using itself on machine C</entry>
     131            <entry>Rebuild and test ccC using ccC on machine C.</entry>
    133132          </row>
    134133        </tbody>
     
    147146
    148147    <note>
    149       <para>Almost all the build systems use names of the form
    150       cpu-vendor-kernel-os referred to as the machine triplet. An astute
    151       reader may wonder why a <quote>triplet</quote> refers to a four component
    152       name. The reason is history: initially, three component names were enough
    153       to designate a machine unambiguously, but with new machines and systems
    154       appearing, that proved insufficient. The word <quote>triplet</quote>
    155       remained. A simple way to determine your machine triplet is to run
    156       the <command>config.guess</command>
     148      <para>All packages involved with cross compilation in the book use an
     149      autoconf-based building system.  The autoconf-based building system
     150      accepts system types in the form cpu-vendor-kernel-os,
     151      referred to as the system triplet.  Since the vendor field is mostly
     152      irrelevant, autoconf allows to omit it. An astute reader may wonder
     153      why a <quote>triplet</quote> refers to a four component name. The
     154      reason is the kernel field and the os field originiated from one
     155      <quote>system</quote> field.  Such a three-field form is still valid
     156      today for some systems, for example
     157      <literal>x86_64-unknown-freebsd</literal>.  But for other systems,
     158      two systems can share the same kernel but still be too different to
     159      use a same triplet for them.  For example, an Android running on a
     160      mobile phone is completely different from Ubuntu running on an ARM64
     161      server, despite they are running on the same type of CPU (ARM64) and
     162      using the same kernel (Linux).
     163      Without an emulation layer, you cannot run an
     164      executable for the server on the mobile phone or vice versa.  So the
     165      <quote>system</quote> field is separated into kernel and os fields to
     166      designate these systems unambiguously.  For our example, the Android
     167      system is designated <literal>aarch64-unknown-linux-android</literal>,
     168      and the Ubuntu system is designated
     169      <literal>aarch64-unknown-linux-gnu</literal>.  The word
     170      <quote>triplet</quote> remained. A simple way to determine your
     171      system triplet is to run the <command>config.guess</command>
    157172      script that comes with the source for many packages. Unpack the binutils
    158173      sources and run the script: <userinput>./config.guess</userinput> and note
    159174      the output. For example, for a 32-bit Intel processor the
    160175      output will be <emphasis>i686-pc-linux-gnu</emphasis>. On a 64-bit
    161       system it will be <emphasis>x86_64-pc-linux-gnu</emphasis>.</para>
    162 
    163       <para>Also be aware of the name of the platform's dynamic linker, often
     176      system it will be <emphasis>x86_64-pc-linux-gnu</emphasis>. On most
     177      Linux systems the even simpler <command>gcc -dumpmachine</command> command
     178      will give you similar information.</para>
     179
     180      <para>You should also be aware of the name of the platform's dynamic linker, often
    164181      referred to as the dynamic loader (not to be confused with the standard
    165182      linker <command>ld</command> that is part of binutils). The dynamic linker
    166       provided by Glibc finds and loads the shared libraries needed by a
     183      provided by package glibc finds and loads the shared libraries needed by a
    167184      program, prepares the program to run, and then runs it. The name of the
    168185      dynamic linker for a 32-bit Intel machine is <filename
    169       class="libraryfile">ld-linux.so.2</filename> and is <filename
    170       class="libraryfile">ld-linux-x86-64.so.2</filename> for 64-bit systems. A
     186      class="libraryfile">ld-linux.so.2</filename>; it's <filename
     187      class="libraryfile">ld-linux-x86-64.so.2</filename> on 64-bit systems. A
    171188      sure-fire way to determine the name of the dynamic linker is to inspect a
    172189      random binary from the host system by running: <userinput>readelf -l
    173190      &lt;name of binary&gt; | grep interpreter</userinput> and noting the
    174191      output. The authoritative reference covering all platforms is in the
    175       <filename>shlib-versions</filename> file in the root of the Glibc source
     192      <filename>shlib-versions</filename> file in the root of the glibc source
    176193      tree.</para>
    177194    </note>
     
    179196    <para>In order to fake a cross compilation in LFS, the name of the host triplet
    180197    is slightly adjusted by changing the &quot;vendor&quot; field in the
    181     <envar>LFS_TGT</envar> variable. We also use the
     198    <envar>LFS_TGT</envar> variable so it says &quot;lfs&quot;. We also use the
    182199    <parameter>--with-sysroot</parameter> option when building the cross linker and
    183200    cross compiler to tell them where to find the needed host files. This
    184201    ensures that none of the other programs built in <xref
    185202    linkend="chapter-temporary-tools"/> can link to libraries on the build
    186     machine. Only two stages are mandatory, and one more for tests:</para>
     203    machine. Only two stages are mandatory, plus one more for tests.</para>
    187204
    188205    <informaltable align="center">
     
    200217          <row>
    201218            <entry>1</entry><entry>pc</entry><entry>pc</entry><entry>lfs</entry>
    202             <entry>build cross-compiler cc1 using cc-pc on pc</entry>
     219            <entry>Build cross-compiler cc1 using cc-pc on pc.</entry>
    203220          </row>
    204221          <row>
    205222            <entry>2</entry><entry>pc</entry><entry>lfs</entry><entry>lfs</entry>
    206             <entry>build compiler cc-lfs using cc1 on pc</entry>
     223            <entry>Build compiler cc-lfs using cc1 on pc.</entry>
    207224          </row>
    208225          <row>
    209226            <entry>3</entry><entry>lfs</entry><entry>lfs</entry><entry>lfs</entry>
    210             <entry>rebuild and test cc-lfs using itself on lfs</entry>
     227            <entry>Rebuild and test cc-lfs using cc-lfs on lfs.</entry>
    211228          </row>
    212229        </tbody>
     
    214231    </informaltable>
    215232
    216     <para>In the above table, <quote>on pc</quote> means the commands are run
     233    <para>In the preceding table, <quote>on pc</quote> means the commands are run
    217234    on a machine using the already installed distribution. <quote>On
    218235    lfs</quote> means the commands are run in a chrooted environment.</para>
     
    220237    <para>Now, there is more about cross-compiling: the C language is not
    221238    just a compiler, but also defines a standard library. In this book, the
    222     GNU C library, named glibc, is used. This library must
    223     be compiled for the lfs machine, that is, using the cross compiler cc1.
     239    GNU C library, named glibc, is used (there is an alternative, &quot;musl&quot;). This library must
     240    be compiled for the LFS machine; that is, using the cross compiler cc1.
    224241    But the compiler itself uses an internal library implementing complex
    225     instructions not available in the assembler instruction set. This
    226     internal library is named libgcc, and must be linked to the glibc
     242    subroutines for functions not available in the assembler instruction set. This
     243    internal library is named libgcc, and it must be linked to the glibc
    227244    library to be fully functional! Furthermore, the standard library for
    228     C++ (libstdc++) also needs being linked to glibc. The solution to this
    229     chicken and egg problem is to first build a degraded cc1 based libgcc,
    230     lacking some functionalities such as threads and exception handling, then
    231     build glibc using this degraded compiler (glibc itself is not
    232     degraded), then build libstdc++. But this last library will lack the
    233     same functionalities as libgcc.</para>
    234 
    235     <para>This is not the end of the story: the conclusion of the preceding
     245    C++ (libstdc++) must also be linked with glibc. The solution to this
     246    chicken and egg problem is first to build a degraded cc1-based libgcc,
     247    lacking some functionalities such as threads and exception handling, and then
     248    to build glibc using this degraded compiler (glibc itself is not
     249    degraded), and also to build libstdc++. This last library will lack some of the
     250    functionality of libgcc.</para>
     251
     252    <para>This is not the end of the story: the upshot of the preceding
    236253    paragraph is that cc1 is unable to build a fully functional libstdc++, but
    237254    this is the only compiler available for building the C/C++ libraries
    238255    during stage 2! Of course, the compiler built during stage 2, cc-lfs,
    239256    would be able to build those libraries, but (1) the build system of
    240     GCC does not know that it is usable on pc, and (2) using it on pc
    241     would be at risk of linking to the pc libraries, since cc-lfs is a native
    242     compiler. So we have to build libstdc++ later, in chroot.</para>
     257    gcc does not know that it is usable on pc, and (2) using it on pc
     258    would create a risk of linking to the pc libraries, since cc-lfs is a native
     259    compiler. So we have to re-build libstdc++ later as a part of
     260    gcc stage 2.</para>
     261
     262    <para>In &ch-final; (or <quote>stage 3</quote>), all packages needed for
     263    the LFS system are built. Even if a package is already installed into
     264    the LFS system in a previous chapter, we still rebuild the package
     265    unless we are completely sure it's unnecessary.  The main reason for
     266    rebuilding these packages is to settle them down: if we reinstall a LFS
     267    package on a complete LFS system, the installed content of the package
     268    should be same as the content of the same package installed in
     269    &ch-final;.  The temporary packages installed in &ch-tmp-cross; or
     270    &ch-tmp-chroot; cannot satisify this expectation because some of them
     271    are built without optional dependencies installed, and autoconf cannot
     272    perform some feature checks in &ch-tmp-cross; because of cross
     273    compilation, causing the temporary packages to lack optional features
     274    or use suboptimal code routines. Additionally, a minor reason for
     275    rebuilding the packages is allowing to run the testsuite.</para>
    243276
    244277  </sect2>
     
    253286
    254287    <para>Binutils is installed first because the <command>configure</command>
    255     runs of both GCC and Glibc perform various feature tests on the assembler
     288    runs of both gcc and glibc perform various feature tests on the assembler
    256289    and linker to determine which software features to enable or disable. This
    257     is more important than one might first realize. An incorrectly configured
    258     GCC or Glibc can result in a subtly broken toolchain, where the impact of
     290    is more important than one might realize at first. An incorrectly configured
     291    gcc or glibc can result in a subtly broken toolchain, where the impact of
    259292    such breakage might not show up until near the end of the build of an
    260293    entire distribution. A test suite failure will usually highlight this error
     
    275308    will show all the files successfully opened during the linking.</para>
    276309
    277     <para>The next package installed is GCC. An example of what can be
     310    <para>The next package installed is gcc. An example of what can be
    278311    seen during its run of <command>configure</command> is:</para>
    279312
     
    282315
    283316    <para>This is important for the reasons mentioned above. It also
    284     demonstrates that GCC's configure script does not search the PATH
     317    demonstrates that gcc's configure script does not search the PATH
    285318    directories to find which tools to use. However, during the actual
    286319    operation of <command>gcc</command> itself, the same search paths are not
     
    296329
    297330    <para>Next installed are sanitized Linux API headers. These allow the
    298     standard C library (Glibc) to interface with features that the Linux
     331    standard C library (glibc) to interface with features that the Linux
    299332    kernel will provide.</para>
    300333
    301     <para>The next package installed is Glibc. The most important
    302     considerations for building Glibc are the compiler, binary tools, and
    303     kernel headers. The compiler is generally not an issue since Glibc will
     334    <para>The next package installed is glibc. The most important
     335    considerations for building glibc are the compiler, binary tools, and
     336    kernel headers. The compiler is generally not an issue since glibc will
    304337    always use the compiler relating to the <parameter>--host</parameter>
    305338    parameter passed to its configure script; e.g. in our case, the compiler
     
    314347    and the use of the <parameter>-nostdinc</parameter> and
    315348    <parameter>-isystem</parameter> flags to control the compiler's include
    316     search path. These items highlight an important aspect of the Glibc
     349    search path. These items highlight an important aspect of the glibc
    317350    package&mdash;it is very self-sufficient in terms of its build machinery
    318351    and generally does not rely on toolchain defaults.</para>
    319352
    320     <para>As said above, the standard C++ library is compiled next, followed in
    321     <xref linkend="chapter-temporary-tools"/> by all the programs that need
    322     themselves to be built. The install step of all those packages uses the
    323     <envar>DESTDIR</envar> variable to have the
    324     programs land into the LFS filesystem.</para>
     353    <para>As mentioned above, the standard C++ library is compiled next, followed in
     354    <xref linkend="chapter-temporary-tools"/> by other programs that need
     355    to be cross compiled for breaking circular dependencies at build time.
     356    The install step of all those packages uses the
     357    <envar>DESTDIR</envar> variable to force installation
     358    in the LFS filesystem.</para>
    325359
    326360    <para>At the end of <xref linkend="chapter-temporary-tools"/> the native
    327     lfs compiler is installed. First binutils-pass2 is built,
    328     with the same <envar>DESTDIR</envar> install as the other programs,
    329     then the second pass of GCC is constructed, omitting libstdc++
    330     and other non-important libraries.  Due to some weird logic in GCC's
     361    LFS compiler is installed. First binutils-pass2 is built,
     362    in the same <envar>DESTDIR</envar> directory as the other programs,
     363    then the second pass of gcc is constructed, omitting some
     364    non-critical libraries.  Due to some weird logic in gcc's
    331365    configure script, <envar>CC_FOR_TARGET</envar> ends up as
    332     <command>cc</command> when the host is the same as the target, but is
     366    <command>cc</command> when the host is the same as the target, but
    333367    different from the build system. This is why
    334     <parameter>CC_FOR_TARGET=$LFS_TGT-gcc</parameter> is put explicitly into
    335     the configure options.</para>
     368    <parameter>CC_FOR_TARGET=$LFS_TGT-gcc</parameter> is declared explicitly
     369    as one of the configuration options.</para>
    336370
    337371    <para>Upon entering the chroot environment in <xref
    338     linkend="chapter-chroot-temporary-tools"/>, the first task is to install
    339     libstdc++. Then temporary installations of programs needed for the proper
     372    linkend="chapter-chroot-temporary-tools"/>,
     373    the temporary installations of programs needed for the proper
    340374    operation of the toolchain are performed. From this point onwards, the
    341375    core toolchain is self-contained and self-hosted. In
Note: See TracChangeset for help on using the changeset viewer.