155338Spendry /*
255338Spendry * Copyright (c) 1990, 1992 Jan-Simon Pendry
366470Sbostic * Copyright (c) 1992, 1993, 1994
461507Sbostic * The Regents of the University of California. All rights reserved.
555338Spendry *
655338Spendry * This code is derived from software contributed to Berkeley by
755338Spendry * Jan-Simon Pendry.
855338Spendry *
966470Sbostic * %sccs.include.redist.c%
1055338Spendry */
1155338Spendry
1266470Sbostic #ifndef lint
1366470Sbostic char copyright[] =
1466470Sbostic "@(#) Copyright (c) 1992, 1993, 1994\n\
1566470Sbostic The Regents of the University of California. All rights reserved.\n";
1666470Sbostic #endif /* not lint */
1766470Sbostic
1866470Sbostic #ifndef lint
19*69261Smckusick static char sccsid[] = "@(#)mount_kernfs.c 8.3 (Berkeley) 05/04/95";
2066470Sbostic #endif /* not lint */
2166470Sbostic
2255338Spendry #include <sys/param.h>
2355338Spendry #include <sys/mount.h>
2455338Spendry
2566470Sbostic #include <err.h>
2655338Spendry #include <unistd.h>
2755338Spendry #include <stdio.h>
2855338Spendry #include <stdlib.h>
2955338Spendry #include <string.h>
3055338Spendry
3166470Sbostic #include "mntopts.h"
3255338Spendry
3366470Sbostic struct mntopt mopts[] = {
3466470Sbostic MOPT_STDOPTS,
3566470Sbostic { NULL }
3666470Sbostic };
3766470Sbostic
3866470Sbostic void usage __P((void));
3966470Sbostic
4055338Spendry int
main(argc,argv)4155338Spendry main(argc, argv)
4255338Spendry int argc;
4355338Spendry char *argv[];
4455338Spendry {
4555338Spendry int ch, mntflags;
4655338Spendry
4755338Spendry mntflags = 0;
4866470Sbostic while ((ch = getopt(argc, argv, "o:")) != EOF)
4966470Sbostic switch (ch) {
5066470Sbostic case 'o':
51*69261Smckusick getmntopts(optarg, mopts, &mntflags, 0);
5255338Spendry break;
5355338Spendry case '?':
5455338Spendry default:
5555338Spendry usage();
5655338Spendry }
5755338Spendry argc -= optind;
5855338Spendry argv += optind;
5955338Spendry
6055338Spendry if (argc != 2)
6155338Spendry usage();
6255338Spendry
63*69261Smckusick if (mount("kernfs", argv[1], mntflags, NULL))
6466470Sbostic err(1, NULL);
6555338Spendry exit(0);
6655338Spendry }
6755338Spendry
6855338Spendry void
usage()6955338Spendry usage()
7055338Spendry {
7155338Spendry (void)fprintf(stderr,
7266470Sbostic "usage: mount_kernfs [-o options] /kern mount_point\n");
7355338Spendry exit(1);
7455338Spendry }
75