From 9f4d013f39fef92d3fb733bbfa61cb5307699b21 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 24 Jun 2014 21:48:43 -0500 Subject: [PATCH 1/1] wimexport: Add --recompress option --- doc/man1/imagex-export.1.in | 4 ++++ programs/imagex.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/man1/imagex-export.1.in b/doc/man1/imagex-export.1.in index 236afeeb..73e01f63 100644 --- a/doc/man1/imagex-export.1.in +++ b/doc/man1/imagex-export.1.in @@ -79,6 +79,10 @@ and "LZX", instead of "fast" and "maximum", respectively. reduced compatibility. See the documentation for this option to \fB@IMAGEX_PROGNAME@ capture\fR (1) for more details. .TP +\fB--recompress\fR +Force all exported data to be recompressed, even if the destination WIM will use +the same compression type as the source WIM. +.TP \fB--compress-slow\fR Spend even more time compressing the data to achieve a very slightly better compression ratio. This currently only has an effect for LZX ("maximum") and diff --git a/programs/imagex.c b/programs/imagex.c index 50803014..1c077b7f 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -271,6 +271,7 @@ static const struct option export_options[] = { {T("nocheck"), no_argument, NULL, IMAGEX_NOCHECK_OPTION}, {T("no-check"), no_argument, NULL, IMAGEX_NOCHECK_OPTION}, {T("compress"), required_argument, NULL, IMAGEX_COMPRESS_OPTION}, + {T("recompress"), no_argument, NULL, IMAGEX_RECOMPRESS_OPTION}, {T("compress-slow"), no_argument, NULL, IMAGEX_COMPRESS_SLOW_OPTION}, {T("pack-streams"),no_argument, NULL, IMAGEX_PACK_STREAMS_OPTION}, {T("solid"), no_argument, NULL, IMAGEX_PACK_STREAMS_OPTION}, @@ -2612,6 +2613,9 @@ imagex_export(int argc, tchar **argv, int cmd) if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID) goto out_err; break; + case IMAGEX_RECOMPRESS_OPTION: + write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS; + break; case IMAGEX_COMPRESS_SLOW_OPTION: write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS; set_compress_slow(); -- 2.43.0