*/
/*
- * Copyright (C) 2012, 2013 Eric Biggers
+ * Copyright (C) 2012, 2013, 2014 Eric Biggers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
IMAGEX_LAZY_OPTION,
IMAGEX_LOOKUP_TABLE_OPTION,
IMAGEX_METADATA_OPTION,
+ IMAGEX_NEW_IMAGE_OPTION,
IMAGEX_NOCHECK_OPTION,
IMAGEX_NORPFIX_OPTION,
IMAGEX_NOT_PIPABLE_OPTION,
{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("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},
{T("chunk-size"), required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
{T("check"), no_argument, NULL, IMAGEX_CHECK_OPTION},
{T("rebuild"), no_argument, NULL, IMAGEX_REBUILD_OPTION},
{T("lazy"), no_argument, NULL, IMAGEX_LAZY_OPTION},
+ {T("new-image"), no_argument, NULL, IMAGEX_NEW_IMAGE_OPTION},
{NULL, 0, NULL, 0},
};
if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID)
goto out_err;
break;
+ case IMAGEX_COMPRESS_SLOW_OPTION:
+ write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
+ set_compress_slow();
+ break;
case IMAGEX_PACK_STREAMS_OPTION:
write_flags |= WIMLIB_WRITE_FLAG_PACK_STREAMS;
break;
case IMAGEX_LAZY_OPTION:
unmount_flags |= WIMLIB_UNMOUNT_FLAG_LAZY;
break;
+ case IMAGEX_NEW_IMAGE_OPTION:
+ unmount_flags |= WIMLIB_UNMOUNT_FLAG_NEW_IMAGE;
+ break;
default:
goto out_usage;
}
if (argc != 1)
goto out_usage;
+ if (unmount_flags & WIMLIB_UNMOUNT_FLAG_NEW_IMAGE) {
+ if (!(unmount_flags & WIMLIB_UNMOUNT_FLAG_COMMIT)) {
+ imagex_error(T("--new-image is meaningless "
+ "without --commit also specified!"));
+ goto out_err;
+ }
+ imagex_printf(T("Committing changes as new image...\n"));
+ }
+
ret = wimlib_unmount_image(argv[0], unmount_flags,
imagex_progress_func);
if (ret)
out_usage:
usage(CMD_UNMOUNT, stderr);
+out_err:
ret = -1;
goto out;
}
[CMD_UNMOUNT] =
T(
" %"TS" DIRECTORY [--commit] [--check] [--rebuild] [--lazy]\n"
+" [--new-image]\n"
),
#endif
[CMD_UPDATE] =
{
static const tchar *s =
T(
-IMAGEX_PROGNAME " (" PACKAGE ") " PACKAGE_VERSION "\n"
-"Copyright (C) 2012, 2013 Eric Biggers\n"
+IMAGEX_PROGNAME " (distributed with " PACKAGE " " PACKAGE_VERSION ")\n"
+"Copyright (C) 2012, 2013, 2014 Eric Biggers\n"
"License GPLv3+; GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n"
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n"