diff options
author | phk <phk@FreeBSD.org> | 1994-10-12 22:04:36 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1994-10-12 22:04:36 +0000 |
commit | 2718983b3c0ca45e1f935561746c24925db4f69d (patch) | |
tree | c46dbc121b78416a2719c48ea20fbb919301a103 /sbin/newfs/newfs.c | |
parent | 5da143143431c5fc39b10c75c20e03ab613bbc74 (diff) | |
download | FreeBSD-src-2718983b3c0ca45e1f935561746c24925db4f69d.zip FreeBSD-src-2718983b3c0ca45e1f935561746c24925db4f69d.tar.gz |
Added '-F file' option of mount_mfs. This allows me to make floppy images
without waiting for my floppy-drive all the time :-) Might have other
interesting uses too.
Diffstat (limited to 'sbin/newfs/newfs.c')
-rw-r--r-- | sbin/newfs/newfs.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index c419c30..88ee073 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -180,6 +180,7 @@ int sbsize = SBSIZE; /* superblock size */ int mntflags = MNT_ASYNC; /* flags to be passed to mount */ u_long memleft; /* virtual memory available */ caddr_t membase; /* start address of memory based filesystem */ +char *filename; #ifdef COMPAT char *disktype; int unlabeled; @@ -216,7 +217,7 @@ main(argc, argv) } opstring = mfs ? - "NT:a:b:c:d:e:f:i:m:o:s:" : + "NF:T:a:b:c:d:e:f:i:m:o:s:" "NOS:T:a:b:c:d:e:f:i:k:l:m:n:o:p:r:s:t:u:x:"; while ((ch = getopt(argc, argv, opstring)) != EOF) switch (ch) { @@ -235,6 +236,9 @@ main(argc, argv) disktype = optarg; break; #endif + case 'F': + filename = optarg; + break; case 'a': if ((maxcontig = atoi(optarg)) <= 0) fatal("%s: bad maximum contiguous blocks\n", @@ -530,6 +534,9 @@ main(argc, argv) args.size = fssize * sectorsize; if (mount(MOUNT_MFS, argv[1], mntflags, &args) < 0) fatal("%s: %s", argv[1], strerror(errno)); + if(filename) { + munmap(membase,fssize * sectorsize); + } } #endif exit(0); |