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