aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2022-09-20 12:20:58 -0500
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2022-09-20 12:20:58 -0500
commit16cd09633edb80d587548ce3cd2296b4b803f210 (patch)
treea6a1c8b087bde5baeee7ad1ff0157d46697cde7d /chapter07
parentcc8e57dc7ad8dd6acc35b050fbd2a92c352bb9e8 (diff)
Adjust instructions for /dev/shm when creating virtual filesystems.
Some host create /dev/shm as a tmpfs. Some have is as a symlink to a location in another directory. This change handles both cases. The change to the sysV bootscripts now creates /dev/shm as a separate tmpfs from /run. This makes LFS sysV and systemd versions treat /dev/shm the same.
Diffstat (limited to 'chapter07')
-rw-r--r--chapter07/cleanup.xml3
-rw-r--r--chapter07/kernfs.xml7
2 files changed, 9 insertions, 1 deletions
diff --git a/chapter07/cleanup.xml b/chapter07/cleanup.xml
index 7946d84eb..d5396208c 100644
--- a/chapter07/cleanup.xml
+++ b/chapter07/cleanup.xml
@@ -95,7 +95,8 @@
<para>Before making a backup, unmount the virtual file systems:</para>
-<screen role="nodump"><userinput>umount $LFS/dev/pts
+<screen role="nodump"><userinput>[ mountpoint -q $LFS/dev/shm ] &amp;&amp; umount $LFS/dev/shm
+umount $LFS/dev/pts
umount $LFS/{sys,proc,run,dev}</userinput></screen>
<para>
diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml
index 64db54c24..c9721113d 100644
--- a/chapter07/kernfs.xml
+++ b/chapter07/kernfs.xml
@@ -89,8 +89,15 @@ mount -vt tmpfs tmpfs $LFS/run</userinput></screen>
The /run tmpfs was mounted above so in this case only a
directory needs to be created.</para>
+ <para>In other cases <filename>/dev/shm</filename> is a mountpoint
+ for a tmpfs. In that case the mount of /dev above will only create
+ /dev/shm in the chroot environment as a directory. In this situation
+ we explicitly mount a tmpfs,</para>
+
<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>