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
This commit is contained in:
Bruce Dubbs 2012-12-28 20:29:58 +00:00
parent 21a60f0a73
commit 409e7c850f
3 changed files with 24 additions and 10 deletions

View File

@ -39,6 +39,11 @@
<listitem>
<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

View File

@ -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>
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
mount -vt tmpfs shm $LFS/dev/shm</userinput></screen>
<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>

View File

@ -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>