Index: chapter07/kernfs.xml
===================================================================
--- chapter07/kernfs.xml	(revision d96366111e99f76d7629dacbc27ae3a35c43c5fc)
+++ chapter07/kernfs.xml	(revision 940769457b0ae75a6a07db10534eafa3175b9018)
@@ -16,28 +16,57 @@
 
     <para>Applications running in user space utilize various file 
-    systems exported by the kernel to communicate 
+    systems created by the kernel to communicate 
     with the kernel itself. These file systems are virtual: no disk
-    space is used for them. The content of the file systems resides in
-    memory.</para>
+    space is used for them. The content of these file systems resides in
+    memory. These file systems must be mounted in the $LFS directory tree
+    so the applications can find them in the chroot environment.</para>
 
-    <para>Begin by creating directories on which the file systems will be
+    <para>Begin by creating the directories on which these virtual file systems will be
     mounted:</para>
 
-<screen><userinput>mkdir -pv /{proc,sys,run}</userinput></screen>
+<screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen>
+
+  <sect2 id="ch-tools-bindmount">
+    <title>Mounting and Populating /dev</title>
+
+      <para>During a normal boot of an LFS system, the kernel automatically
+      mounts the <systemitem class="filesystem">devtmpfs</systemitem>
+      file system on the
+      <filename class="directory">/dev</filename> directory; the kernel
+      creates device nodes on that virtual file system during the boot process,
+      or when a device is first detected or accessed. The udev daemon may
+      change the ownership or permissions of the device nodes created by the
+      kernel, and create new device nodes or symlinks, to ease the work of
+      distro maintainers and system administrators.  (See
+      <xref linkend='ch-config-udev-device-node-creation'/> for details.)
+      If the host kernel supports &devtmpfs;, we can simply mount a
+      &devtmpfs; at <filename class='directory'>$LFS/dev</filename> and rely
+      on the kernel to populate it.</para>
+
+      <para>But some host kernels lack &devtmpfs; support; these
+      host distros use different methods to create the content of
+      <filename class="directory">/dev</filename>.
+      So the only host-agnostic way to populate the
+      <filename class="directory">$LFS/dev</filename> directory is
+      by bind mounting the host system's
+      <filename class="directory">/dev</filename> directory. A bind mount is
+      a special type of mount that makes a directory subtree or a file
+      visible at some other location. Use the following
+      command to do this.</para>
+
+<screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen>
+
+  </sect2>
 
   <sect2 id="ch-tools-kernfsmount">
     <title>Mounting Virtual Kernel File Systems</title>
 
-    <para>The kernel has already mounted
-    <systemitem class="filesystem">devtmpfs</systemitem>.
-    Mount the remaining virtual kernel filesystems:</para>
+      <para>Now mount the remaining virtual kernel file systems:</para>
 
-<screen><userinput>mkdir -pv /dev/{pts,shm}
-mount -vt devpts /dev/pts /dev/pts -o gid=5,mode=620
-mount -vt proc  proc  /proc
-mount -vt sysfs sysfs /sys
-mount -vt tmpfs tmpfs /run
-mount -vt tmpfs tmpfs /dev/shm -o nosuid,nodev</userinput></screen>
-
+<screen><userinput>mount -v --bind /dev/pts $LFS/dev/pts
+mount -vt proc proc $LFS/proc
+mount -vt sysfs sysfs $LFS/sys
+mount -vt tmpfs tmpfs $LFS/run</userinput></screen>
+<!--
     <variablelist>
       <title>The meaning of the mount options for devpts:</title>
@@ -67,23 +96,20 @@
 
     </variablelist>
+-->
+      <para>In some host systems, <filename>/dev/shm</filename> is a
+      symbolic link to <filename class="directory">/run/shm</filename>.
+      The /run tmpfs was mounted above so in this case only a
+      directory needs to be created.</para>
 
-  </sect2>
+      <para>In other host systems <filename>/dev/shm</filename> is a mount point 
+      for a tmpfs. In that case the mount of /dev above will only create
+      /dev/shm as a directory in the chroot environment. In this situation
+      we must explicitly mount a tmpfs:</para>
 
-  <sect2 id="ch-tools-devadjust">
-    <title>Adjusting devtmpfs</title>
-
-    <para>Now <systemitem class='filesystem'>proc</systemitem> filesystem
-    is mounted, we can replace the device nodes for standard I/O streams
-    with symlinks to pseudo files in
-    <filename class="directory">/proc/self/fd</filename> (which are symlinks
-    to the files connected to the standard I/O streams for the current
-    process).  And, create another symlink recommended by the kernel
-    documentation.  These are necessary for I/O redirection in the building
-    system of some packages to function properly:</para>
-
-<screen><userinput>ln -sfv /proc/self/fd/0 /dev/stdin
-ln -sfv /proc/self/fd/1 /dev/stdout
-ln -sfv /proc/self/fd/2 /dev/stderr
-ln -sv  /proc/self/fd   /dev</userinput></screen>
+<screen><userinput>if [ -h $LFS/dev/shm ]; then
+  mkdir -pv $LFS/$(readlink $LFS/dev/shm)
+else
+  mount -t tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
+fi</userinput></screen>
 
   </sect2>
