]> wimlib.net Git - wimlib/blobdiff - doc/imagex-update.1.in
imagex-update.1.in: Explain --command quoting
[wimlib] / doc / imagex-update.1.in
index 691d02ca5831e58071abd7cea4a62a507f9fc6ff..f4f9f8463d20d9f6618f8cd93d7f8d101c14fd9a 100644 (file)
@@ -1,43 +1,37 @@
-.TH IMAGEX "1" "April 2013" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
+.TH IMAGEX "1" "May 2013" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
 .SH NAME
 @IMAGEX_PROGNAME@-update \- Update a WIM image
-
 .SH SYNOPSIS
-\fB@IMAGEX_PROGNAME@ update\fR \fIWIMFILE\fR [\fIIMAGE\fR] [\fIOPTION\fR...] < \fICMDFILE\fR
-
+\fB@IMAGEX_PROGNAME@ update\fR \fIWIMFILE\fR [\fIIMAGE\fR] [\fIOPTION\fR...] [< \fICMDFILE\fR]
 .SH DESCRIPTION
-.PP
-
 \fB@IMAGEX_PROGNAME@ update\fR modifies the specified \fIIMAGE\fR in the Windows
 Imaging (WIM) file \fIWIMFILE\fR by adding, deleting, or renaming files or
 directories in it.
-
+.PP
 \fIIMAGE\fR specifies the image in \fIWIMFILE\fR to update.  It may be a 1-based
 index of an image in the WIM or the name of an image in the WIM.  Use the
 \fB@IMAGEX_PROGNAME@ info\fR (1) command to list the images a WIM file contains.
 \fIIMAGE\fR may be omitted if \fIWIMFILE\fR contains only one image.
-
+.PP
 The modifications to perform on the WIM image are specified as a sequence of
 commands, one per line, read in a text file from standard input.  It is
 recommended that standard input be redirected from a file (\fICMDFILE\fR), as
-shown above, rather than typing in commands interactively.
-
+shown above, rather than typing in commands interactively.  Alternatively, to
+specify a command directly on the command line, see the \fB--command\fR option.
 .SH AVAILABLE COMMANDS
-
 This section documents the commands that may appear in the \fICMDFILE\fR
 described above.
-
 .SS \fBadd\fR [\fIOPTION\fR...] \fISOURCE\fR \fIDESTINATION\fR
-Adds a file or directory tree to the WIM image.  \fISOURCE\fR must specify the
+Add a file or directory tree to the WIM image.  \fISOURCE\fR must specify the
 path to a file or directory on your filesystem.  \fIDESTINATION\fR must specify
 the path inside the WIM image at which to add the file or directory tree.  If
-\fIDESTINATION\fR already exists in the WIM image, then an overlay is attempted;
-this can be used to add multiple files to an existing directory in the WIM image
-in one command.  If \fIDESTINATION\fR does not exist, then any prerequisite
-directories are created as needed to add the \fISOURCE\fR at that location.
-
+\fIDESTINATION\fR already exists in the WIM image, then an overlay is attempted
+if it is a directory; this feature can be used to add multiple files to an
+existing directory in the WIM image in one command.  If \fIDESTINATION\fR does
+not exist in the WIM image, then any prerequisite directories are created as
+needed to add the \fISOURCE\fR at that location.
+.PP
 The available options for the \fBadd\fR command are:
-
 .TP 6
 \fB--verbose\fR
 Print the names of files as they are captured.
@@ -65,13 +59,11 @@ possible without always requiring Administrator privileges.  However, if you
 desire that all security descriptors be captured exactly, you may wish to
 provide this option, although the Administrator should have permission to read
 everything anyway.
-
 .SS \fBdelete\fR [\fIOPTION\fR...] \fIPATH\fR
-Deletes a file or directory tree from the WIM image.  \fIPATH\fR must specify the
+Delete a file or directory tree from the WIM image.  \fIPATH\fR must specify the
 path inside the WIM image of the file or directory tree to delete.
-
+.PP
 The available options for the \fBdelete\fR command are:
-
 .TP 6
 \fB--force\fR
 Do not issue an error if the path to delete does not exist.
@@ -79,23 +71,19 @@ Do not issue an error if the path to delete does not exist.
 \fB--recursive\fR
 Delete the file or directory tree recursively; if not specified, an error is
 issued if the path to delete is a directory.
-
 .SS \fBrename\fR \fIOLD_PATH\fR \fINEW_PATH\fR
-Renames a file or directory tree inside the WIM image.  \fIOLD_PATH\fR must
+Rename a file or directory tree inside the WIM image.  \fIOLD_PATH\fR must
 specify the old path of the file or directory tree inside the WIM image, and
 \fINEW_PATH\fR must specify the new path for the file or directory tree.  This
 command follows the semantics of the POSIX \fBrename\fR (3) function; in
 particular, a pre-existing file at \fINEW_PATH\fR will be deleted if present,
 except in certain cases such as attempting to rename a directory to a
 non-directory, which is not allowed.
-
+.PP
 There are no options available for the \fBrename\fR command.
-
 .SH OPTIONS
-
 The following options are accepted on the command line by \fB@IMAGEX_PROGNAME@
 update\fR itself:
-
 .TP 6
 \fB--verbose\fR
 Use \fB--verbose\fR for all \fBadd\fR commands.
@@ -137,44 +125,62 @@ Rebuild the entire WIM rather than appending the updated data to the end of it.
 Rebuilding the WIM is slower, but will save a little bit of space that would
 otherwise be left as a hole in the WIM.  Also see
 \fB@IMAGEX_PROGNAME@-optimize\fR (1).
-
+.TP
+\fB--command\fR=\fISTRING\fR
+Instead of reading update commands from standard input, read a single update
+command directly from the string \fISTRING\fR specified on the command line.
+This option cannot be provided more than one time and cannot be used to specify
+more than one update command.  Note that the \fISTRING\fR, as well as any
+paths containing spaces within the \fISTRING\fR must be appropriately quoted.
+If running from cmd.exe on Windows, you should use double quotes for the outer
+quotes and single quotes for the inner quotes.  Example:
+.RS
+.RS
+.PP
+.nf
+@IMAGEX_PROGNAME@ update boot.wim 1 --command="add 'C:\\My Dir' '\\My Dir'"
+.RE
+.RE
+.fi
 .SH NOTES
-
 \fB@IMAGEX_PROGNAME@ update\fR is partly redundant with \fB@IMAGEX_PROGNAME@
 mountrw\fR, since if a WIM image can be mounted read-write, then there
 theoretically is no need for \fB@IMAGEX_PROGNAME@ update\fR.  The main advantage
 of \fB@IMAGEX_PROGNAME@ update\fR is that it works on both UNIX and Windows,
 whereas \fB@IMAGEX_PROGNAME@ mountrw\fR only works on UNIX.
-
+.PP
 Symbolic links inside a WIM image are not dereferenced when being interpreted.
 So, for example, if you have a WIM image that contains a symbolic link
 "/Documents and Settings" -> "/Users" where "/Users" is a directory, then a
 subdirectory named "Public" in this directory must be specified as
 "/Users/Public" rather than "/Documents and Settings/Public".
-
+.PP
 All paths to files or directories within the WIM image must be specified
 relative to the root of the image.  However, the leading slash is optional, and
-both forward slashes and backslashes are accepted.
-
+both forward slashes and backslashes are accepted.  In addition, on Windows, the
+paths are treated case-insensitively, while on UNIX, the paths are treated
+case-sensitively.
+.PP
 The command file (\fICMDFILE\fR) is parsed by \fB@IMAGEX_PROGNAME@ update\fR
 itself and not by the system shell.  Therefore, its syntax is limited.  However,
 comment lines beginning with '#' are allowed, and it is also possible to quote
 arguments with whitespace inside them.
-
+.PP
 On UNIX, you cannot use \fB@IMAGEX_PROGNAME@ update\fR to add files to an image
 directly from a NTFS volume using libntfs-3g, even though \fB@IMAGEX_PROGNAME@
 capture\fR supports capturing a full image this way.
-
+.PP
 It is safe to abort an \fB@IMAGEX_PROGNAME@ update\fR command partway through;
 however, after doing this, it is recommended to run \fB@IMAGEX_PROGNAME@
 optimize\fR to remove any data that was appended to the physical WIM file but
 not yet incorporated into the structure of the WIM, unless \fB--rebuild\fR was
 specified, in which case you should delete the temporary file left over.
-
 .SH EXAMPLES
-
+All the examples below show the update command file to be created as well as the
+\fB@IMAGEX_PROGNAME@ update\fR command to run to perform the updates.
+.PP
 Delete two files from a WIM image:
-
+.PP
 .RS
 \fIupdate_commands.txt\fR:
 .RS
@@ -185,16 +191,16 @@ delete /sources/setup.exe
 .fi
 .RE
 .RE
-
+.PP
 .RS
 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
 .RE
-
+.PP
 Add some files and directories to a WIM image.  Note that the first path of each
 \fBadd\fR command specifies the files to add, while the second path of each
-\fBadd\fR command specify the locations at which to to add them \fIinside the
-WIM image\fR:
-
+\fBadd\fR command specify the locations at which to to add them inside the WIM
+image:
+.PP
 .RS
 \fIupdate_commands.txt\fR:
 .RS
@@ -205,13 +211,13 @@ add somefile    /dir/file
 .fi
 .RE
 .RE
-
+.PP
 .RS
 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
 .RE
-
+.PP
 Rename a file inside a WIM image.
-
+.PP
 .RS
 \fIupdate_commands.txt\fR:
 .RS
@@ -221,14 +227,14 @@ rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
 .fi
 .RE
 .RE
-
+.PP
 .RS
 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
 .RE
-
+.PP
 Using additional features, such as comments, options, and overlays, and
 including an integrity table in the updated WIM:
-
+.PP
 .RS
 \fIupdate_commands.txt\fR:
 .RS
@@ -257,11 +263,11 @@ delete --recursive /Users/Me/Documents/Junk
 .fi
 .RE
 .RE
-
+.PP
 .RS
 $ @IMAGEX_PROGNAME@ update boot.wim 2 --check < update_commands.txt
 .RE
-
+.PP
 .SH SEE ALSO
 .BR @IMAGEX_PROGNAME@ (1)
 .BR @IMAGEX_PROGNAME@-capture (1)