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