freebsd-skq/sys
ian 24c5871f5a Changes to allow using BOOTP_NFSROOT and mounting an nfs root filesystem
other than the one specified by the BOOTP server.  This configures NFS
using the BOOTP protocol while also respecting other root-path options such
as setting vfs.root.mountfrom in the environment or using the RB_DFLTROOT
boot option.  It allows you to override the root path provided by the
server, or to supply a root path when the server provides IP configuration
but no root path info.

This maintains the historical BOOTP_NFSROOT behavior of panicking on a
failure to mount the root path provided by the server, unless you've
provided an alternative via the ROOTDEVNAME kernel option or by setting
vfs.root.mountfrom.  The behavior of panicking when given no other options
is preserved because it amounts to a bit of a retry loop that could
eventually recover from a transient network or server problem.

The user can now override the root path from loader(8) even if the
kernel is compiled with BOOTP_NFSROOT.  If vfs.root.mountfrom is set in
the environment it is used unconditionally -- it always overrides the
BOOTP info.  If it begins with [old]nfs: then the BOOTP code uses it
instead of the server-provided info.  If it specifies some other
filesystem then the bootp code will not panic like it used to and the code
in vfs_mountroot.c will invoke the right filesystem to do the mount.

If the kernel is compiled with the ROOTDEVNAME option, then that name is
used by the BOOTP code if either
      * The server doesn't provide a pathname.
      * The boothowto flags include RB_DFLTROOT.
The latter allows the user to compile in alternate path in ROOTDEVNAME
such as ufs:/dev/da0s1a and boot from that path by setting
boot_dftlroot=1 in loader(8) or using the '-r' option in boot(8).

The one thing not provided here is automatic failover from a
server-provided path to a compiled-in one without the user manually
requesting that.  The code just isn't currently structured in a way that
makes that possible with a lot of rewrite.  I think the ability to set
vfs.root.mountfrom and to use ROOTDEVNAME automatically when the server
doesn't provide a name covers the most common needs.

A set of patches submitted by Lars Eggert provided the part I couldn't
figure out by myself when I tried to do this last year; many thanks.

Reviewed by:	rodrigc
2013-07-31 19:14:00 +00:00
..
amd64 Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
arm Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
boot Add definitions for the Mailbox, Spinlock and PRU-ICSS devices. 2013-07-31 06:23:10 +00:00
bsm Implement chflagsat(2) system call, similar to fchmodat(2), but operates on 2013-03-21 22:59:01 +00:00
cam Add NO_RC16 quirk to make da driver avoid using READ CAPACITY(16) command 2013-07-30 13:00:09 +00:00
cddl MFV r253783: 2013-07-30 21:35:02 +00:00
compat Regenerate. 2013-07-21 19:44:53 +00:00
conf Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
contrib Realtek's RTL8712 firmware blob needed by the upcoming rsu(4) driver. 2013-07-29 06:53:42 +00:00
crypto Fix const propagation issues to make GCC happy. 2013-07-11 16:27:11 +00:00
ddb
dev Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
fs - Add const-qualifiers to the arguments of isonum_*(). 2013-07-28 12:29:10 +00:00
gdb rename scheduler->swapper and SI_SUB_RUN_SCHEDULER->SI_SUB_LAST 2013-07-24 09:45:31 +00:00
geom Introduce 3 seconds timeout on graid stop command (mostly with -f flag). 2013-07-27 15:02:19 +00:00
gnu/fs/reiserfs Garbage collect XFS bits which are now already completely disconnected 2013-03-02 15:33:54 +00:00
i386 Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
ia64 Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
isa
kern Changes to allow using BOOTP_NFSROOT and mounting an nfs root filesystem 2013-07-31 19:14:00 +00:00
kgssapi Add support for host-based (Kerberos 5 service principal) initiator 2013-07-09 01:05:28 +00:00
libkern Fix watchdog pretimeout. 2013-07-27 20:47:01 +00:00
mips Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
modules Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
net sin6 should be assigned before the loop. 2013-07-28 20:02:41 +00:00
net80211 Fix compilation when debugging is disabled. 2013-07-28 17:35:19 +00:00
netatalk Add const qualifier to the dst parameter of the ifnet if_output method. 2013-04-26 12:50:32 +00:00
netgraph Add constant for PPP-Max-PayLoad tag. 2013-07-23 10:25:34 +00:00
netinet Remove the large part of struct ipsecstat. Only few fields of this 2013-07-23 14:14:24 +00:00
netinet6 Allocate in6_ifextra (ifp->if_afdata[AF_INET6]) only for IPv6-capable 2013-07-31 16:24:49 +00:00
netipsec Remove the large part of struct ipsecstat. Only few fields of this 2013-07-23 14:14:24 +00:00
netipx
netnatm
netpfil Fix a possible NULL-pointer dereference on the pfsync(4) reconfiguration. 2013-07-29 13:17:18 +00:00
netsmb Remove a reference to LK_DRAIN now that lockmgr(9) is gone from this 2013-06-28 20:21:13 +00:00
nfs Changes to allow using BOOTP_NFSROOT and mounting an nfs root filesystem 2013-07-31 19:14:00 +00:00
nfsclient A problem with the old NFS client where large writes to large files 2013-07-04 00:54:23 +00:00
nfsserver - Convert the bufobj lock to rwlock. 2013-05-31 00:43:41 +00:00
nlm
ofed Add a missing prototype. 2013-07-29 20:48:10 +00:00
opencrypto When porting XTS-related code from OpenBSD I forgot to update copyright (only 2013-02-20 22:59:53 +00:00
pc98 Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
pci - Corrrect mispellings of word useful 2013-04-17 11:45:15 +00:00
powerpc Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
rpc Add support for host-based (Kerberos 5 service principal) initiator 2013-07-09 01:05:28 +00:00
security audit_proc_coredump: check return value of audit_new 2013-07-09 09:03:01 +00:00
sparc64 Back out r253779 & r253786. 2013-07-31 17:21:18 +00:00
sys Fix watchdog pretimeout. 2013-07-27 20:47:01 +00:00
teken
tools MFC 2013-02-21 21:59:35 +00:00
ufs Update to comments describing block allocation policy. 2013-07-14 18:44:33 +00:00
vm Unbreak sysctl ABI changes introduced in r253662 2013-07-29 18:48:51 +00:00
x86 x86: detect mwait capabilities and extensions, when present 2013-07-28 17:54:42 +00:00
xdr Use m_get() and m_getcl() instead of compat macros. 2013-03-15 10:21:18 +00:00
xen Adjust i386 Xen PV support for updated Xen interface files. 2013-06-17 01:43:07 +00:00
Makefile MFC 2013-03-13 01:05:42 +00:00