present; in addition, include an integrity table in the optimized WIM. If this
option is not specified, no integrity table is included in the optimized WIM,
even if there was one in the original WIM.
-.TP 6
+.TP
\fB--recompress\fR
Recompress all compressed streams in \fIWIMFILE\fR when rebuilding it. This
will increase the time needed to rebuild the WIM, unless the WIM is
a slightly worse LZX compression ratio than Microsoft's software. So, you may
not want to specify \fB--recompress\fR when optimizing a LZX-compressed WIM
created on Windows.
+.TP
+\fB--threads\fR=\fINUM_THREADS\fR
+Number of threads to use for compressing data. Default: autodetect (number of
+processors). This parameter is only meaningful when \fB--recompress\fR is also
+specified.
.SH NOTES
[OPTIMIZE] =
T(
IMAGEX_PROGNAME" optimize WIMFILE [--check] [--recompress]\n"
+" [--threads=NUM_THREADS]\n"
),
[SPLIT] =
T(
static const struct option optimize_options[] = {
{T("check"), no_argument, NULL, IMAGEX_CHECK_OPTION},
{T("recompress"), no_argument, NULL, IMAGEX_RECOMPRESS_OPTION},
+ {T("threads"), required_argument, NULL, IMAGEX_THREADS_OPTION},
{NULL, 0, NULL, 0},
};
const tchar *wimfile;
off_t old_size;
off_t new_size;
+ unsigned num_threads = 0;
for_opt(c, optimize_options) {
switch (c) {
case IMAGEX_RECOMPRESS_OPTION:
write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
break;
+ case IMAGEX_THREADS_OPTION:
+ num_threads = parse_num_threads(optarg);
+ if (num_threads == UINT_MAX)
+ return -1;
+ break;
default:
usage(OPTIMIZE);
return -1;
else
tprintf(T("%"PRIu64" KiB\n"), old_size >> 10);
- ret = wimlib_overwrite(w, write_flags, 0, imagex_progress_func);
+ ret = wimlib_overwrite(w, write_flags, num_threads,
+ imagex_progress_func);
if (ret == 0) {
new_size = file_get_size(argv[0]);