Hi All,

Attached is a small proposed addition to section 6.5 "creating dirs". I'm not sure all LFS readers can be expected to understand why the install instructions for many packages contain "mv /usr/bin/foo /bin" and similar instructions.

There is also one sentence which points out that an alternative layout is possible. Feel free to remove that if you wish (and of course to ignore the whole patch :-).

Attached diff is against svn trunk of the core LFS book as of today.

Regards,
Simon
Index: chapter06/creatingdirs.xml
===================================================================
--- chapter06/creatingdirs.xml	(revision 10943)
+++ chapter06/creatingdirs.xml	(working copy)
@@ -64,4 +64,53 @@
 
   </sect2>
 
+  <sect2>
+    <title>Directories Used for Executables and Libraries</title>
+
+    <para>Linux distributions traditionally separate executable files into
+    two categories. Those required early in system startup are placed in
+    directories <filename class="directory">/bin</filename> or
+    <filename class="directory">/sbin</filename>, and libraries needed by those
+    executable files are placed in <filename class="directory">/lib</filename>.
+    All others are placed in <filename class="directory">/usr/bin</filename> and
+    <filename class="directory">/usr/sbin</filename>, with the libraries they use
+    being placed in <filename class="directory">/usr/lib</filename>.</para>
+
+    <para>This approach allows the contents of the <filename class="directory">
+    /usr</filename> directory to be placed on its own filesystem if desired, ie
+    on a filesystem which is independent of the root filesystem. Sufficient
+    executable files remain on the root filesystem to boot the system then mount
+    the usr filesystem without any other source of data (such as an initrd). It
+    is also traditional for the <filename class="directory">/bin</filename> and 
+    <filename class="directory">/sbin</filename> directories to contain
+    executables that a system administrator can use to "rescue" a system for
+    which mounting of the root filesystem succeeds but mounting of a separate
+    usr filesystem fails.</para>
+
+    <para>The instructions in the following chapters of this book include
+    post-install steps where needed to ensure that files are placed in
+    directories in the traditional manner described above, ie software required
+    during boot or rescue is stored outside of the usr directory. The
+    <userinput>make install</userinput> step for a package almost always
+    installs files under <filename class="directory">/usr</filename>, thus
+    additional commands are sometimes needed to move files after install, and
+    to fix symbolic links referring to the old location.</para>
+
+    <para>A separate filesystem to hold the contents of the usr directory is
+    usually not necessary, and the disk partitioning instructions earlier in
+    this book do not set this up.  The LFS instructions establishes the
+    traditional separation of executables regardless of whether usr is a
+    separate filesystem or not.</para>
+
+    <para>An alternate approach (used by Fedora for example) places all
+    executables and libraries under <filename class="directory">/usr
+    </filename> with <filename class="directory">/bin</filename>, <filename
+    class="directory">/sbin</filename> and <filename class="directory">/lib
+    </filename> simply being symbolic links to corresponding directories under
+    <filename class="directory">/usr</filename>. This layout also supports a
+    separate usr filesystem if desired (but requires an initrd in that case).
+    You can find further information about this alternative by searching the
+     internet for the term "Case for the Usr Merge".</para>
+  </sect2>
+
 </sect1>
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to