summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2004-07-08 13:40:33 +0000
committerbrian <brian@FreeBSD.org>2004-07-08 13:40:33 +0000
commit2821a50eaafae3e4c7204aef9e58c6f40d221bbb (patch)
treeebac46b3b358807a8144fabd366380413a43366c /sys/nfsclient/nfs_vfsops.c
parent7c245468ef2fa07526f2540ec91012b5c7f4e9c8 (diff)
downloadFreeBSD-src-2821a50eaafae3e4c7204aef9e58c6f40d221bbb.zip
FreeBSD-src-2821a50eaafae3e4c7204aef9e58c6f40d221bbb.tar.gz
Change the following kernel options to environment variables:
BOOTP -> bootp BOOTP_NFSROOT -> bootp.nfsroot BOOTP_NFSV3 -> bootp.nfsv3 BOOTP_COMPAT -> bootp.compat BOOTP_WIRED_TO -> bootp.wired_to This lets you PXE boot with a GENERIC kernel by putting this sort of thing in loader.conf: bootp="YES" bootp.nfsroot="YES" bootp.nfsv3="YES" bootp.wired_to="bge1" or even setting the variables manually from the OK prompt.
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 9674628..ec63a7a 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -35,7 +35,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "opt_bootp.h"
#include "opt_nfsroot.h"
#include <sys/param.h>
@@ -389,16 +388,23 @@ nfs_mountroot(struct mount *mp, struct thread *td)
struct nfsv3_diskless *nd = &nfsv3_diskless;
struct socket *so;
struct vnode *vp;
+ char *cp;
int error, i;
u_long l;
char buf[128];
GIANT_REQUIRED; /* XXX until socket locking done */
-#if defined(BOOTP_NFSROOT) && defined(BOOTP)
- bootpc_init(); /* use bootp to get nfs_diskless filled in */
-#elif defined(NFS_ROOT)
- nfs_setup_diskless();
+ if ((cp = getenv("bootp")) != NULL) {
+ freeenv(cp);
+ if ((cp = getenv("bootp.nfsroot")) != NULL) {
+ freeenv(cp);
+ bootpc_init(); /* get nfs_diskless filled in */
+ }
+ }
+#if defined(NFS_ROOT)
+ if (cp == NULL)
+ nfs_setup_diskless();
#endif
if (nfs_diskless_valid == 0)
OpenPOWER on IntegriCloud