Subject: kern/9246: cannot mount NFS root over PC-Card NICs with default kernels
To: None <gnats-bugs@gnats.netbsd.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: netbsd-bugs
Date: 01/19/2000 10:37:57
>Number:         9246
>Category:       kern
>Synopsis:       cannot mount NFS root over PC-Card NICs with default kernels
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 19 10:36:00 2000
>Last-Modified:
>Originator:     
>Organization:
	Stanford DSG
>Release:        NetBSD-current supped on on 1999-12-12, also 2000-01-18
>Environment:
	
System: NetBSD Cup.DSG.Stanford.EDU 1.4.1 NetBSD 1.4.1 (GENERIC) #0: Tue Nov 9 12:18:04 PST 1999 jonathan@Cup.DSG.Stanford.EDU:/src/NetBSD/src/sys-1.4-release/src/sys/arch/i386/compile/GENERIC i386


>Description:

Kernels configured  with 

	root on ? type nfs

(e.g, built for doing installs over the network by booting a
disklessroot) cannot mount their root filesystem over network cards
attached at PCMCIA or cardbus.  The pc-card NICs are not getting
attached until after the kernel asks for its root device!

This affects i386 almost exclusively, but the relevant code is all MI,
so I'm filing it against kern rather than port-i386.

>How-To-Repeat:
	Configure a kernel as above.	
	set up a  diskless-boot server.
	Boot the kernel (e.g., rom a floppy) on a laptop.
	Try and mount root over NFS.




>Fix:

Lennart suggested a workaround of adding "flags 0x01" to the slot in
which the NIC goes.  That's not really a solution for the
diskless-install, unless diskless- install kernels are configured that
way ahead of time (mine aren't, currently, since I wasnt aware of the
issue).

What I did was boot an old sysinst install floppy, create a local disk
partition, and emulated (by hand) the old sysinst behaviour of copying
the MFS root image to that local disk.

(It's enough to wonder if we shouldn't go back to doing that, for
fresh installs; its only upgrades where it clobbered previous contents.)

I havent looked at the kernel code, but I think a real fix involves
not deferring the PC-Card attach. That may mean using a kernel thread
for the operations that would otherwise block, or checking "cold" and
using DELAY() if we're booting.
>Audit-Trail:
>Unformatted: