Bug 121566 - [nfs] [request] [patch] ethernet iface should be brought up when booting from a mfs_root over nfs
Summary: [nfs] [request] [patch] ethernet iface should be brought up when booting from...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-rc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-10 15:30 UTC by Robert Schulze
Modified: 2017-08-27 04:21 UTC (History)
1 user (show)

See Also:


Attachments
rc.initdiskless.patch (1.20 KB, patch)
2008-03-19 10:30 UTC, Robert Schulze
no flags Details | Diff
rc.initdiskless.patch (1.47 KB, patch)
2008-03-25 10:54 UTC, Robert Schulze
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schulze 2008-03-10 15:30:00 UTC
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2008-03-10 23:25:39 UTC
State Changed
From-To: open->suspended

Mark suspended awaiting patches.
Comment 2 Robert Schulze 2008-03-19 10:30:39 UTC
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
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2008-03-19 20:59:06 UTC
State Changed
From-To: suspended->open

Patch received. 


Comment 4 Mark Linimon freebsd_committer freebsd_triage 2008-03-19 20:59:06 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc
Comment 5 Robert Schulze 2008-03-25 10:54:38 UTC
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