Subject: bin/15236: init will only create an mfs /dev on an msdos root filesystem
To: None <>
From: None <>
List: netbsd-bugs
Date: 01/13/2002 09:40:25
>Number:         15236
>Category:       bin
>Synopsis:       init will only create an mfs /dev on an msdos root filesystem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 13 09:41:00 PST 2002
>Originator:     Gavan Fantom
>Release:        NetBSD 1.5.2 on i386
If the root filesystem is an MSDOS filesystem and /dev/console is not present, init will create an mfs on /dev and run MAKEDEV all. This functionality is also useful on other filesystems that don't support devices, such as cd9660.

The check for msdos is currently a strcmp of the filesystem name with the string "msdos". A check is also made to see whether /dev/console exists and is a device, which seems to be a sufficient check anyway.
Boot a NetBSD system from CDROM (on a cd9660 filesystem) and observe that init does not create an mfs mounted on /dev.
Ideally there would be a way to determine whether a filesystem supports devices or not. But in this case it seems like sufficient checks are already being performed without the filesystem check. So here is a patch to remove the filesystem check.

The patch looks like this, although cut&paste into a browser won't preserve tabs :(

--- init.c.orig Sun Jan 13 17:19:20 2002
+++ init.c      Sun Jan 13 17:33:09 2002
@@ -1369,13 +1369,6 @@
        pid_t pid;
        int status;
        void *ptr;
-       struct statfs sfs;
-       if (statfs("/", &sfs) == -1)
-               return;
-       if (strcmp(sfs.f_fstypename, MOUNT_MSDOS) != 0)
-               return;
        /* If we have devices, we cannot be on msdosfs */
        if (access(_PATH_CONSOLE, F_OK) != -1)