aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/kernfs.xml
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2012-12-28 20:29:58 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2012-12-28 20:29:58 +0000
commit409e7c850fee6ae5f46ae4ec19327e671adbc92d (patch)
tree74df4218070224de5515c41c922945097793b730 /chapter06/kernfs.xml
parent21a60f0a73343cedd0f21d27e44be645a70d7951 (diff)
Fix the location for mounting /dev/shm inside chroot
when /dev/shm is a symlink. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10083 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06/kernfs.xml')
-rw-r--r--chapter06/kernfs.xml21
1 files changed, 11 insertions, 10 deletions
diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml
index 4667d6012..51bcbe59c 100644
--- a/chapter06/kernfs.xml
+++ b/chapter06/kernfs.xml
@@ -74,16 +74,17 @@ mount -vt sysfs sysfs $LFS/sys</userinput></screen>
<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>
-
-<screen><userinput>if [ -h /dev/shm ]; then
- rm -f $LFS/dev/shm
- mkdir $LFS/dev/shm
-fi
-
-mount -vt tmpfs shm $LFS/dev/shm</userinput></screen>
+ Inside a chroot environment, this temporary file system needs
+ to be mounted separate from the host file system:</para>
+
+<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>
</sect2>