Bug 14266

Summary: vfsload() looks in /lkm, not /modules
Product: Base System Reporter: Doug White <dwhite>
Component: i386Assignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   

Description Doug White freebsd_committer freebsd_triage 1999-10-11 20:40:01 UTC
In src/lib/libc/gen/getvfsent.c, the structure vfs_lkmdirs is:

static const char *vfs_lkmdirs[] = {
        "/lkm",
        "/usr/lkm",
        0,
        0
};

vfspath() uses this as the list of directories to search.  If the
user is root, the value of the environment variable LKMDIRS is appended
to the list.

Obviously, /lkm is nonexistent on 3.X and later systems.  As a result,
when mount_msdos() (or any mount_*) tries to dynamically load the 
FS module, it runs into the error.

For some reason it works as root but gives a cryptic 'No such file or
directory' error when attempting to mount as a user, regardless of
vfs.usermount sysctl.

Fix: 

Change references to 'lkm' to 'modules'.

WORKAROUND: ln -s /modules /lkm
How-To-Repeat: Mount a filesystem with an unloaded KLD module but not compiled into 
the kernel, such as msdos.
Comment 1 nrahlstr freebsd_committer freebsd_triage 2000-06-21 03:45:19 UTC
State Changed
From-To: open->closed

Peter fixed this in revision 1.14 of src/lib/libc/gen/getvfsent.c.