FreeBSD Bugzilla – Attachment 155531 Details for
Bug 199407
mkuzip(8) verbosity change request to help with makefs(8) filesystems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
requested enhancements to mkuzip and makefs
makefs_mkuzip.diff (text/plain), 5.20 KB, created by
Keith White
on 2015-04-13 01:43:06 UTC
(
hide
)
Description:
requested enhancements to mkuzip and makefs
Filename:
MIME Type:
Creator:
Keith White
Created:
2015-04-13 01:43:06 UTC
Size:
5.20 KB
patch
obsolete
>Index: usr.sbin/makefs/ffs.c >=================================================================== >--- usr.sbin/makefs/ffs.c (revision 281308) >+++ usr.sbin/makefs/ffs.c (working copy) >@@ -156,6 +156,7 @@ > err(1, "Allocating memory for ffs_options"); > > fsopts->fs_specific = ffs_opts; >+ fsopts->cluster_size = 16384; > > ffs_opts->bsize= -1; > ffs_opts->fsize= -1; >@@ -417,6 +418,7 @@ > > /* round up to the next block */ > fsopts->size = roundup(fsopts->size, ffs_opts->bsize); >+ fsopts->size = roundup(fsopts->size, fsopts->cluster_size); > > /* calculate density if necessary */ > if (ffs_opts->density == -1) >@@ -465,6 +467,8 @@ > fs->maxcontig, fs->maxbpg); > printf("\toptimization %s\n", > fs->optimization == FS_OPTSPACE ? "space" : "time"); >+ printf("\tmkuzip cluster_size %d\n", >+ f->cluster_size); > } > > >Index: usr.sbin/makefs/makefs.8 >=================================================================== >--- usr.sbin/makefs/makefs.8 (revision 281308) >+++ usr.sbin/makefs/makefs.8 (working copy) >@@ -46,6 +46,7 @@ > .Op Fl DxZ > .Op Fl B Ar byte-order > .Op Fl b Ar free-blocks >+.Op Fl c Ar cluster-size > .Op Fl d Ar debug-mask > .Op Fl F Ar specfile > .Op Fl f Ar free-files >@@ -106,6 +107,8 @@ > suffix may be provided to indicate that > .Ar free-blocks > indicates a percentage of the calculated image size. >+.It Fl c Ar cluster-size >+The intended mkuzip(8) cluster_size. > .It Fl D > Treat duplicate paths in an mtree manifest as warnings not error. > .It Fl d Ar debug-mask >@@ -356,7 +359,8 @@ > .Sh SEE ALSO > .Xr mtree 5 , > .Xr mtree 8 , >-.Xr newfs 8 >+.Xr newfs 8 , >+.Xr mkuzip 8 > .Sh HISTORY > The > .Nm >Index: usr.sbin/makefs/makefs.c >=================================================================== >--- usr.sbin/makefs/makefs.c (revision 281308) >+++ usr.sbin/makefs/makefs.c (working copy) >@@ -113,7 +113,7 @@ > start_time.tv_sec = start.tv_sec; > start_time.tv_nsec = start.tv_usec * 1000; > >- while ((ch = getopt(argc, argv, "B:b:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { >+ while ((ch = getopt(argc, argv, "B:b:c:Dd:f:F:M:m:N:o:ps:S:t:xZ")) != -1) { > switch (ch) { > > case 'B': >@@ -149,6 +149,10 @@ > } > break; > >+ case 'c': >+ fsoptions.cluster_size = strtoll(optarg, NULL, 0); >+ break; >+ > case 'D': > dupsok = 1; > break; >@@ -361,6 +365,7 @@ > "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" > "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" > "\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-xZ]\n" >+"\t[-c mkuzip_cluster_size]\n" > "\t[-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", > prog); > exit(1); >Index: usr.sbin/makefs/makefs.h >=================================================================== >--- usr.sbin/makefs/makefs.h (revision 281308) >+++ usr.sbin/makefs/makefs.h (working copy) >@@ -130,6 +130,7 @@ > int needswap; /* non-zero if byte swapping needed */ > int sectorsize; /* sector size */ > int sparse; /* sparse image, don't fill it with zeros */ >+ int cluster_size; /* mkuzip(8) cluster_size */ > > void *fs_specific; /* File system specific additions. */ > } fsinfo_t; >Index: usr.bin/mkuzip/mkuzip.8 >=================================================================== >--- usr.bin/mkuzip/mkuzip.8 (revision 281308) >+++ usr.bin/mkuzip/mkuzip.8 (working copy) >@@ -60,7 +60,7 @@ > .Ar cluster_size > should be a multiple of 512 bytes. > .It Fl v >-Display verbose messages. >+Display verbose messages. Use multiple times to increase verbosity. > .El > .Sh NOTES > The compression ratio largely depends on the cluster size used. >Index: usr.bin/mkuzip/mkuzip.c >=================================================================== >--- usr.bin/mkuzip/mkuzip.c (revision 281308) >+++ usr.bin/mkuzip/mkuzip.c (working copy) >@@ -88,7 +88,7 @@ > break; > > case 'v': >- verbose = 1; >+ verbose++; > break; > > default: >@@ -147,9 +147,10 @@ > } > hdr.nblocks = sb.st_size / hdr.blksz; > if ((sb.st_size % hdr.blksz) != 0) { >- if (verbose != 0) >+ if (verbose >= 0) /* always warn */ > fprintf(stderr, "file size is not multiple " > "of %d, padding data\n", hdr.blksz); >+ fprintf(stderr, "Warning: a UFS filesystem label may not be visible via geom_label\n"); > hdr.nblocks++; > } > toc = safe_malloc((hdr.nblocks + 1) * sizeof(*toc)); >@@ -172,7 +173,7 @@ > /* Reserve space for header */ > lseek(fdw, offset, SEEK_SET); > >- if (verbose != 0) >+ if (verbose > 0) > fprintf(stderr, "data size %ju bytes, number of clusters " > "%u, index length %zu bytes\n", sb.st_size, > hdr.nblocks, iov[1].iov_len); >@@ -187,13 +188,13 @@ > "failed"); > /* Not reached */ > } >- if (verbose != 0) >+ if (verbose > 1) > fprintf(stderr, "cluster #%d, in %u bytes, " > "out %lu bytes\n", i, hdr.blksz, destlen); > } else { > destlen = DEV_BSIZE - (offset % DEV_BSIZE); > memset(obuf, 0, destlen); >- if (verbose != 0) >+ if (verbose > 0) > fprintf(stderr, "padding data with %lu bytes so " > "that file size is multiple of %d\n", destlen, > DEV_BSIZE); >@@ -207,7 +208,7 @@ > } > close(fdr); > >- if (verbose != 0) >+ if (verbose > 0) > fprintf(stderr, "compressed data to %ju bytes, saved %lld " > "bytes, %.2f%% decrease.\n", offset, (long long)(sb.st_size - offset), > 100.0 * (long long)(sb.st_size - offset) / (float)sb.st_size);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199407
: 155531 |
155637