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