]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
wimoptimize: Add --no-pack-streams option
[wimlib] / programs / imagex.c
index b983c7f317b36bce77ebbb8c0cb5245a7f4dd6f4..a9e6fa63bac0718cb0f0a764f5f5dd96ffd95b80 100644 (file)
@@ -292,6 +292,8 @@ static const struct option optimize_options[] = {
        {T("compress-slow"), no_argument,     NULL, IMAGEX_COMPRESS_SLOW_OPTION},
        {T("recompress-slow"), no_argument,     NULL, IMAGEX_COMPRESS_SLOW_OPTION},
        {T("chunk-size"),  required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
+       {T("pack-streams"),no_argument,       NULL, IMAGEX_PACK_STREAMS_OPTION},
+       {T("no-pack-streams"), no_argument,   NULL, IMAGEX_NO_PACK_STREAMS_OPTION},
        {T("threads"),     required_argument, NULL, IMAGEX_THREADS_OPTION},
        {T("pipable"),     no_argument,       NULL, IMAGEX_PIPABLE_OPTION},
        {T("not-pipable"), no_argument,       NULL, IMAGEX_NOT_PIPABLE_OPTION},
@@ -417,6 +419,8 @@ get_compression_type(const tchar *optarg)
                return WIMLIB_COMPRESSION_TYPE_LZX;
        else if (!tstrcasecmp(optarg, T("fast")) || !tstrcasecmp(optarg, T("xpress")))
                return WIMLIB_COMPRESSION_TYPE_XPRESS;
+       else if (!tstrcasecmp(optarg, T("recovery")) || !tstrcasecmp(optarg, T("lzms")))
+               return WIMLIB_COMPRESSION_TYPE_LZMS;
        else if (!tstrcasecmp(optarg, T("none")))
                return WIMLIB_COMPRESSION_TYPE_NONE;
        else {
@@ -2785,10 +2789,7 @@ print_resource(const struct wimlib_resource_entry *resource,
 {
        tprintf(T("Uncompressed size     = %"PRIu64" bytes\n"),
                resource->uncompressed_size);
-       if (resource->is_packed_streams) {
-               tprintf(T("Raw uncompressed size = %"PRIu64" bytes\n"),
-                       resource->raw_resource_uncompressed_size);
-
+       if (resource->packed) {
                tprintf(T("Raw compressed size   = %"PRIu64" bytes\n"),
                        resource->raw_resource_compressed_size);
 
@@ -2805,7 +2806,6 @@ print_resource(const struct wimlib_resource_entry *resource,
                        resource->offset);
        }
 
-
        tprintf(T("Part Number           = %u\n"), resource->part_number);
        tprintf(T("Reference Count       = %u\n"), resource->reference_count);
 
@@ -2822,7 +2822,7 @@ print_resource(const struct wimlib_resource_entry *resource,
                tprintf(T("WIM_RESHDR_FLAG_FREE  "));
        if (resource->is_spanned)
                tprintf(T("WIM_RESHDR_FLAG_SPANNED  "));
-       if (resource->is_packed_streams)
+       if (resource->packed)
                tprintf(T("WIM_RESHDR_FLAG_PACKED_STREAMS  "));
        tputchar(T('\n'));
        tputchar(T('\n'));
@@ -3322,6 +3322,13 @@ imagex_optimize(int argc, tchar **argv, int cmd)
                        if (chunk_size == UINT32_MAX)
                                goto out_err;
                        break;
+               case IMAGEX_PACK_STREAMS_OPTION:
+                       write_flags |= WIMLIB_WRITE_FLAG_PACK_STREAMS;
+                       write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
+                       break;
+               case IMAGEX_NO_PACK_STREAMS_OPTION:
+                       write_flags |= WIMLIB_WRITE_FLAG_NO_PACK_STREAMS;
+                       break;
                case IMAGEX_THREADS_OPTION:
                        num_threads = parse_num_threads(optarg);
                        if (num_threads == UINT_MAX)