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