Hello,

I'm both reporting a bug and submitting a patch, so hopefully it's
okay I used lfs-dev instead of the lfs-patches mail list?

If the virtual filesystems are not listed in /etc/fstab the
mountvirtfs boot script fails with the following error:

     Mounting virtual file systems: /run
 /procmount: /proc: mount failed: No such file or directory
 /sysmount: /sys: mount failed: No such file or directory
*****                                                                  [ FAIL ]
*****                                                                  [ FAIL ]
     FAILURE:

You should not be reading this error message.

It means that an unforeseen error took place in
/etc/rc.d/rcS.d/S00mountvirtfs,
which exited with a return value of 1.
If you're able to track this error down to a bug in one of
the files provided by the files provided by
the LFS book, please be so kind to inform us at
lfs-...@linuxfromscratch.org (Registration required).
*****                                                                  [ FAIL ]

Since not listing virtual filesystems in /etc/fstab is considered
acceptable (even recommended) on modern Linux installations [1][2][3],
the mountvirtfs script should correctly handle this situation.

The fix is pretty trivial: the mount commands in mountvirtfs simply
need to specify the virtual filesystem type and device.

I've attached patches for both the lfs 7.5 stable and lfs dev versions
of the bootscripts package.

Cheers,
Dylan

[1] http://askubuntu.com/questions/181429/is-a-proc-mount-necessary-in-etc-fstab
[2] https://wiki.debian.org/fstab
[3] https://wiki.archlinux.org/index.php/fstab#File_example
Submitted By: Dylan Cali <calid1984 at gmail dot com>
Date: 2014-09-06
Initial Package Version: 20130821
Upstream Status: LFS Specific
Origin: Dylan Cali
Description: Fix auto-mounting virtual filesystems when they are not
             listed in /etc/fstab

--- mountvirtfs.orig	2014-09-06 17:41:42.406926001 -0500
+++ mountvirtfs	2014-09-06 17:41:42.406926001 -0500
@@ -33,7 +33,7 @@
    start)
       # Make sure /run/var is available before logging any messages
       if ! mountpoint /run >/dev/null; then
-         mount /run || failed=1
+         mount -t tmpfs tmpfs /run || failed=1
       fi
 
       mkdir -p /run/var /run/lock /run/shm
@@ -43,12 +43,12 @@
 
       if ! mountpoint /proc >/dev/null; then
          log_info_msg2 " ${INFO}/proc"
-         mount -o nosuid,noexec,nodev /proc || failed=1
+         mount -t proc -o nosuid,noexec,nodev proc /proc || failed=1
       fi
 
       if ! mountpoint /sys >/dev/null; then
          log_info_msg2 " ${INFO}/sys" 
-         mount -o nosuid,noexec,nodev /sys || failed=1
+         mount -t sysfs -o nosuid,noexec,nodev sysfs /sys || failed=1
       fi
 
       if ! mountpoint /dev >/dev/null; then
Submitted By: Dylan Cali <calid1984 at gmail dot com>
Date: 2014-09-06
Initial Package Version: 20140815
Upstream Status: LFS Specific
Origin: Dylan Cali
Description: Fix auto-mounting virtual filesystems when they are not
             listed in /etc/fstab

--- mountvirtfs.orig	2014-09-06 17:55:15.934926001 -0500
+++ mountvirtfs	2014-09-06 17:56:25.518925999 -0500
@@ -33,7 +33,7 @@
    start)
       # Make sure /run is available before logging any messages
       if ! mountpoint /run >/dev/null; then
-         mount /run || failed=1
+         mount -t tmpfs tmpfs /run || failed=1
       fi
 
       mkdir -p /run/lock /run/shm
@@ -43,12 +43,12 @@
 
       if ! mountpoint /proc >/dev/null; then
          log_info_msg2 " ${INFO}/proc"
-         mount -o nosuid,noexec,nodev /proc || failed=1
+         mount -t proc -o nosuid,noexec,nodev proc /proc || failed=1
       fi
 
       if ! mountpoint /sys >/dev/null; then
          log_info_msg2 " ${INFO}/sys" 
-         mount -o nosuid,noexec,nodev /sys || failed=1
+         mount -t sysfs -o nosuid,noexec,nodev sysfs /sys || failed=1
       fi
 
       if ! mountpoint /dev >/dev/null; then
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to