When booting a diskless client through a NFS-root, the code in /usr/src/sys/nfsclient/nfs_vfsops.c fires up an interface with the data from the previous DHCP-request, so it can mount the nfs-share. When booting the same diskless client through a NFS-shared root-RAM-disk, these settings do not become applied. The functionality of /etc/rc.initdiskless is then obviously broken, because it can't get the right templates to process and can't mount anything (see diskless_remount) from a NFS-server. Fix: Maybe the code which initializes the interface with the help of the DHCP-Parameters should be issued by vfs_mountroot_try() before mounting anything else. Or one could copy the code to /dev/md/md.c and bring out a kernel-option to en/disable this code, when using a MD_ROOT.
State Changed From-To: open->suspended Mark suspended awaiting patches.
Hi, I found a workaround to simulate the behaviour of /sys/nfsclient/nfs_vfsops.c in rc.initdiskless. The patch in "diff -Naur" format is attached. with kind regards, Robert Schulze
State Changed From-To: suspended->open Patch received.
Responsible Changed From-To: freebsd-bugs->freebsd-rc
First sorry for the first "proof-of-concept"-like patch. I now appended one that does some more checking and sets nfsroot according to variables from kenv to accomplish relative paths in diskless_remount. with kind regards, Robert Schulze