Automatically load the vn module if it isn't already in the kernel.

This commit is contained in:
Peter Wemm 1999-01-26 04:53:09 +00:00
parent 8573fbf238
commit c2a1ba0f78
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43216

View file

@ -43,7 +43,7 @@
static char sccsid[] = "@(#)vnconfig.c 8.1 (Berkeley) 12/15/93";
#endif
static const char rcsid[] =
"$Id$";
"$Id: vnconfig.c,v 1.7 1997/10/27 07:55:31 charnier Exp $";
#endif /* not lint */
#include <err.h>
@ -55,6 +55,7 @@ static const char rcsid[] =
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/module.h>
#include <sys/stat.h>
#include <sys/vnioctl.h>
#include <ufs/ufs/ufsmount.h>
@ -169,6 +170,10 @@ main(argc, argv)
usage();
}
if (modfind("vn") < 0)
if (kldload("vn") < 0 || modfind("vn") < 0)
err(1, "cannot find or load \"vn\" kernel module");
if (flags == 0)
flags = VN_CONFIG;
if (all)