]> wimlib.net Git - wimlib/blob - doc/man1/imagex-update.1.in
f688e6b7aa511d4cc05855e2862590c997dc0387
[wimlib] / doc / man1 / imagex-update.1.in
1 .TH WIMLIB-IMAGEX "1" "March 2014" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
2 .SH NAME
3 @IMAGEX_PROGNAME@-update \- Update a WIM image
4 .SH SYNOPSIS
5 \fB@IMAGEX_PROGNAME@ update\fR \fIWIMFILE\fR [\fIIMAGE\fR] [\fIOPTION\fR...] [< \fICMDFILE\fR]
6 .SH DESCRIPTION
7 \fB@IMAGEX_PROGNAME@ update\fR modifies the specified \fIIMAGE\fR in the Windows
8 Imaging (WIM) file \fIWIMFILE\fR by adding, deleting, or renaming files or
9 directories in it.
10 This command is also available as simply \fBwimupdate\fR if the appropriate
11 hard link or batch file has been installed.
12 .PP
13 \fIIMAGE\fR specifies the image in \fIWIMFILE\fR to update.  It may be a 1-based
14 index of an image in the WIM or the name of an image in the WIM.  Use the
15 \fB@IMAGEX_PROGNAME@ info\fR (1) command to list the images a WIM file contains.
16 \fIIMAGE\fR may be omitted if \fIWIMFILE\fR contains only one image.
17 .PP
18 The modifications to perform on the WIM image are specified as a sequence of
19 commands, one per line, read in a text file from standard input.  It is
20 recommended that standard input be redirected from a file (\fICMDFILE\fR), as
21 shown above, rather than typing in commands interactively.  Alternatively, to
22 specify a command directly on the command line, see the \fB--command\fR option.
23 .SH AVAILABLE COMMANDS
24 This section documents the commands that may appear in the \fICMDFILE\fR
25 described above.
26 .SS \fBadd\fR [\fIOPTION\fR...] \fISOURCE\fR \fIDESTINATION\fR
27 Add a file or directory tree to the WIM image.  \fISOURCE\fR must specify the
28 path to a file or directory on your filesystem.  \fIDESTINATION\fR must specify
29 the path inside the WIM image at which to add the file or directory tree.  If
30 \fIDESTINATION\fR already exists in the WIM image, then an overlay is attempted
31 if it is a directory; this feature can be used to add multiple files to an
32 existing directory in the WIM image in one command.  If \fIDESTINATION\fR does
33 not exist in the WIM image, then any prerequisite directories are created as
34 needed to add the \fISOURCE\fR at that location.
35 .PP
36 The \fBadd\fR command supports a subset of the options accepted by
37 \fB@IMAGEX_PROGNAME@-capture\fR; namely, \fB--dereference\fR,
38 \fB--unix-data\fR, \fB--no-acls\fR, and \fB--strict-acls\fR.  See
39 \fB@IMAGEX_PROGNAME@-capture\fR (1) for explanations of these options.
40 .PP
41 In addition, the \fBadd\fR command supports the \fB--no-replace\fR option, which
42 causes the \fBadd\fR command to refuse to overwrite existing nondirectory files
43 in the WIM image.
44 .SS \fBdelete\fR [\fIOPTION\fR...] \fIPATH\fR
45 Delete a file or directory tree from the WIM image.  \fIPATH\fR must specify the
46 path inside the WIM image of the file or directory tree to delete.
47 .PP
48 The available options for the \fBdelete\fR command are:
49 .TP 6
50 \fB--force\fR
51 Do not issue an error if the path to delete does not exist.
52 .TP
53 \fB--recursive\fR
54 Delete the file or directory tree recursively; if not specified, an error is
55 issued if the path to delete is a directory.
56 .SS \fBrename\fR \fIOLD_PATH\fR \fINEW_PATH\fR
57 Rename a file or directory tree inside the WIM image.  \fIOLD_PATH\fR must
58 specify the old path of the file or directory tree inside the WIM image, and
59 \fINEW_PATH\fR must specify the new path for the file or directory tree.  This
60 command follows the semantics of the POSIX \fBrename\fR (3) function; in
61 particular, a pre-existing file at \fINEW_PATH\fR will be deleted if present,
62 except in certain cases such as attempting to rename a directory to a
63 non-directory, which is not allowed.
64 .PP
65 There are no options available for the \fBrename\fR command.
66 .SH OPTIONS
67 The following options are accepted on the command line by \fB@IMAGEX_PROGNAME@
68 update\fR itself:
69 .TP 6
70 \fB--dereference\fR
71 Use \fB--dereference\fR for all \fBadd\fR commands.
72 .TP
73 \fB--unix-data\fR
74 Use \fB--unix-data\fR for all \fBadd\fR commands.
75 .TP
76 \fB--no-acls\fR
77 Use \fB--no-acls\fR for all \fBadd\fR commands.
78 .TP
79 \fB--strict-acls\fR
80 Use \fB--strict-acls\fR for all \fBadd\fR commands.
81 .TP
82 \fB--no-replace\fR
83 Use \fB--no-replace\fR for all \fBadd\fR commands.
84 .TP
85 \fB--config\fR=\fIFILE\fR
86 Set the capture configuration file for all \fBadd\fR commands.  See the
87 description of this option in \fB@IMAGEX_PROGNAME@-capture\fR (1).
88 .TP
89 \fB--force\fR
90 Use \fB--force\fR for all \fBdelete\fR commands.
91 .TP
92 \fB--recursive\fR
93 Use \fB--recursive\fR for all \fBdelete\fR commands.
94 .TP
95 \fB--check\fR
96 When reading \fIWIMFILE\fR, verify its integrity if the integrity table is
97 present; in addition, include an integrity table in the updated WIM.  If this
98 option is not specified, an integrity table will be included in the updated WIM
99 if and only if one was present before.
100 .TP
101 \fB--threads\fR=\fINUM_THREADS\fR
102 Number of threads to use for compressing newly added files.  Default: autodetect
103 (number of processors).
104 .TP
105 \fB--rebuild\fR
106 Rebuild the entire WIM rather than appending the updated data to the end of it.
107 Rebuilding the WIM is slower, but will save a little bit of space that would
108 otherwise be left as a hole in the WIM.  Also see
109 \fB@IMAGEX_PROGNAME@-optimize\fR (1).
110 .TP
111 \fB--command\fR=\fISTRING\fR
112 Instead of reading update commands from standard input, read a single update
113 command directly from the string \fISTRING\fR specified on the command line.
114 This option cannot be provided more than one time and cannot be used to specify
115 more than one update command.  Note that the \fISTRING\fR, as well as any
116 paths containing spaces within the \fISTRING\fR must be appropriately quoted.
117 If running from cmd.exe on Windows, you should use double quotes for the outer
118 quotes and single quotes for the inner quotes.  Example:
119 .RS
120 .RS
121 .PP
122 .nf
123 @IMAGEX_PROGNAME@ update boot.wim 1 \\
124 .br
125 .RS
126 --command="add 'C:\\My Dir' '\\My Dir'"
127 .RE
128 .RE
129 .RE
130 .fi
131 .SH NOTES
132 \fB@IMAGEX_PROGNAME@ update\fR is partly redundant with \fB@IMAGEX_PROGNAME@
133 mountrw\fR, since if a WIM image can be mounted read-write, then there
134 theoretically is no need for \fB@IMAGEX_PROGNAME@ update\fR.  The main advantage
135 of \fB@IMAGEX_PROGNAME@ update\fR is that it works on both UNIX-like systems and
136 Windows, whereas \fB@IMAGEX_PROGNAME@ mountrw\fR is only available on UNIX-like
137 systems, and even then it only works on those with a compatible FUSE
138 implementation.
139 .PP
140 Symbolic links inside a WIM image are not dereferenced when being interpreted.
141 So, for example, if you have a WIM image that contains a symbolic link
142 "/Documents and Settings" -> "/Users" where "/Users" is a directory, then a
143 subdirectory named "Public" in this directory must be specified as
144 "/Users/Public" rather than "/Documents and Settings/Public".
145 .PP
146 All paths to files or directories within the WIM image must be specified
147 relative to the root of the image.  However, the leading slash is optional, and
148 both forward slashes and backslashes are accepted.  In addition, on Windows, the
149 paths are by default treated case-insensitively, while on UNIX-like systems, the
150 paths are by default treated case-sensitively.  The default case sensitivity may
151 be changed by setting the \fBWIMLIB_IMAGEX_IGNORE_CASE\fR environmental
152 variable to 0 or 1.
153 .PP
154 The command file (\fICMDFILE\fR) is parsed by \fB@IMAGEX_PROGNAME@ update\fR
155 itself and not by the system shell.  Therefore, its syntax is limited.  However,
156 comment lines beginning with '#' are allowed, and it is also possible to quote
157 arguments with whitespace inside them.
158 .PP
159 On UNIX-like systems, you cannot use \fB@IMAGEX_PROGNAME@ update\fR to add files
160 to an image directly from a NTFS volume using libntfs-3g, even though
161 \fB@IMAGEX_PROGNAME@ capture\fR supports capturing a full image this way.
162 .PP
163 It is safe to abort an \fB@IMAGEX_PROGNAME@ update\fR command partway through;
164 however, after doing this, it is recommended to run \fB@IMAGEX_PROGNAME@
165 optimize\fR to remove any data that was appended to the physical WIM file but
166 not yet incorporated into the structure of the WIM, unless \fB--rebuild\fR was
167 specified, in which case you should delete the temporary file left over.
168 .SH EXAMPLES
169 All the examples below show the update command file to be created as well as the
170 \fB@IMAGEX_PROGNAME@ update\fR command to run to perform the updates.
171 .PP
172 Delete two files from a WIM image:
173 .PP
174 .RS
175 \fIupdate_commands.txt\fR:
176 .RS
177 .PP
178 .nf
179 delete /setup.exe
180 delete /sources/setup.exe
181 .fi
182 .RE
183 .RE
184 .PP
185 .RS
186 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
187 .RE
188 .PP
189 Add some files and directories to a WIM image.  Note that the first path of each
190 \fBadd\fR command specifies the files to add, while the second path of each
191 \fBadd\fR command specify the locations at which to to add them inside the WIM
192 image:
193 .PP
194 .RS
195 \fIupdate_commands.txt\fR:
196 .RS
197 .PP
198 .nf
199 add somedir     /dir
200 add somefile    /dir/file
201 .fi
202 .RE
203 .RE
204 .PP
205 .RS
206 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
207 .RE
208 .PP
209 Rename a file inside a WIM image.
210 .PP
211 .RS
212 \fIupdate_commands.txt\fR:
213 .RS
214 .PP
215 .nf
216 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
217 .fi
218 .RE
219 .RE
220 .PP
221 .RS
222 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
223 .RE
224 .PP
225 Using additional features, such as comments, options, and overlays, and
226 including an integrity table in the updated WIM:
227 .PP
228 .RS
229 \fIupdate_commands.txt\fR:
230 .RS
231 .PP
232 .nf
233 #
234 # This file specifies some changes to make to a WIM image.
235 #
236
237 # Add a new directory containing files I want in the image.
238 # The quotes are necessary because the directory name
239 # contains a space.
240 add "My Directory" "/My Directory"
241
242 # Add the contents of "Another Directory" to the
243 # "/My Directory" we just created in the WIM image.  Since
244 # the destination path already exists, this performs an
245 # overlay.
246 add "Another Directory" "/My Directory"
247
248 # Rename some file for some reason.
249 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
250
251 # Delete an unwanted directory.
252 delete --recursive /Users/Me/Documents/Junk
253 .fi
254 .RE
255 .RE
256 .PP
257 .RS
258 $ @IMAGEX_PROGNAME@ update boot.wim 2 --check < update_commands.txt
259 .RE
260 .PP
261 .SH SEE ALSO
262 .BR @IMAGEX_PROGNAME@ (1)
263 .BR @IMAGEX_PROGNAME@-capture (1)
264 .BR @IMAGEX_PROGNAME@-info (1)
265 .BR @IMAGEX_PROGNAME@-mountrw (1)
266 .BR @IMAGEX_PROGNAME@-optimize (1)