Subject: bin/5119: LKM's in /etc/rc break nfs mounted /usr
To: None <gnats-bugs@gnats.netbsd.org>
From: Charlie Root <root@polaris.garbled.net>
List: netbsd-bugs
Date: 03/06/1998 03:58:50
>Number:         5119
>Category:       bin
>Synopsis:       LKM's in /etc/rc break nfs mounted /usr
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar  6 03:05:00 1998
>Last-Modified:
>Originator:     Tim Rightnour
>Organization:
Tim Rightnour    -  root@garbled.net
>Release:        1.3 i386<NetBSD-current source date>
>Environment:
	
System: NetBSD polaris 1.3 NetBSD 1.3 (POLARIS) #4: Thu Mar 5 06:55:33 MST 1998 root@polaris:/usr/src/sys/arch/i386/compile/POLARIS i386


>Description:

If you have LKM=yes in /etc/rc.conf and nfs mount your /usr partition.. 
the rc file will hang your system on boot because the network has not yet 
been initialized.

# load kernel modules specified in /etc/lkm.conf if the /usr filesystem
# is already present with "/" or can be mounted now
if checkyesno lkm && [ -f /etc/rc.lkm ]; then
        mount /usr >/dev/null 2>&1
        if [ -x /usr/bin/ld ]; then
                lkmstage=BEFORENET
                . /etc/rc.lkm
        fi
fi
                        
# set hostname, turn on network

the mount of /usr tries to hit nfs.. which cannot happen because the next 
section is what initializes the network devices.

	
>How-To-Repeat:

set LKM=yes in /etc/rc.conf and mount /usr over nfs

	
>Fix:
	

workaround: set LKM=no
fix:

Have a variable like NETBEFORELKM and check that before trying to run the 
lkm stuff. I would create a diff.. but I'm not sure if this solution 
would be acceptable to everyone.  I'm assuming here that some LKM's might 
be necc. in bringing up the network.. which would complicate things much 
further in this situation.
>Audit-Trail:
>Unformatted:
Severity:	serious<[ non-critical | serious | critical ] (one line)>