Changeset c093e6b for chapter07


Ignore:
Timestamp:
10/01/2022 10:30:12 PM (21 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

Location:
chapter07
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.