IMAGEX_NULLGLOB_OPTION,
IMAGEX_ONE_FILE_ONLY_OPTION,
IMAGEX_PACK_CHUNK_SIZE_OPTION,
+ IMAGEX_PACK_COMPRESS_OPTION,
IMAGEX_PACK_STREAMS_OPTION,
IMAGEX_PATH_OPTION,
IMAGEX_PIPABLE_OPTION,
{T("chunk-size"), required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
{T("pack-chunk-size"), required_argument, NULL, IMAGEX_PACK_CHUNK_SIZE_OPTION},
{T("solid-chunk-size"),required_argument, NULL, IMAGEX_PACK_CHUNK_SIZE_OPTION},
+ {T("pack-compress"), required_argument, NULL, IMAGEX_PACK_COMPRESS_OPTION},
+ {T("solid-compress"),required_argument, NULL, IMAGEX_PACK_COMPRESS_OPTION},
{T("pack-streams"), no_argument, NULL, IMAGEX_PACK_STREAMS_OPTION},
{T("solid"), no_argument, NULL, IMAGEX_PACK_STREAMS_OPTION},
{T("config"), required_argument, NULL, IMAGEX_CONFIG_OPTION},
{T("chunk-size"), required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
{T("pack-chunk-size"), required_argument, NULL, IMAGEX_PACK_CHUNK_SIZE_OPTION},
{T("solid-chunk-size"),required_argument, NULL, IMAGEX_PACK_CHUNK_SIZE_OPTION},
+ {T("pack-compress"), required_argument, NULL, IMAGEX_PACK_COMPRESS_OPTION},
+ {T("solid-compress"),required_argument, NULL, IMAGEX_PACK_COMPRESS_OPTION},
{T("ref"), required_argument, NULL, IMAGEX_REF_OPTION},
{T("threads"), required_argument, NULL, IMAGEX_THREADS_OPTION},
{T("rebuild"), no_argument, NULL, IMAGEX_REBUILD_OPTION},
{T("chunk-size"), required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
{T("pack-chunk-size"), required_argument, NULL, IMAGEX_PACK_CHUNK_SIZE_OPTION},
{T("solid-chunk-size"),required_argument, NULL, IMAGEX_PACK_CHUNK_SIZE_OPTION},
+ {T("pack-compress"), required_argument, NULL, IMAGEX_PACK_COMPRESS_OPTION},
+ {T("solid-compress"),required_argument, NULL, IMAGEX_PACK_COMPRESS_OPTION},
{T("pack-streams"),no_argument, NULL, IMAGEX_PACK_STREAMS_OPTION},
{T("solid"), no_argument, NULL, IMAGEX_PACK_STREAMS_OPTION},
{T("threads"), required_argument, NULL, IMAGEX_THREADS_OPTION},
int compression_type = WIMLIB_COMPRESSION_TYPE_INVALID;
uint32_t chunk_size = UINT32_MAX;
uint32_t pack_chunk_size = UINT32_MAX;
+ int pack_ctype = WIMLIB_COMPRESSION_TYPE_INVALID;
const tchar *wimfile;
int wim_fd;
const tchar *name;
if (pack_chunk_size == UINT32_MAX)
goto out_err;
break;
+ case IMAGEX_PACK_COMPRESS_OPTION:
+ pack_ctype = get_compression_type(optarg);
+ if (pack_ctype == WIMLIB_COMPRESSION_TYPE_INVALID)
+ goto out_err;
+ break;
case IMAGEX_PACK_STREAMS_OPTION:
write_flags |= WIMLIB_WRITE_FLAG_PACK_STREAMS;
break;
compression_type = WIMLIB_COMPRESSION_TYPE_XPRESS;
} else {
compression_type = WIMLIB_COMPRESSION_TYPE_LZX;
- if (!compress_slow) {
+ if (!compress_slow && pack_ctype != WIMLIB_COMPRESSION_TYPE_LZX) {
struct wimlib_lzx_compressor_params params = {
.hdr.size = sizeof(params),
.algorithm = WIMLIB_LZX_ALGORITHM_FAST,
¶ms.hdr);
}
}
-
}
if (compress_slow)
if (ret)
goto out_free_wim;
}
+ if (pack_ctype != WIMLIB_COMPRESSION_TYPE_INVALID) {
+ ret = wimlib_set_output_pack_compression_type(wim, pack_ctype);
+ if (ret)
+ goto out_free_wim;
+ }
if (pack_chunk_size != UINT32_MAX) {
ret = wimlib_set_output_pack_chunk_size(wim, pack_chunk_size);
if (ret)
unsigned num_threads = 0;
uint32_t chunk_size = UINT32_MAX;
uint32_t pack_chunk_size = UINT32_MAX;
+ int pack_ctype = WIMLIB_COMPRESSION_TYPE_INVALID;
for_opt(c, export_options) {
switch (c) {
if (pack_chunk_size == UINT32_MAX)
goto out_err;
break;
+ case IMAGEX_PACK_COMPRESS_OPTION:
+ pack_ctype = get_compression_type(optarg);
+ if (pack_ctype == WIMLIB_COMPRESSION_TYPE_INVALID)
+ goto out_err;
+ break;
case IMAGEX_REF_OPTION:
ret = string_set_append(&refglobs, optarg);
if (ret)
if (ret)
goto out_free_dest_wim;
}
+ if (pack_ctype != WIMLIB_COMPRESSION_TYPE_INVALID) {
+ ret = wimlib_set_output_pack_compression_type(dest_wim, pack_ctype);
+ if (ret)
+ goto out_free_dest_wim;
+ }
if (pack_chunk_size != UINT32_MAX) {
ret = wimlib_set_output_pack_chunk_size(dest_wim, pack_chunk_size);
if (ret)
int compression_type = WIMLIB_COMPRESSION_TYPE_INVALID;
uint32_t chunk_size = UINT32_MAX;
uint32_t pack_chunk_size = UINT32_MAX;
+ int pack_ctype = WIMLIB_COMPRESSION_TYPE_INVALID;
int ret;
WIMStruct *wim;
const tchar *wimfile;
if (pack_chunk_size == UINT32_MAX)
goto out_err;
break;
+ case IMAGEX_PACK_COMPRESS_OPTION:
+ pack_ctype = get_compression_type(optarg);
+ if (pack_ctype == WIMLIB_COMPRESSION_TYPE_INVALID)
+ goto out_err;
+ break;
case IMAGEX_PACK_STREAMS_OPTION:
write_flags |= WIMLIB_WRITE_FLAG_PACK_STREAMS;
write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
if (ret)
goto out_wimlib_free;
}
+ if (pack_ctype != WIMLIB_COMPRESSION_TYPE_INVALID) {
+ ret = wimlib_set_output_pack_compression_type(wim, pack_ctype);
+ if (ret)
+ goto out_wimlib_free;
+ }
if (pack_chunk_size != UINT32_MAX) {
ret = wimlib_set_output_pack_chunk_size(wim, pack_chunk_size);
if (ret)