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