]> wimlib.net Git - wimlib/commitdiff
mkwinpeimg: Improve preceding commit
authorEric Biggers <ebiggers3@gmail.com>
Sun, 4 Aug 2013 15:36:05 +0000 (10:36 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 4 Aug 2013 15:39:33 +0000 (10:39 -0500)
- Mention in help output and man page that WAIK supplement is supported
- Fix documentation for -w/--wim
- Only check for 'cabextract' when using WAIK, not WAIK supplement
- Fix check for WAIK vs. WAIK supplement
- Print full path when copying boot.wim from WAIK supplement

doc/mkwinpeimg.1.in
programs/mkwinpeimg.in

index f243d8286d089e280ed091ddd1219045232e8ab1..fb47fd2ee08310fb6e46e46af70b84cfab7e1604 100644 (file)
@@ -7,7 +7,8 @@ mkwinpeimg \- Make a customized bootable image of Windows PE
 .SH DESCRIPTION
 \fBmkwinpeimg\fR is able to make a bootable image of Windows PE by taking files
 from a mounted Windows DVD (Windows Vista, Windows 7 or Windows 8) or the
-mounted ISO image for the Windows Automated Installation Kit (WAIK).  The
+mounted ISO image for the Windows Automated Installation Kit (WAIK) or the WAIK
+supplement.  The
 \fB--windows-dir\fR and \fB--waik-dir\fR options are used to specify the
 locations of these mounted ISOs.  You only need one or the other.  The files
 that \fBmkwinpeimg\fR will retrieve are \fIboot.wim\fR, \fIbootmgr\fR,
@@ -59,14 +60,16 @@ Use DIR as the location of the mounted Windows 7 or Windows 8 DVD.  Default is
 \fB\-A\fR, \fB\-\-waik\-dir\fR=\fIDIR\fR
 Get the boot files and boot.wim from the ISO of the Windows Automated
 Installation Kit mounted on DIR instead of from the Windows 7 or Windows 8 DVD.
+This also works if the mounted ISO is for the WAIK supplement rather than the
+WAIK itself.
 .TP
 \fB\-s\fR, \fB\-\-start\-script\fR=\fIFILE\fR
 Add FILE to the root directory of Windows PE image and adjust
 \eWindows\eSystem32\ewinpeshl.ini to execute FILE when Windows PE starts up.
 .TP
 \fB\-w\fR, \fB\-\-wim\fR=\fIWIM\fR
-Use WIM as the "boot.wim" file.  Defaults to "sources/boot.wim" in the Windows DVD
-directory, or F1_WINPE.WIM from the WAIK if \fB\-\-waik\-dir\fR is specified.
+Use WIM as the "boot.wim" file.  This defaults to the appropriate WIM file from
+the Windows DVD, WAIK, or WAIK supplement.
 .TP
 \fB\-O\fR, \fB\-\-overlay\fR=\fIDIR\fR
 Adds all the files in DIR to the Windows PE image.
@@ -75,11 +78,11 @@ Adds all the files in DIR to the Windows PE image.
 Use DIR for temporary files.  Defaults to a directory made using "mktemp -d".
 .TP
 \fB\-a\fR, \fB\-\-arch\fR=\fIARCH\fR
-Use the Windows PE version from the Windows Automated Installation Kit that has
-the CPU architecture \fIARCH\fR.  Only valid with \fB\-\-waik\-dir\fR.  Possible
-values: "x86" or "amd64".  Default is "x86".  Note: the WAIK also contains a
-Windows PE image for the ia64 (Itanium) architecture; however, this is not
-supported by this script.
+Use the Windows PE version from the Windows Automated Installation Kit (or the
+WAIK supplement) that has the CPU architecture \fIARCH\fR.  Only valid with
+\fB\-\-waik\-dir\fR.  Possible values: "x86" or "amd64".  Default is "x86".
+Note: the WAIK also contains a Windows PE image for the ia64 (Itanium)
+architecture; however, this is not supported by this script.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
 Display help.
@@ -94,8 +97,9 @@ installation media mounted on /media/windows:
 mkwinpeimg --windows-dir=/media/windows winpe.img
 .RE
 .PP
-Create a bootable ISO of Windows PE from the WAIK mounted on /media/waik, and
-add all the files in "winpe_overlay" to Windows PE's filesystem:
+Create a bootable ISO of Windows PE from the WAIK (or WAIK supplement) mounted
+on /media/waik, and add all the files in "winpe_overlay" to Windows PE's
+filesystem:
 .RS
 .PP
 mkwinpeimg --iso --waik-dir=/media/waik --overlay=winpe_overlay winpe.iso
index 9aa8cb119d6329bd7d6859bc2a8c239368f603c3..cb997fe128f39968a46d506bf23884ffecf8b067 100755 (executable)
@@ -94,13 +94,14 @@ Usage: $script_name [OPTIONS] IMAGE
   -A, --waik-dir=DIR       Get the boot files and boot.wim from the ISO of the
                               Windows Automated Installation Kit mounted on DIR
                               instead of from the Windows 7 or Windows 8 DVD.
+                              This also works if the mounted ISO is for the
+                              WAIK supplement rather than the WAIK itself.
   -s, --start-script=FILE  Add FILE to the root directory of Windows PE image
                               and adjust \Windows\System32\winpeshl.ini to
                               execute FILE when Windows PE starts up.
-  -w, --wim=WIM            Use WIM as the boot.wim file.  Defaults to
-                              sources/boot.wim in the Windows DVD directory, or
-                              F1_WINPE.WIM from the WAIK if --waik-dir is
-                              specified.
+  -w, --wim=WIM            Use WIM as the boot.wim file.  This defaults to the
+                              appropriate WIM file from the Windows DVD, WAIK,
+                              or WAIK supplement.
   -O, --overlay=DIR        Adds all the files in DIR to the Windows PE image.
   -t, --tmp-dir=DIR        Use DIR as the temporary base of the ISO filesystem.
                               Defaults to making one using "mktemp -d".
@@ -297,7 +298,7 @@ EOF
                fi
        fi
 
-       if [ -n "$waik_dir" ]; then
+       if [ -n "$waik_dir" ] &&  [ -f "$waik_dir"/wAIK${arch}.msi ]; then
                if ! type -P cabextract &> /dev/null ; then
                        cat << EOF
 ERROR: The boot files in the Windows Automated Installation Kit (WAIK) are
@@ -316,7 +317,7 @@ get_primary_boot_files() {
                # Get boot files from the WAIK.
                stat_busy "Copying primary boot files from the Windows Automated Installation Kit ($waik_dir, $arch)"
 
-               if [ -f "$waik_dir"/WAIK${arch}.msi ]; then
+               if [ -f "$waik_dir"/wAIK${arch}.msi ]; then
                        if [ $make = iso ]; then
                                cabextract "$waik_dir"/wAIK${arch}.msi -F F_WINPE_${arch}_etfsboot.com -p \
                                                > "$tmp_dir"/etfsboot.com || stat_fail
@@ -367,7 +368,7 @@ get_boot_wim() {
                                                > "$boot_wim" 2>/dev/null || stat_fail
                        # WAIK supplement has different layout
                        else
-                               stat_busy "Copying boot.wim from ${arch,,}/winpe.wim"
+                               stat_busy "Copying boot.wim from \"${waik_dir}/${arch,,}/winpe.wim\""
                                cp "$waik_dir"/${arch,,}/winpe.wim "$boot_wim" || stat_fail
                                chmod +w "$boot_wim"
                        fi