Author: bdubbs
Date: 2012-12-28 13:29:58 -0700 (Fri, 28 Dec 2012)
New Revision: 10083

Modified:
   trunk/BOOK/chapter01/changelog.xml
   trunk/BOOK/chapter06/kernfs.xml
   trunk/BOOK/chapter09/reboot.xml
Log:
Fix the location for mounting /dev/shm inside chroot 
when /dev/shm is a symlink.


Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml  2012-12-28 19:17:10 UTC (rev 10082)
+++ trunk/BOOK/chapter01/changelog.xml  2012-12-28 20:29:58 UTC (rev 10083)
@@ -40,6 +40,11 @@
       <para>2012-12-28</para>
       <itemizedlist>
         <listitem>
+          <para>[bdubbs] - Fix the location for mounting /dev/shm 
+          inside chroot.  Fixes
+          <ulink url="&lfs-ticket-root;3258">#3258</ulink>.</para>
+        </listitem>
+        <listitem>
           <para>[matthew] - Move the build of Procps to before E2fsprogs as the
           latter requires <command>ps</command> to be available during its
           testsuite run.</para>

Modified: trunk/BOOK/chapter06/kernfs.xml
===================================================================
--- trunk/BOOK/chapter06/kernfs.xml     2012-12-28 19:17:10 UTC (rev 10082)
+++ trunk/BOOK/chapter06/kernfs.xml     2012-12-28 20:29:58 UTC (rev 10083)
@@ -74,17 +74,18 @@
 
       <para>In some host systems, <filename>/dev/shm</filename> is a 
       symbolic link to <filename class="directory">/run/shm</filename>.
-      Inside a chroot environment, this symbolic link needs to be
-      changed to a normal directory before mounting as a temporary
-      file system:</para>
+      Inside a chroot environment, this temporary file system needs
+      to be mounted separate from the host file system:</para>
 
-<screen><userinput>if [ -h /dev/shm ]; then
-   rm -f $LFS/dev/shm
-   mkdir $LFS/dev/shm
-fi
+<screen><userinput>if [ -h $LFS/dev/shm ]; then
+  link=$(readlink $LFS/dev/shm)
+  mkdir -p $LFS/$link
+  mount -vt tmpfs shm $LFS/$link
+  unset link
+else
+  mount -vt tmpfs shm $LFS/dev/shm
+fi</userinput></screen>
 
-mount -vt tmpfs shm $LFS/dev/shm</userinput></screen>
-
   </sect2>
 
 </sect1>

Modified: trunk/BOOK/chapter09/reboot.xml
===================================================================
--- trunk/BOOK/chapter09/reboot.xml     2012-12-28 19:17:10 UTC (rev 10082)
+++ trunk/BOOK/chapter09/reboot.xml     2012-12-28 20:29:58 UTC (rev 10083)
@@ -33,7 +33,15 @@
   <para>Then unmount the virtual file systems:</para>
 
 <screen><userinput>umount -v $LFS/dev/pts
-umount -v $LFS/dev/shm
+
+if [ -h $LFS/dev/shm ]; then 
+  link=$(readlink $LFS/dev/shm)
+  umount -v $LFS/$link
+  unset link
+else
+  umount -v $LFS/dev/shm
+fi 
+
 umount -v $LFS/dev
 umount -v $LFS/proc
 umount -v $LFS/sys</userinput></screen>

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to