diff options
author | wollman <wollman@FreeBSD.org> | 1994-09-22 22:17:02 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-09-22 22:17:02 +0000 |
commit | eeef7952c3836dd1eb5e994695d5c745b6b51784 (patch) | |
tree | eae3d93fb9be635a1496c02de15cdef92b491f86 /usr.sbin | |
parent | d4b42cfe457790ba8db25f68e68f7c056ddc69b5 (diff) | |
download | FreeBSD-src-eeef7952c3836dd1eb5e994695d5c745b6b51784.zip FreeBSD-src-eeef7952c3836dd1eb5e994695d5c745b6b51784.tar.gz |
Automatically load NFS and a bevy of other filesystems.
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 ae5345d..d88a38d 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 57d6b43..f32e11b 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 47a6cfc..77cb9c9 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 e674150..605e31f 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 4ee6c4b..a54a564 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 8e2d14c..9d4d226 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; |