1993-03-22 11:04:00 +03:00
|
|
|
#ifndef lint
|
1993-10-20 22:53:36 +03:00
|
|
|
static char rcsid[] = "$Id: mount_isofs.c,v 1.8 1993/10/20 19:53:36 cgd Exp $";
|
1993-08-02 21:48:44 +04:00
|
|
|
#endif /* not lint */
|
1993-03-22 11:04:00 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
1993-07-19 17:31:39 +04:00
|
|
|
#define ISOFS
|
1993-03-21 12:45:37 +03:00
|
|
|
#include <sys/mount.h>
|
|
|
|
|
|
|
|
void
|
|
|
|
usage ()
|
|
|
|
{
|
|
|
|
fprintf (stderr, "usage: mount_iso bdev dir\n");
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (argc, argv)
|
|
|
|
int argc;
|
|
|
|
char **argv;
|
|
|
|
{
|
|
|
|
char *dev;
|
|
|
|
char *dir;
|
1993-09-07 19:40:14 +04:00
|
|
|
struct iso_args args;
|
1993-03-21 12:45:37 +03:00
|
|
|
int c;
|
1993-10-20 22:53:36 +03:00
|
|
|
int opts = 0, mntflags = 0;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1993-07-19 17:31:39 +04:00
|
|
|
argc--;
|
|
|
|
argv++;
|
|
|
|
while (argc > 2) {
|
|
|
|
if (!strcmp("-F", argv[0])) {
|
|
|
|
argc--; argv++;
|
1993-10-20 22:53:36 +03:00
|
|
|
mntflags |= atoi(argv[0]);
|
1993-07-19 17:31:39 +04:00
|
|
|
argc--; argv++;
|
|
|
|
} else if (!strcmp(argv[0], "-norrip")) {
|
|
|
|
opts |= ISOFSMNT_NORRIP;
|
|
|
|
argc--; argv++;
|
1993-09-07 19:40:14 +04:00
|
|
|
} else if (!strcmp(argv[0], "-gen")) {
|
|
|
|
opts |= ISOFSMNT_GENS;
|
|
|
|
argc--; argv++;
|
|
|
|
} else if (!strcmp(argv[0], "-extattr")) {
|
|
|
|
opts |= ISOFSMNT_EXTATT;
|
|
|
|
argc--; argv++;
|
1993-07-19 17:31:39 +04:00
|
|
|
} else
|
|
|
|
usage();
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
|
1993-07-19 17:31:39 +04:00
|
|
|
dev = argv[0];
|
|
|
|
dir = argv[1];
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
args.fspec = dev;
|
1993-09-07 19:40:14 +04:00
|
|
|
args.flags = opts;
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1993-10-20 22:53:36 +03:00
|
|
|
if (mount (MOUNT_ISOFS, dir, mntflags, &args) < 0) {
|
1993-03-21 12:45:37 +03:00
|
|
|
perror ("mount");
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
|