diff options
author | Garrett Wollman <wollman@FreeBSD.org> | 1994-09-22 22:17:02 +0000 |
---|---|---|
committer | Garrett Wollman <wollman@FreeBSD.org> | 1994-09-22 22:17:02 +0000 |
commit | d599144d24b887e1736c0e5470d56248bcc45160 (patch) | |
tree | eae3d93fb9be635a1496c02de15cdef92b491f86 /usr.sbin | |
parent | 42477d75d038de2ef2d8cbb77644f63f56d2076f (diff) | |
download | src-d599144d24b887e1736c0e5470d56248bcc45160.tar.gz src-d599144d24b887e1736c0e5470d56248bcc45160.zip |
Automatically load NFS and a bevy of other filesystems.
Notes
Notes:
svn path=/head/; revision=2999
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/mount_portalfs/mount_portalfs.c | 11 | ||||
-rw-r--r-- | usr.sbin/mountd/Makefile | 5 | ||||
-rw-r--r-- | usr.sbin/mountd/mountd.8 | 22 | ||||
-rw-r--r-- | usr.sbin/mountd/mountd.c | 20 | ||||
-rw-r--r-- | usr.sbin/nfsd/nfsd.8 | 18 | ||||
-rw-r--r-- | usr.sbin/nfsd/nfsd.c | 12 |
6 files changed, 80 insertions, 8 deletions
diff --git a/usr.sbin/mount_portalfs/mount_portalfs.c b/usr.sbin/mount_portalfs/mount_portalfs.c index ae5345d3049f..d88a38dcefc1 100644 --- a/usr.sbin/mount_portalfs/mount_portalfs.c +++ b/usr.sbin/mount_portalfs/mount_portalfs.c @@ -94,6 +94,7 @@ main(argc, argv) char *mountpt; int mntflags = 0; char tag[32]; + struct vfsconf *vfc; qelem q; int rc; @@ -156,7 +157,15 @@ main(argc, argv) sprintf(tag, "portal:%d", getpid()); args.pa_config = tag; - rc = mount(MOUNT_PORTAL, mountpt, mntflags, &args); + vfc = getvfsbyname("portal"); + if(!vfc && vfsisloadable("portal")) { + if(vfsload("portal")) + err(1, "vfsload(portal)"); + endvfsent(); /* flush cache */ + vfc = getvfsbyname("portal"); + } + + rc = mount(vfc ? vfc->vfc_index : MOUNT_PORTAL, mountpt, mntflags, &args); if (rc < 0) err(1, NULL); diff --git a/usr.sbin/mountd/Makefile b/usr.sbin/mountd/Makefile index 57d6b43a8c7b..f32e11b895eb 100644 --- a/usr.sbin/mountd/Makefile +++ b/usr.sbin/mountd/Makefile @@ -1,7 +1,8 @@ -# @(#)Makefile 8.3 (Berkeley) 1/25/94 +# From: @(#)Makefile 8.3 (Berkeley) 1/25/94 +# $Id$ PROG= mountd -CFLAGS+=-DNFS -DMFS -DCD9660 +CFLAGS+=-DNFS -DMFS -DCD9660 -DMSDOSFS MAN5= exports.5 netgroup.5 MAN8= mountd.8 diff --git a/usr.sbin/mountd/mountd.8 b/usr.sbin/mountd/mountd.8 index 47a6cfc5ebea..77cb9c9e4a03 100644 --- a/usr.sbin/mountd/mountd.8 +++ b/usr.sbin/mountd/mountd.8 @@ -29,9 +29,10 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)mountd.8 8.1 (Berkeley) 6/9/93 +.\" From: @(#)mountd.8 8.1 (Berkeley) 6/9/93 +.\" $Id$ .\" -.Dd June 9, 1993 +.Dd September 22, 1994 .Dt MOUNTD 8 .Os .Sh NAME @@ -81,6 +82,22 @@ After sending the SIGHUP (kill -HUP `cat /var/run/mountd.pid`), check the syslog output to see if mountd logged any parsing errors in the exports file. +.Pp +If +.Nm mountd +detects that the running kernel does not include +.Tn NFS +support, it will attempt to load a loadable kernel module containing +.Tn NFS +code, using +.Xr modload 8 +by way of +.Xr vfsload 3 . +If this fails, or no +.Tn NFS +LKM was available, +.Nm mountd +exits with an error. .Sh FILES .Bl -tag -width /var/run/mountd.pid -compact .It Pa /etc/exports @@ -91,6 +108,7 @@ the pid of the currently running mountd .Sh SEE ALSO .Xr nfsstat 1 , .Xr exports 5 , +.Xr modload 8 , .Xr nfsd 8 , .Xr portmap 8 , .Xr showmount 8 diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index e67415064a78..605e31fbcb6e 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -38,11 +38,13 @@ static char copyright[] = "@(#) Copyright (c) 1989, 1993\n\ The Regents of the University of California. All rights reserved.\n"; -#endif not lint +#endif /*not lint*/ #ifndef lint -static char sccsid[] = "@(#)mountd.c 8.8 (Berkeley) 2/20/94"; -#endif not lint +/*static char sccsid[] = "From: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/ +static const char rcsid[] = + "$Id$"; +#endif /*not lint*/ #include <sys/param.h> #include <sys/file.h> @@ -235,6 +237,18 @@ main(argc, argv) { SVCXPRT *transp; int c; + struct vfsconf *vfc; + + vfc = getvfsbyname("nfs"); + if(!vfc && vfsisloadable("nfs")) { + if(vfsload("nfs")) + err(1, "vfsload(nfs)"); + endvfsent(); /* flush cache */ + vfc = getvfsbyname("nfs"); + } + if(!vfc) { + errx(1, "NFS support is not available in the running kernel"); + } while ((c = getopt(argc, argv, "n")) != EOF) switch (c) { diff --git a/usr.sbin/nfsd/nfsd.8 b/usr.sbin/nfsd/nfsd.8 index 4ee6c4b21277..a54a5643b661 100644 --- a/usr.sbin/nfsd/nfsd.8 +++ b/usr.sbin/nfsd/nfsd.8 @@ -100,12 +100,30 @@ server specification; see .%T "Network File System Protocol Specification" , RFC1094. .Pp +If +.Nm nfsd +detects that +.Tn NFS +is not loaded in the running kernel, it will attempt +to load a loadable kernel module containing +.Tn NFS +support using +.Xr modload 8 +by way of +.Xr vfsload 3 . +If this fails, or no +.Tn NFS +LKM is available, +.Nm nfsd +will exit with an error. +.Pp The .Nm nfsd utility exits 0 on success, and >0 if an error occurs. .Sh SEE ALSO .Xr nfsstat 1 , .Xr nfssvc 2 , +.Xr modload 8 , .Xr mountd 8 , .Xr portmap 8 .Sh HISTORY diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index 8e2d14cfa750..9d4d2263d911 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -144,6 +144,18 @@ main(argc, argv, envp) int nfsdcnt, nfssvc_flag, on, reregister, sock, tcpflag, tcpsock; int tp4cnt, tp4flag, tp4sock, tpipcnt, tpipflag, tpipsock, udpflag; char *cp, **cpp; + struct vfsconf *vfc; + + vfc = getvfsbyname("nfs"); + if(!vfc && vfsisloadable("nfs")) { + if(vfsload("nfs")) + err(1, "vfsload(nfs)"); + endvfsent(); /* flush cache */ + vfc = getvfsbyname("nfs"); /* probably unnecessary */ + } + if(!vfc) { + errx(1, "NFS is not available in the running kernel"); + } /* Save start and extent of argv for setproctitle. */ Argv = argv; |