diff options
author | Martin Natano <natano@cvs.openbsd.org> | 2016-10-16 20:30:41 +0000 |
---|---|---|
committer | Martin Natano <natano@cvs.openbsd.org> | 2016-10-16 20:30:41 +0000 |
commit | d94494e075be7e85afb7cdd91ddd51082cfd7308 (patch) | |
tree | bf6c27afc95f4e7a2e4f0163c05927bcf8d9d3ad /usr.sbin/makefs | |
parent | 6a9811aac544b7814b42ab78a830649c2d9060bc (diff) |
Remove the -Z (spare ffs image) option.
Diffstat (limited to 'usr.sbin/makefs')
-rw-r--r-- | usr.sbin/makefs/ffs.c | 14 | ||||
-rw-r--r-- | usr.sbin/makefs/makefs.8 | 8 | ||||
-rw-r--r-- | usr.sbin/makefs/makefs.c | 10 | ||||
-rw-r--r-- | usr.sbin/makefs/makefs.h | 3 |
4 files changed, 8 insertions, 27 deletions
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index ffed2096a4a..0654244001e 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.c,v 1.3 2016/10/16 20:26:56 natano Exp $ */ +/* $OpenBSD: ffs.c,v 1.4 2016/10/16 20:30:40 natano Exp $ */ /* $NetBSD: ffs.c,v 1.66 2015/12/21 00:58:08 christos Exp $ */ /* @@ -481,23 +481,13 @@ ffs_create_image(const char *image, fsinfo_t *fsopts) #endif bufrem = fsopts->size; - if (fsopts->sparse) { - if (ftruncate(fsopts->fd, bufrem) == -1) { - printf ("ERROR in truncate. Sparse option disabled\n"); - fsopts->sparse = 0; - } else { - bufrem = 0; /* File truncated at bufrem. Remaining is 0 */ - buf = NULL; - } - } - if (fsopts->offset != 0) if (lseek(fsopts->fd, fsopts->offset, SEEK_SET) == -1) { warn("can't seek"); return -1; } - if ((debug & DEBUG_FS_CREATE_IMAGE) && fsopts->sparse == 0) + if ((debug & DEBUG_FS_CREATE_IMAGE)) printf( "zero-ing image `%s', %lld sectors, using %d byte chunks\n", image, (long long)bufrem, bufsize); diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index 466e216a774..7a481c3213c 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: makefs.8,v 1.2 2016/10/16 20:26:56 natano Exp $ +.\" $OpenBSD: makefs.8,v 1.3 2016/10/16 20:30:40 natano Exp $ .\" $NetBSD: makefs.8,v 1.55 2015/11/25 16:32:00 wiz Exp $ .\" .\" Copyright (c) 2001-2003 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ .Nd create a file system image from a directory tree .Sh SYNOPSIS .Nm -.Op Fl rZ +.Op Fl r .Op Fl B Ar endian .Op Fl b Ar free-blocks .Op Fl d Ar debug-mask @@ -170,10 +170,6 @@ ISO 9660 file system. .It Sy msdos FAT12, FAT16, or FAT32 file system. .El -.It Fl Z -Create a sparse file for -.Sy ffs . -This is useful for virtual machine images. .El .Pp Where sizes are specified, a decimal number of bytes is expected. diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c index 8b82447db8e..b89334a1a39 100644 --- a/usr.sbin/makefs/makefs.c +++ b/usr.sbin/makefs/makefs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makefs.c,v 1.3 2016/10/16 20:26:56 natano Exp $ */ +/* $OpenBSD: makefs.c,v 1.4 2016/10/16 20:30:40 natano Exp $ */ /* $NetBSD: makefs.c,v 1.53 2015/11/27 15:10:32 joerg Exp $ */ /* @@ -108,7 +108,7 @@ main(int argc, char *argv[]) err(1, "Unable to get system time"); - while ((ch = getopt(argc, argv, "B:b:d:f:M:m:O:o:rs:S:t:T:Z")) != -1) { + while ((ch = getopt(argc, argv, "B:b:d:f:M:m:O:o:rs:S:t:T:")) != -1) { switch (ch) { case 'B': @@ -221,10 +221,6 @@ main(int argc, char *argv[]) optarg); break; - case 'Z': - fsoptions.sparse = 1; - break; - case '?': default: usage(fstype, &fsoptions); @@ -415,7 +411,7 @@ usage(fstype_t *fstype, fsinfo_t *fsoptions) prog = getprogname(); fprintf(stderr, -"Usage: %s [-rZ] [-B endian] [-b free-blocks] [-d debug-mask]\n" +"Usage: %s [-r] [-B endian] [-b free-blocks] [-d debug-mask]\n" "\t[-f free-files] [-M minimum-size] [-m maximum-size]\n" "\t[-O offset] [-o fs-options] [-S sector-size]\n" "\t[-s image-size] [-T <timestamp/file>] [-t fs-type]" diff --git a/usr.sbin/makefs/makefs.h b/usr.sbin/makefs/makefs.h index 0cb7cc83519..26acdb8bc2e 100644 --- a/usr.sbin/makefs/makefs.h +++ b/usr.sbin/makefs/makefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: makefs.h,v 1.2 2016/10/16 20:26:56 natano Exp $ */ +/* $OpenBSD: makefs.h,v 1.3 2016/10/16 20:30:40 natano Exp $ */ /* $NetBSD: makefs.h,v 1.36 2015/11/25 00:48:49 christos Exp $ */ /* @@ -158,7 +158,6 @@ typedef struct makefs_fsinfo { int freeblockpc; /* free block % */ int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ - int sparse; /* sparse image, don't fill it with zeros */ int replace; /* replace files when merging */ void *fs_specific; /* File system specific additions. */ |