2 * update_image.c - Update a WIM image.
6 * Copyright (C) 2013, 2014 Eric Biggers
8 * This file is part of wimlib, a library for working with WIM files.
10 * wimlib is free software; you can redistribute it and/or modify it under the
11 * terms of the GNU General Public License as published by the Free
12 * Software Foundation; either version 3 of the License, or (at your option)
15 * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
16 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 * A PARTICULAR PURPOSE. See the GNU General Public License for more
20 * You should have received a copy of the GNU General Public License
21 * along with wimlib; if not, see http://www.gnu.org/licenses/.
28 #include "wimlib/capture.h"
29 #include "wimlib/dentry.h"
30 #include "wimlib/error.h"
31 #include "wimlib/lookup_table.h"
32 #include "wimlib/metadata.h"
34 # include "wimlib/ntfs_3g.h" /* for do_ntfs_umount() */
36 #include "wimlib/paths.h"
37 #include "wimlib/xml.h"
42 /* Overlays @branch onto @target, both of which must be directories. */
44 do_overlay(struct wim_dentry *target, struct wim_dentry *branch)
46 DEBUG("Doing overlay \"%"WS"\" => \"%"WS"\"",
47 branch->file_name, target->file_name);
49 if (!dentry_is_directory(branch) || !dentry_is_directory(target)) {
50 ERROR("Cannot overlay \"%"WS"\" onto existing dentry: "
51 "is not directory-on-directory!", branch->file_name);
52 return WIMLIB_ERR_INVALID_OVERLAY;
55 LIST_HEAD(moved_children);
56 while (dentry_has_children(branch)) {
57 struct wim_dentry *child = dentry_any_child(branch);
58 struct wim_dentry *existing;
60 /* Move @child to the directory @target */
62 existing = dentry_add_child(target, child);
64 /* File or directory with same name already exists */
67 ret = do_overlay(existing, child);
69 /* Overlay failed. Revert the changes. */
70 dentry_add_child(branch, child);
71 list_for_each_entry(child, &moved_children, tmp_list)
74 dentry_add_child(branch, child);
79 list_add(&child->tmp_list, &moved_children);
86 /* Attach or overlay a branch onto the WIM image.
89 * Pointer to the root of the WIM image, or pointer to NULL if it has not
94 * Path in the WIM image to add the branch, with leading and trailing
98 attach_branch(struct wim_dentry **root_p, struct wim_dentry *branch,
99 tchar *target_path, CASE_SENSITIVITY_TYPE case_type)
102 struct wim_dentry *dentry, *parent, *target;
105 DEBUG("Attaching branch \"%"WS"\" => \"%"TS"\"",
106 branch->file_name, target_path);
108 if (*target_path == T('\0')) {
109 /* Target: root directory */
111 /* Overlay on existing root */
112 return do_overlay(*root_p, branch);
114 if (!dentry_is_directory(branch)) {
115 ERROR("Cannot set non-directory as root of WIM image");
116 return WIMLIB_ERR_NOTDIR;
124 /* Adding a non-root branch. Create root if it hasn't been created
127 ret = new_filler_directory(T(""), root_p);
132 /* Walk the path to the branch, creating filler directories as needed.
135 while ((slash = tstrchr(target_path, WIM_PATH_SEPARATOR))) {
137 dentry = get_dentry_child_with_name(parent, target_path,
140 ret = new_filler_directory(target_path, &dentry);
143 dentry_add_child(parent, dentry);
147 /* Skip over slashes. Note: this cannot overrun the length of
148 * the string because the last character cannot be a slash, as
149 * trailing slashes were tripped. */
152 } while (*target_path == WIM_PATH_SEPARATOR);
155 /* If the target path already existed, overlay the branch onto it.
156 * Otherwise, set the branch as the target path. */
157 target = get_dentry_child_with_utf16le_name(parent, branch->file_name,
158 branch->file_name_nbytes,
161 return do_overlay(target, branch);
163 dentry_add_child(parent, branch);
168 static const char wincfg[] =
173 "/System Volume Information\n"
177 static const tchar *wimboot_cfgfile =
178 T("/Windows/System32/WimBootCompress.ini");
181 get_capture_config(const tchar *config_file, struct capture_config *config,
182 int add_flags, const tchar *fs_source_path)
185 tchar *tmp_config_file = NULL;
187 memset(config, 0, sizeof(*config));
189 /* For WIMBoot capture, check for default capture configuration file
190 * unless one was explicitly specified. */
191 if (!config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT)) {
193 /* XXX: Handle loading file correctly when in NTFS volume. */
195 size_t len = tstrlen(fs_source_path) +
196 tstrlen(wimboot_cfgfile);
197 tmp_config_file = MALLOC((len + 1) * sizeof(tchar));
200 tsprintf(tmp_config_file, T("%"TS"%"TS),
201 fs_source_path, wimboot_cfgfile);
202 if (!tstat(tmp_config_file, &st)) {
203 config_file = tmp_config_file;
204 add_flags &= ~WIMLIB_ADD_FLAG_WINCONFIG;
206 WARNING("\"%"TS"\" does not exist.\n"
207 " Using default capture configuration!",
212 if (add_flags & WIMLIB_ADD_FLAG_WINCONFIG) {
213 /* Use Windows default. */
215 return WIMLIB_ERR_INVALID_PARAM;
216 ret = do_read_capture_config_file(T("wincfg"), wincfg,
217 sizeof(wincfg) - 1, config);
218 } else if (config_file) {
219 /* Use the specified configuration file. */
220 ret = do_read_capture_config_file(config_file, NULL, 0, config);
222 /* ... Or don't use any configuration file at all. No files
223 * will be excluded from capture, all files will be compressed,
227 FREE(tmp_config_file);
232 replace_wimboot_cfg(WIMStruct *wim, const tchar *config_file)
234 struct wimlib_update_command cmds[] = {
236 .op = WIMLIB_UPDATE_OP_DELETE,
238 .wim_path = (tchar *)wimboot_cfgfile,
239 .delete_flags = WIMLIB_DELETE_FLAG_FORCE |
240 WIMLIB_DELETE_FLAG_RECURSIVE,
244 .op = WIMLIB_UPDATE_OP_ADD,
246 .fs_source_path = (tchar *)config_file,
247 .wim_target_path = (tchar *)wimboot_cfgfile,
253 return wimlib_update_image(wim, wim->current_image,
254 cmds, ARRAY_LEN(cmds), 0, NULL);
258 execute_add_command(WIMStruct *wim,
259 const struct wimlib_update_command *add_cmd,
260 wimlib_progress_func_t progress_func)
264 tchar *fs_source_path;
265 tchar *wim_target_path;
266 struct wim_image_metadata *imd;
267 struct list_head unhashed_streams;
268 struct add_image_params params;
269 int (*capture_tree)(struct wim_dentry **,
271 struct add_image_params *);
272 const tchar *config_file;
273 struct capture_config config;
275 struct _ntfs_volume *ntfs_vol = NULL;
278 struct wim_dentry *branch;
279 bool rollback_sd = true;
281 wimlib_assert(add_cmd->op == WIMLIB_UPDATE_OP_ADD);
283 add_flags = add_cmd->add.add_flags;
284 fs_source_path = add_cmd->add.fs_source_path;
285 wim_target_path = add_cmd->add.wim_target_path;
286 config_file = add_cmd->add.config_file;
288 DEBUG("fs_source_path=\"%"TS"\", wim_target_path=\"%"TS"\", add_flags=%#x",
289 fs_source_path, wim_target_path, add_flags);
291 memset(¶ms, 0, sizeof(params));
293 imd = wim->image_metadata[wim->current_image - 1];
295 if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
297 capture_tree = build_dentry_tree_ntfs;
298 extra_arg = &ntfs_vol;
299 if (imd->ntfs_vol != NULL) {
300 ERROR("NTFS volume already set");
301 ret = WIMLIB_ERR_INVALID_PARAM;
305 ret = WIMLIB_ERR_INVALID_PARAM;
310 capture_tree = win32_build_dentry_tree;
312 capture_tree = unix_build_dentry_tree;
317 ret = get_capture_config(config_file, &config,
318 add_flags, fs_source_path);
322 ret = init_inode_table(¶ms.inode_table, 9001);
324 goto out_destroy_config;
326 ret = init_sd_set(¶ms.sd_set, imd->security_data);
328 goto out_destroy_inode_table;
330 INIT_LIST_HEAD(&unhashed_streams);
331 params.lookup_table = wim->lookup_table;
332 params.unhashed_streams = &unhashed_streams;
333 params.config = &config;
334 params.add_flags = add_flags;
335 params.extra_arg = extra_arg;
337 params.progress_func = progress_func;
338 params.progress.scan.source = fs_source_path;
339 params.progress.scan.wim_target_path = wim_target_path;
341 progress_func(WIMLIB_PROGRESS_MSG_SCAN_BEGIN, ¶ms.progress);
343 config.prefix = fs_source_path;
344 config.prefix_num_tchars = tstrlen(fs_source_path);
346 if (wim_target_path[0] == T('\0'))
347 params.add_flags |= WIMLIB_ADD_FLAG_ROOT;
348 ret = (*capture_tree)(&branch, fs_source_path, ¶ms);
350 goto out_destroy_sd_set;
353 /* Use the target name, not the source name, for
354 * the root of each branch from a capture
355 * source. (This will also set the root dentry
356 * of the entire image to be unnamed.) */
357 ret = dentry_set_name(branch,
358 path_basename(wim_target_path));
360 goto out_ntfs_umount;
362 ret = attach_branch(&imd->root_dentry, branch, wim_target_path,
363 WIMLIB_CASE_PLATFORM_DEFAULT);
365 goto out_ntfs_umount;
368 if (config_file && (add_flags & WIMLIB_ADD_FLAG_WIMBOOT) &&
369 wim_target_path[0] == T('\0'))
371 /* Save configuration file as \Windows\System32\WimBootCompress.ini */
372 ret = replace_wimboot_cfg(wim, config_file);
374 /* Undo attach_branch() */
375 if (imd->root_dentry == branch)
376 imd->root_dentry = NULL;
379 goto out_ntfs_umount;
384 progress_func(WIMLIB_PROGRESS_MSG_SCAN_END, ¶ms.progress);
385 list_splice_tail(&unhashed_streams, &imd->unhashed_streams);
387 imd->ntfs_vol = ntfs_vol;
389 inode_table_prepare_inode_list(¶ms.inode_table, &imd->inode_list);
392 if (add_flags & WIMLIB_ADD_FLAG_RPFIX)
393 wim->hdr.flags |= WIM_HDR_FLAG_RP_FIX;
394 goto out_destroy_sd_set;
398 do_ntfs_umount(ntfs_vol);
400 free_dentry_tree(branch, wim->lookup_table);
402 destroy_sd_set(¶ms.sd_set, rollback_sd);
403 out_destroy_inode_table:
404 destroy_inode_table(¶ms.inode_table);
406 destroy_capture_config(&config);
412 execute_delete_command(WIMStruct *wim,
413 const struct wimlib_update_command *delete_cmd)
416 const tchar *wim_path;
417 struct wim_dentry *tree;
420 wimlib_assert(delete_cmd->op == WIMLIB_UPDATE_OP_DELETE);
421 flags = delete_cmd->delete_.delete_flags;
422 wim_path = delete_cmd->delete_.wim_path;
424 DEBUG("Deleting WIM path \"%"TS"\" (flags=%#x)", wim_path, flags);
426 tree = get_dentry(wim, wim_path, WIMLIB_CASE_PLATFORM_DEFAULT);
428 /* Path to delete does not exist in the WIM. */
429 if (flags & WIMLIB_DELETE_FLAG_FORCE) {
432 ERROR("Path \"%"TS"\" does not exist in WIM image %d",
433 wim_path, wim->current_image);
434 return WIMLIB_ERR_PATH_DOES_NOT_EXIST;
438 if (dentry_is_directory(tree) && !(flags & WIMLIB_DELETE_FLAG_RECURSIVE)) {
439 ERROR("Path \"%"TS"\" in WIM image %d is a directory "
440 "but a recursive delete was not requested",
441 wim_path, wim->current_image);
442 return WIMLIB_ERR_IS_DIRECTORY;
445 is_root = dentry_is_root(tree);
447 free_dentry_tree(tree, wim->lookup_table);
449 wim->image_metadata[wim->current_image - 1]->root_dentry = NULL;
454 execute_rename_command(WIMStruct *wim,
455 const struct wimlib_update_command *rename_cmd)
459 wimlib_assert(rename_cmd->op == WIMLIB_UPDATE_OP_RENAME);
461 ret = rename_wim_path(wim, rename_cmd->rename.wim_source_path,
462 rename_cmd->rename.wim_target_path,
463 WIMLIB_CASE_PLATFORM_DEFAULT);
467 ERROR_WITH_ERRNO("Can't rename \"%"TS"\" to \"%"TS"\"",
468 rename_cmd->rename.wim_source_path,
469 rename_cmd->rename.wim_target_path);
472 ret = WIMLIB_ERR_NOMEM;
475 ret = WIMLIB_ERR_NOTDIR;
478 ret = WIMLIB_ERR_NOTEMPTY;
481 ret = WIMLIB_ERR_IS_DIRECTORY;
485 ret = WIMLIB_ERR_PATH_DOES_NOT_EXIST;
492 static inline const tchar *
493 update_op_to_str(int op)
496 case WIMLIB_UPDATE_OP_ADD:
498 case WIMLIB_UPDATE_OP_DELETE:
500 case WIMLIB_UPDATE_OP_RENAME:
509 execute_update_commands(WIMStruct *wim,
510 const struct wimlib_update_command *cmds,
513 wimlib_progress_func_t progress_func)
516 union wimlib_progress_info info;
517 info.update.completed_commands = 0;
518 info.update.total_commands = num_cmds;
519 for (size_t i = 0; i < num_cmds; i++) {
520 DEBUG("Executing update command %zu of %zu (op=%"TS")",
521 i + 1, num_cmds, update_op_to_str(cmds[i].op));
522 if (update_flags & WIMLIB_UPDATE_FLAG_SEND_PROGRESS &&
525 info.update.command = &cmds[i];
526 (*progress_func)(WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND,
529 switch (cmds[i].op) {
530 case WIMLIB_UPDATE_OP_ADD:
531 ret = execute_add_command(wim, &cmds[i], progress_func);
533 case WIMLIB_UPDATE_OP_DELETE:
534 ret = execute_delete_command(wim, &cmds[i]);
536 case WIMLIB_UPDATE_OP_RENAME:
537 ret = execute_rename_command(wim, &cmds[i]);
544 info.update.completed_commands++;
545 if (update_flags & WIMLIB_UPDATE_FLAG_SEND_PROGRESS &&
548 (*progress_func)(WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND,
557 check_add_command(struct wimlib_update_command *cmd,
558 const struct wim_header *hdr)
560 int add_flags = cmd->add.add_flags;
562 if (add_flags & ~(WIMLIB_ADD_FLAG_NTFS |
563 WIMLIB_ADD_FLAG_DEREFERENCE |
564 WIMLIB_ADD_FLAG_VERBOSE |
565 /* BOOT doesn't make sense for wimlib_update_image(). */
566 /*WIMLIB_ADD_FLAG_BOOT |*/
567 WIMLIB_ADD_FLAG_WIMBOOT |
568 WIMLIB_ADD_FLAG_UNIX_DATA |
569 WIMLIB_ADD_FLAG_NO_ACLS |
570 WIMLIB_ADD_FLAG_STRICT_ACLS |
571 WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE |
572 WIMLIB_ADD_FLAG_RPFIX |
573 WIMLIB_ADD_FLAG_NORPFIX |
574 WIMLIB_ADD_FLAG_NO_UNSUPPORTED_EXCLUDE |
575 WIMLIB_ADD_FLAG_WINCONFIG))
576 return WIMLIB_ERR_INVALID_PARAM;
578 /* Are we adding the entire image or not? An empty wim_target_path
579 * indicates that the tree we're adding is to be placed in the root of
580 * the image. We consider this to be capturing the entire image,
581 * although it could potentially be an overlay on an existing root as
583 bool is_entire_image = cmd->add.wim_target_path[0] == T('\0');
586 /* Check for flags not supported on Windows */
587 if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
588 ERROR("wimlib was compiled without support for NTFS-3g, so");
589 ERROR("we cannot capture a WIM image directly from a NTFS volume");
590 return WIMLIB_ERR_UNSUPPORTED;
592 if (add_flags & WIMLIB_ADD_FLAG_UNIX_DATA) {
593 ERROR("Capturing UNIX-specific data is not supported on Windows");
594 return WIMLIB_ERR_UNSUPPORTED;
596 if (add_flags & WIMLIB_ADD_FLAG_DEREFERENCE) {
597 ERROR("Dereferencing symbolic links is not supported on Windows");
598 return WIMLIB_ERR_UNSUPPORTED;
602 /* VERBOSE implies EXCLUDE_VERBOSE */
603 if (add_flags & WIMLIB_ADD_FLAG_VERBOSE)
604 add_flags |= WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE;
606 /* Check for contradictory reparse point fixup flags */
607 if ((add_flags & (WIMLIB_ADD_FLAG_RPFIX |
608 WIMLIB_ADD_FLAG_NORPFIX)) ==
609 (WIMLIB_ADD_FLAG_RPFIX |
610 WIMLIB_ADD_FLAG_NORPFIX))
612 ERROR("Cannot specify RPFIX and NORPFIX flags "
613 "at the same time!");
614 return WIMLIB_ERR_INVALID_PARAM;
617 /* Set default behavior on reparse point fixups if requested */
618 if ((add_flags & (WIMLIB_ADD_FLAG_RPFIX |
619 WIMLIB_ADD_FLAG_NORPFIX)) == 0)
621 /* Do reparse-point fixups by default if we are capturing an
622 * entire image and either the header flag is set from previous
623 * images, or if this is the first image being added. */
624 if (is_entire_image &&
625 ((hdr->flags & WIM_HDR_FLAG_RP_FIX) || hdr->image_count == 1))
626 add_flags |= WIMLIB_ADD_FLAG_RPFIX;
629 if (!is_entire_image) {
630 if (add_flags & WIMLIB_ADD_FLAG_NTFS) {
631 ERROR("Cannot add directly from a NTFS volume "
632 "when not capturing a full image!");
633 return WIMLIB_ERR_INVALID_PARAM;
636 if (add_flags & WIMLIB_ADD_FLAG_RPFIX) {
637 ERROR("Cannot do reparse point fixups when "
638 "not capturing a full image!");
639 return WIMLIB_ERR_INVALID_PARAM;
642 /* We may have modified the add flags. */
643 cmd->add.add_flags = add_flags;
648 check_delete_command(const struct wimlib_update_command *cmd)
650 if (cmd->delete_.delete_flags & ~(WIMLIB_DELETE_FLAG_FORCE |
651 WIMLIB_DELETE_FLAG_RECURSIVE))
652 return WIMLIB_ERR_INVALID_PARAM;
657 check_rename_command(const struct wimlib_update_command *cmd)
659 if (cmd->rename.rename_flags != 0)
660 return WIMLIB_ERR_INVALID_PARAM;
665 check_update_command(struct wimlib_update_command *cmd,
666 const struct wim_header *hdr)
669 case WIMLIB_UPDATE_OP_ADD:
670 return check_add_command(cmd, hdr);
671 case WIMLIB_UPDATE_OP_DELETE:
672 return check_delete_command(cmd);
673 case WIMLIB_UPDATE_OP_RENAME:
674 return check_rename_command(cmd);
680 check_update_commands(struct wimlib_update_command *cmds, size_t num_cmds,
681 const struct wim_header *hdr)
684 for (size_t i = 0; i < num_cmds; i++) {
685 ret = check_update_command(&cmds[i], hdr);
694 free_update_commands(struct wimlib_update_command *cmds, size_t num_cmds)
697 for (size_t i = 0; i < num_cmds; i++) {
698 switch (cmds[i].op) {
699 case WIMLIB_UPDATE_OP_ADD:
700 FREE(cmds[i].add.fs_source_path);
701 FREE(cmds[i].add.wim_target_path);
702 FREE(cmds[i].add.config_file);
704 case WIMLIB_UPDATE_OP_DELETE:
705 FREE(cmds[i].delete_.wim_path);
707 case WIMLIB_UPDATE_OP_RENAME:
708 FREE(cmds[i].rename.wim_source_path);
709 FREE(cmds[i].rename.wim_target_path);
718 copy_update_commands(const struct wimlib_update_command *cmds,
720 struct wimlib_update_command **cmds_copy_ret)
723 struct wimlib_update_command *cmds_copy;
725 cmds_copy = CALLOC(num_cmds, sizeof(cmds[0]));
729 for (size_t i = 0; i < num_cmds; i++) {
730 cmds_copy[i].op = cmds[i].op;
731 switch (cmds[i].op) {
732 case WIMLIB_UPDATE_OP_ADD:
733 cmds_copy[i].add.fs_source_path =
734 canonicalize_fs_path(cmds[i].add.fs_source_path);
735 cmds_copy[i].add.wim_target_path =
736 canonicalize_wim_path(cmds[i].add.wim_target_path);
737 if (!cmds_copy[i].add.fs_source_path ||
738 !cmds_copy[i].add.wim_target_path)
740 if (cmds[i].add.config_file) {
741 cmds_copy[i].add.config_file = TSTRDUP(cmds[i].add.config_file);
742 if (!cmds_copy[i].add.config_file)
745 cmds_copy[i].add.add_flags = cmds[i].add.add_flags;
747 case WIMLIB_UPDATE_OP_DELETE:
748 cmds_copy[i].delete_.wim_path =
749 canonicalize_wim_path(cmds[i].delete_.wim_path);
750 if (!cmds_copy[i].delete_.wim_path)
752 cmds_copy[i].delete_.delete_flags = cmds[i].delete_.delete_flags;
754 case WIMLIB_UPDATE_OP_RENAME:
755 cmds_copy[i].rename.wim_source_path =
756 canonicalize_wim_path(cmds[i].rename.wim_source_path);
757 cmds_copy[i].rename.wim_target_path =
758 canonicalize_wim_path(cmds[i].rename.wim_target_path);
759 if (!cmds_copy[i].rename.wim_source_path ||
760 !cmds_copy[i].rename.wim_target_path)
764 ERROR("Unknown update operation %u", cmds[i].op);
765 ret = WIMLIB_ERR_INVALID_PARAM;
769 *cmds_copy_ret = cmds_copy;
774 ret = WIMLIB_ERR_NOMEM;
776 free_update_commands(cmds_copy, num_cmds);
780 /* API function documented in wimlib.h */
782 wimlib_update_image(WIMStruct *wim,
784 const struct wimlib_update_command *cmds,
787 wimlib_progress_func_t progress_func)
790 struct wimlib_update_command *cmds_copy;
791 bool deletion_requested = false;
793 if (update_flags & ~WIMLIB_UPDATE_FLAG_SEND_PROGRESS)
794 return WIMLIB_ERR_INVALID_PARAM;
796 DEBUG("Updating image %d with %zu commands", image, num_cmds);
798 for (size_t i = 0; i < num_cmds; i++)
799 if (cmds[i].op == WIMLIB_UPDATE_OP_DELETE)
800 deletion_requested = true;
802 if (deletion_requested)
803 ret = can_delete_from_wim(wim);
805 ret = can_modify_wim(wim);
810 /* Load the metadata for the image to modify (if not loaded already) */
811 ret = select_wim_image(wim, image);
815 /* Short circuit a successful return if no commands were specified.
816 * Avoids problems with trying to allocate 0 bytes of memory. */
820 DEBUG("Preparing %zu update commands", num_cmds);
822 /* Make a copy of the update commands, in the process doing certain
823 * canonicalizations on paths (e.g. translating backslashes to forward
824 * slashes). This is done to avoid modifying the caller's copy of the
826 ret = copy_update_commands(cmds, num_cmds, &cmds_copy);
830 /* Perform additional checks on the update commands before we execute
832 ret = check_update_commands(cmds_copy, num_cmds, &wim->hdr);
834 goto out_free_cmds_copy;
836 /* Actually execute the update commands. */
837 DEBUG("Executing %zu update commands", num_cmds);
838 ret = execute_update_commands(wim, cmds_copy, num_cmds, update_flags,
841 goto out_free_cmds_copy;
843 wim->image_metadata[image - 1]->modified = 1;
845 /* Statistics about the WIM image, such as the numbers of files and
846 * directories, may have changed. Call xml_update_image_info() to
847 * recalculate these statistics. */
848 xml_update_image_info(wim, image);
850 free_update_commands(cmds_copy, num_cmds);