lfs-book appears to be dead so I will hold off any more commits until
that gets sorted. Unfortunately, I already made 2 commits. The 1st was a
revert of r7484. The second, r7486, added mount --bind, consolidated the
mounting to just one place, removed all fake mounts, and cleaned up
notes about re-mounting, re-entering chroot, and backing up or reusing
/tools. Attached is the svn diff.



-- 
Archaic

Want control, education, and security from your operating system?
Hardened Linux From Scratch
http://www.linuxfromscratch.org/hlfs

M      chapter01/changelog.xml
A      chapter05/changingowner.xml
M      chapter05/chapter05.xml
M      chapter06/creatingdirs.xml
D      chapter06/devices.xml
M      chapter06/pkgmgt.xml
M      chapter06/chroot.xml
M      chapter06/introduction.xml
M      chapter06/kernfs.xml
D      chapter06/changingowner.xml
M      chapter06/chapter06.xml
M      general.ent

Index: chapter01/changelog.xml
===================================================================
--- chapter01/changelog.xml     (revision 7485)
+++ chapter01/changelog.xml     (working copy)
@@ -37,6 +37,21 @@
 -->
 
     <listitem>
+      <para>April 2, 2006</para>
+      <itemizedlist>
+        <listitem>
+          <para>[archaic] - Moved the chowning of /tools to the end of chapter 
5
+          and rewrote note about backing up or re-using /tools. Moved the
+          mounting of kernel filesystems before pkgmgt page and rewrote the 
page
+          to mount --bind /dev and mount all other kernel filesystems while
+          outside chroot. Rewrote note about re-entering chroot and remounting
+          kernel filesystems. Removed /dev from the list of dirs created in
+          chroot and added it before chroot.</para>
+        </listitem>
+      </itemizedlist>
+    </listitem>
+
+    <listitem>
       <para>March 30, 2006</para>
       <itemizedlist>
         <listitem>
Index: chapter05/changingowner.xml
===================================================================
--- chapter05/changingowner.xml (revision 0)
+++ chapter05/changingowner.xml (revision 0)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"; [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+
+<sect1 id="ch-tools-changingowner">
+  <?dbhtml filename="changingowner.html"?>
+
+  <title>Changing Ownership</title>
+
+  <note>
+    <para>The commands in the remainder of this book must be performed while
+    logged in as user <systemitem class="username">root</systemitem> and no
+    longer as user <systemitem class="username">lfs</systemitem>. Also, double
+    check that <envar>$LFS</envar> is set in <systemitem
+    class="username">root</systemitem>'s environment.</para>
+  </note>
+
+  <para>Currently, the <filename class="directory">/tools</filename> directory
+  is owned by the user <systemitem class="username">lfs</systemitem>, a user
+  that exists only on the host system. If the <filename
+  class="directory">/tools</filename> directory is kept as is, the files are
+  owned by a user ID without a corresponding account. This is dangerous because
+  a user account created later could get this same user ID and would own the
+  <filename class="directory">/tools</filename> directory and all the files
+  therein, thus exposing these files to possible malicious manipulation.</para>
+
+  <para>To avoid this issue, you could add the <systemitem
+  class="username">lfs</systemitem> user to the new LFS system later when
+  creating the <filename>/etc/passwd</filename> file, taking care to assign it
+  the same user and group IDs as on the host system. Better yet, change the
+  ownership of the <filename class="directory">/tools</filename> directory to
+  user <systemitem class="username">root</systemitem> by running the following
+  command:</para>
+
+<screen><userinput>chown -R root:root /tools</userinput></screen>
+
+  <para>Although the <filename class="directory">/tools</filename> directory 
can
+  be deleted once the LFS system has been finished, it can be retained to build
+  additional LFS systems <emphasis>of the same book version</emphasis>. How 
best
+  to backup <filename class="directory">/tools</filename> is a matter of
+  personal preference and is left as an exercise for the reader.</para>
+
+</sect1>
Index: chapter05/chapter05.xml
===================================================================
--- chapter05/chapter05.xml     (revision 7485)
+++ chapter05/chapter05.xml     (working copy)
@@ -44,5 +44,6 @@
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; 
href="util-linux.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="perl.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="stripping.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; 
href="changingowner.xml"/>
 
 </chapter>
Index: chapter06/creatingdirs.xml
===================================================================
--- chapter06/creatingdirs.xml  (revision 7485)
+++ chapter06/creatingdirs.xml  (working copy)
@@ -13,7 +13,7 @@
   <para>It is time to create some structure in the LFS file system. Create a
   standard directory tree by issuing the following commands:</para>
 
-<screen><userinput>install -dv /{bin,boot,dev,etc/opt,home,lib,mnt}
+<screen><userinput>install -dv /{bin,boot,etc/opt,home,lib,mnt}
 install -dv /{sbin,srv,usr/local,var,opt}
 install -dv /root -m 0750
 install -dv /tmp /var/tmp -m 1777
Index: chapter06/devices.xml
===================================================================
--- chapter06/devices.xml       (revision 7485)
+++ chapter06/devices.xml       (working copy)
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"; [
-  <!ENTITY % general-entities SYSTEM "../general.ent">
-  %general-entities;
-]>
-
-<sect1 id="ch-system-devices">
-  <?dbhtml filename="devices.html"?>
-
-  <title>Populating /dev</title>
-
-  <indexterm zone="ch-system-devices">
-    <primary sortas="e-/dev/">/dev/*</primary>
-  </indexterm>
-
-  <sect2>
-    <title>Creating Initial Device Nodes</title>
-
-    <para>When the kernel boots the system, it requires the presence of a few
-    device nodes, in particular the <filename 
class="devicefile">console</filename>
-    and <filename class="devicefile">null</filename> devices. The device nodes
-    will be created on the hard disk so that they are available before
-    <command>udev</command> has been started, and additionally when Linux is
-    started in single user mode (hence the restrictive permissions on
-    <filename class="devicefile">console</filename>). Create the devices by
-    running the following commands:</para>
-
-<screen><userinput>mknod -m 600 /dev/console c 5 1
-mknod -m 666 /dev/null c 1 3</userinput></screen>
-
-  </sect2>
-
-  <sect2>
-    <title>Mounting tmpfs and Populating /dev</title>
-
-    <para>The recommended method of populating the <filename
-    class="directory">/dev</filename> directory with devices is to mount a
-    virtual filesystem (such as <systemitem 
class="filesystem">tmpfs</systemitem>)
-    on the <filename class="directory">/dev</filename> directory, and allow the
-    devices to be created dynamically on that virtual filesystem as they are
-    detected or accessed. This is generally done during the boot process. Since
-    this new system has not been booted, it is necessary to do what the
-    LFS-Bootscripts package would otherwise do by mounting <filename
-    class="directory">/dev</filename>:</para>
-
-<screen><userinput>mount -nvt tmpfs none /dev</userinput></screen>
-
-    <para>The Udev package is what actually creates the devices in the 
<filename
-    class="directory">/dev</filename> directory. Since it will not be installed
-    until later on in the process, manually create the minimal set of device 
nodes
-    needed to complete the building of this system:</para>
-
-<screen><userinput>mknod -m 622 /dev/console c 5 1
-mknod -m 666 /dev/null c 1 3
-mknod -m 666 /dev/zero c 1 5
-mknod -m 666 /dev/ptmx c 5 2
-mknod -m 666 /dev/tty c 5 0
-mknod -m 444 /dev/random c 1 8
-mknod -m 444 /dev/urandom c 1 9
-chown -v root:tty /dev/{console,ptmx,tty}</userinput></screen>
-
-    <para>There are some symlinks and directories required by LFS that are
-    created during system startup by the LFS-Bootscripts package. Since this
-    is a chroot environment and not a booted environment, those symlinks and
-    directories need to be created here:</para>
-
-<screen><userinput>ln -sv /proc/self/fd /dev/fd
-ln -sv /proc/self/fd/0 /dev/stdin
-ln -sv /proc/self/fd/1 /dev/stdout
-ln -sv /proc/self/fd/2 /dev/stderr
-ln -sv /proc/kcore /dev/core
-mkdir -v /dev/pts
-mkdir -v /dev/shm</userinput></screen>
-
-    <para>Finally, mount the proper virtual (kernel) file systems on the
-    newly-created directories:</para>
-
-<screen><userinput>mount -vt devpts -o gid=4,mode=620 none /dev/pts
-mount -vt tmpfs none /dev/shm</userinput></screen>
-
-    <para>The <command>mount</command> commands executed above may result
-    in the following warning message:</para>
-
-<screen><computeroutput>can't open /etc/fstab: No such file or 
directory.</computeroutput></screen>
-
-    <para>This file&mdash;<filename>/etc/fstab</filename>&mdash;has not
-    been created yet but is also not required for the file systems to be
-    properly mounted. As such, the warning can be safely ignored.</para>
-
-  </sect2>
-
-</sect1>
Index: chapter06/pkgmgt.xml
===================================================================
--- chapter06/pkgmgt.xml        (revision 7485)
+++ chapter06/pkgmgt.xml        (working copy)
@@ -39,14 +39,6 @@
   the <ulink url="&hints-root;">Hints subproject</ulink> and see if one of them
   fits your need.</para>
 
-  <note>
-    <para>As no particular package management technique is mentioned in LFS,
-    the commands in the remainder of this book must be performed while logged 
in
-    as user <systemitem class="username">root</systemitem> and no longer as 
user
-    <systemitem class="username">lfs</systemitem>. Also, double check that
-    <envar>$LFS</envar> is set.</para>
-  </note>
-
   <sect2>
     <title>Upgrade Issues</title>
 
Index: chapter06/chroot.xml
===================================================================
--- chapter06/chroot.xml        (revision 7485)
+++ chapter06/chroot.xml        (working copy)
@@ -44,16 +44,18 @@
   reason, hashing is switched off by passing the <parameter>+h</parameter> 
option
   to <command>bash</command>.</para>
 
-  <para>It is important that all the commands throughout the remainder of this
-  chapter and the following chapters are run from within the chroot 
environment.
-  If you leave this environment for any reason (rebooting for example), 
remember
-  to first mount the <systemitem class="filesystem">proc</systemitem> and
-  <systemitem class="filesystem">devpts</systemitem> file systems (discussed
-  in the previous section) and enter chroot again before continuing with the
-  installations.</para>
-
   <para>Note that the <command>bash</command> prompt will say
   <computeroutput>I have no name!</computeroutput> This is normal because the
   <filename>/etc/passwd</filename> file has not been created yet.</para>
 
+  <note>
+    <para>It is important that all the commands throughout the remainder of 
this
+    chapter and the following chapters are run from within the chroot
+    environment. If you leave this environment for any reason (rebooting for
+    example), ensure that the virtual kernel filesystems are mounted as
+    explained in <xref linkend="ch-system-bindmount"/> and <xref
+    linkend="ch-system-kernfsmount"/> and enter chroot again before continuing
+    with the installation.</para>
+  </note>
+
 </sect1>
Index: chapter06/introduction.xml
===================================================================
--- chapter06/introduction.xml  (revision 7485)
+++ chapter06/introduction.xml  (working copy)
@@ -55,11 +55,4 @@
   there is a list of programs and libraries (along with brief descriptions of
   these) that the package installs.</para>
 
-  <note>
-    <para>At this point, you may wish to keep your finished temporary
-    tools for use in future LFS builds by creating a tarball of the
-    <filename class="directory">/tools</filename> directory and
-    storing it in a safe location.</para>
-  </note>
-
 </sect1>
Index: chapter06/kernfs.xml
===================================================================
--- chapter06/kernfs.xml        (revision 7485)
+++ chapter06/kernfs.xml        (working copy)
@@ -8,33 +8,72 @@
 <sect1 id="ch-system-kernfs">
   <?dbhtml filename="kernfs.html"?>
 
-  <title>Mounting Virtual Kernel File Systems</title>
+  <title>Preparing Virtual Kernel File Systems</title>
 
-  <para>Various file systems exported by the kernel are used to communicate to 
and
-  from the kernel itself. These file systems are virtual in that no disk space 
is
-  used for them. The content of the file systems resides in memory.</para>
+  <indexterm zone="ch-system-kernfs">
+    <primary sortas="e-/dev/">/dev/*</primary>
+  </indexterm>
 
-  <para>Begin by creating directories onto which the file systems will be
-  mounted:</para>
+    <para>Various file systems exported by the kernel are used to communicate 
to
+    and from the kernel itself. These file systems are virtual in that no disk
+    space is used for them. The content of the file systems resides in
+    memory.</para>
 
-<screen><userinput>mkdir -pv $LFS/{proc,sys}</userinput></screen>
+    <para>Begin by creating directories onto which the file systems will be
+    mounted:</para>
 
-  <para>Now mount the file systems:</para>
+<screen><userinput>mkdir -pv $LFS/{dev,proc,sys}</userinput></screen>
 
-<screen><userinput>mount -vt proc proc $LFS/proc
-mount -vt sysfs sysfs $LFS/sys</userinput></screen>
+  <sect2>
+    <title>Creating Initial Device Nodes</title>
 
-  <para>Remember that if for any reason you stop working on the LFS
-  system and start again later, it is important to check that these file
-  systems are mounted again before entering the chroot
-  environment.</para>
+    <para>When the kernel boots the system, it requires the presence of a few
+    device nodes, in particular the <filename
+    class="devicefile">console</filename> and <filename
+    class="devicefile">null</filename> devices. The device nodes will be 
created
+    on the hard disk so that they are available before <command>udev</command>
+    has been started, and additionally when Linux is started in single user 
mode
+    (hence the restrictive permissions on <filename
+    class="devicefile">console</filename>). Create the devices by running the
+    following commands:</para>
 
-  <para>Additional file systems will soon be mounted from within the
-  chroot environment. To keep the host up to date, perform a <quote>fake
-  mount</quote> for each of these now:</para>
+<screen><userinput>mknod -m 600 $LFS/dev/console c 5 1
+mknod -m 666 $LFS/dev/null c 1 3</userinput></screen>
 
-<screen><userinput>mount -vft tmpfs tmpfs $LFS/dev
-mount -vft tmpfs tmpfs $LFS/dev/shm
-mount -vft devpts -o gid=4,mode=620 devpts $LFS/dev/pts</userinput></screen>
+  </sect2>
 
+  <sect2 id="ch-system-bindmount">
+    <title>Mounting and Populating /dev</title>
+
+      <para>The recommended method of populating the <filename
+      class="directory">/dev</filename> directory with devices is to mount a
+      virtual filesystem (such as <systemitem
+      class="filesystem">tmpfs</systemitem>) on the <filename
+      class="directory">/dev</filename> directory, and allow the devices to be
+      created dynamically on that virtual filesystem as they are detected or
+      accessed. This is generally done during the boot process by Udev. Since
+      this new system does not yet have Udev and has not yet been booted, it is
+      necessary to mount and populate <filename
+      class="directory">/dev</filename> manually. This is accomplished by bind
+      mounting the host system's <filename class="directory">/dev</filename>
+      directory. A bind mount is a special type of mount that allows you to
+      create a mirror of a directory or mount point to some other location. Use
+      the following command to achieve this:</para>
+
+<screen><userinput>mount --bind /dev $LFS/dev</userinput></screen>
+
+  </sect2>
+ 
+  <sect2 id="ch-system-kernfsmount">
+    <title>Mounting Virtual Kernel File Systems</title>
+
+      <para>Now mount the remaining virtual kernel filesystems:</para>
+
+<screen><userinput>mount -vt devpts devpts $LFS/dev/pts
+mount -vt tmpfs shm $LFS/dev/shm
+mount -vt proc proc $LFS/proc
+mount -vt sysfs sysfs $LFS/sys</userinput></screen>
+
+  </sect2>
+
 </sect1>
Index: chapter06/changingowner.xml
===================================================================
--- chapter06/changingowner.xml (revision 7485)
+++ chapter06/changingowner.xml (working copy)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"; [
-  <!ENTITY % general-entities SYSTEM "../general.ent">
-  %general-entities;
-]>
-
-<sect1 id="ch-system-changingowner">
-  <?dbhtml filename="changingowner.html"?>
-
-  <title>Changing Ownership</title>
-
-  <para>Currently, the <filename class="directory">/tools</filename> directory
-  is owned by the user <systemitem class="username">lfs</systemitem>, a user
-  that exists only on the host system. Although the <filename
-  class="directory">/tools</filename> directory can be deleted once the LFS
-  system has been finished, it can be retained to build additional LFS systems.
-  If the <filename class="directory">/tools</filename> directory is kept as is,
-  the files are owned by a user ID without a corresponding account. This is
-  dangerous because a user account created later could get this same user ID
-  and would own the <filename class="directory">/tools</filename> directory
-  and all the files therein, thus exposing these files to possible malicious
-  manipulation.</para>
-
-  <para>To avoid this issue, add the <systemitem 
class="username">lfs</systemitem>
-  user to the new LFS system later when creating the
-  <filename>/etc/passwd</filename> file, taking care to assign it the same user
-  and group IDs as on the host system. Alternatively, assign the contents of
-  the <filename class="directory">/tools</filename> directory to user
-  <systemitem class="username">root</systemitem> by running the following
-  command:</para>
-
-<screen><userinput>chown -R 0:0 /tools</userinput></screen>
-
-  <para>The command uses <parameter>0:0</parameter> instead of
-  <parameter>root:root</parameter>, because <command>chown</command>
-  is unable to resolve the name <quote>root</quote> until the
-  <filename>passwd</filename> file has been created.</para>
-
-</sect1>
Index: chapter06/chapter06.xml
===================================================================
--- chapter06/chapter06.xml     (revision 7485)
+++ chapter06/chapter06.xml     (working copy)
@@ -12,14 +12,12 @@
   <title>Installing Basic System Software</title>
 
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; 
href="introduction.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="pkgmgt.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="kernfs.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="pkgmgt.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="chroot.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; 
href="changingowner.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; 
href="creatingdirs.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; 
href="createfiles.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="pwdgroup.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="devices.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; 
href="linux-libc-headers.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="man-pages.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"; href="glibc.xml"/>
Index: general.ent
===================================================================
--- general.ent (revision 7485)
+++ general.ent (working copy)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!ENTITY version "udev_update-20060330">
-<!ENTITY releasedate "March 30, 2006">
+<!ENTITY version "udev_update-20060402">
+<!ENTITY releasedate "April 2, 2006">
 <!ENTITY milestone "6.2">
 <!ENTITY generic-version "udev_update"> <!-- Use "development", "testing", or 
"x.y[-pre{x}]" -->
 
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to