From: Eric Biggers Date: Sat, 7 Nov 2015 18:27:22 +0000 (-0600) Subject: wimappend: fix setting of chunk size when using --wimboot flag X-Git-Tag: v1.8.3~7 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=f84a3d108722a2290f45d384638206663a9df824 wimappend: fix setting of chunk size when using --wimboot flag --- diff --git a/programs/imagex.c b/programs/imagex.c index feb36304..b7ff47ef 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -2122,11 +2122,21 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd) ret = wimlib_set_output_chunk_size(wim, chunk_size); if (ret) goto out_free_wim; - } else if ((add_flags & WIMLIB_ADD_FLAG_WIMBOOT) && - compression_type == WIMLIB_COMPRESSION_TYPE_XPRESS) { - ret = wimlib_set_output_chunk_size(wim, 4096); - if (ret) - goto out_free_wim; + } else if ((add_flags & WIMLIB_ADD_FLAG_WIMBOOT)) { + + int ctype = compression_type; + + if (cmd == CMD_APPEND) { + struct wimlib_wim_info info; + wimlib_get_wim_info(wim, &info); + ctype = info.compression_type; + } + + if (ctype == WIMLIB_COMPRESSION_TYPE_XPRESS) { + ret = wimlib_set_output_chunk_size(wim, 4096); + if (ret) + goto out_free_wim; + } } if (solid_ctype != WIMLIB_COMPRESSION_TYPE_INVALID) { ret = wimlib_set_output_pack_compression_type(wim, solid_ctype);