diff options
author | peter <peter@FreeBSD.org> | 1996-01-01 08:37:28 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-01-01 08:37:28 +0000 |
commit | 5e9ed8caa7a5b03bf42d07867b3053f67625b4c8 (patch) | |
tree | a820cabde4e4072b691d45524cbf6497a26ee039 /sbin/newfs/newfs.c | |
parent | eee47fe2812a5b95997752afb65d1a9294b59dac (diff) | |
download | FreeBSD-src-5e9ed8caa7a5b03bf42d07867b3053f67625b4c8.zip FreeBSD-src-5e9ed8caa7a5b03bf42d07867b3053f67625b4c8.tar.gz |
Add hooks into the mount_mfs code in newfs to do the FreeBSD-style
LKM loading if it was not configured into the system.
Note that the LKM for MFS is not enabled by default, but I got it working on
my machine.. I'll see what I did..
Diffstat (limited to 'sbin/newfs/newfs.c')
-rw-r--r-- | sbin/newfs/newfs.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 2375ffb..c9f2504 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -217,6 +217,9 @@ main(argc, argv) struct statfs *mp; int fsi, fso, len, n; char *cp, *s1, *s2, *special, *opstring, buf[BUFSIZ]; +#ifdef MFS + struct vfsconf *vfc; +#endif if (progname = rindex(*argv, '/')) ++progname; @@ -549,7 +552,18 @@ main(argc, argv) args.export.ex_flags = 0; args.base = membase; args.size = fssize * sectorsize; - if (mount(MOUNT_MFS, argv[1], mntflags, &args) < 0) + + vfc = getvfsbyname("mfs"); + if(!vfc && vfsisloadable("mfs")) { + if(vfsload("mfs")) { + err(1, "vfsload(mfs)"); + } + endvfsent(); /* flush cache */ + vfc = getvfsbyname("mfs"); + } + + if (mount(vfc ? vfc->vfc_index : MOUNT_MFS, argv[1], mntflags, + &args) < 0) fatal("%s: %s", argv[1], strerror(errno)); if(filename) { munmap(membase,fssize * sectorsize); |