From: Eric Biggers Date: Sun, 4 Aug 2013 15:36:05 +0000 (-0500) Subject: mkwinpeimg: Improve preceding commit X-Git-Tag: v1.5.0~86 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=c772c186e1e2b85aceed1f0d4ef115fb01d23425;hp=2e3a41a25a16fdba5ee2293d3c7fc05d276d399f mkwinpeimg: Improve preceding commit - 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 --- diff --git a/doc/mkwinpeimg.1.in b/doc/mkwinpeimg.1.in index f243d828..fb47fd2e 100644 --- a/doc/mkwinpeimg.1.in +++ b/doc/mkwinpeimg.1.in @@ -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 diff --git a/programs/mkwinpeimg.in b/programs/mkwinpeimg.in index 9aa8cb11..cb997fe1 100755 --- a/programs/mkwinpeimg.in +++ b/programs/mkwinpeimg.in @@ -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