From fed2752194a9870772a2037697b56cdf39587407 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Thu, 22 Sep 1994 02:15:34 +0000 Subject: [PATCH] Automatically load filesystem if not present in system and loadable. --- sbin/mount_kernfs/mount_kernfs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sbin/mount_kernfs/mount_kernfs.c b/sbin/mount_kernfs/mount_kernfs.c index 33a6b5e12dd6..e3e2ec0079db 100644 --- a/sbin/mount_kernfs/mount_kernfs.c +++ b/sbin/mount_kernfs/mount_kernfs.c @@ -69,6 +69,7 @@ main(argc, argv) char *argv[]; { int ch, mntflags; + struct vfsconf *vfc; mntflags = 0; while ((ch = getopt(argc, argv, "o:")) != EOF) @@ -86,7 +87,16 @@ main(argc, argv) if (argc != 2) usage(); - if (mount(MOUNT_KERNFS, argv[1], mntflags, NULL)) + vfc = getvfsbyname("kernfs"); + if(!vfc && vfsisloadable("kernfs")) { + if(vfsload("kernfs")) { + err(1, "vfsload(kernfs)"); + } + endvfsent(); + vfc = getvfsbyname("kernfs"); + } + + if (mount(vfc ? vfc->vfc_index : MOUNT_KERNFS, argv[1], mntflags, NULL)) err(1, NULL); exit(0); }