diff --git a/xCAT-server/share/xcat/netboot/windows/genimage.bat b/xCAT-server/share/xcat/netboot/windows/genimage.bat index 16d78bf2f..df456e5b9 100644 --- a/xCAT-server/share/xcat/netboot/windows/genimage.bat +++ b/xCAT-server/share/xcat/netboot/windows/genimage.bat @@ -38,6 +38,7 @@ if [%ARCH%] EQU [amd64] copy c:\WinPE_%SUFFIX%\pxe\Boot\BCD.%SUFFIX% c:\WinPE_% dism /mount-wim /wimfile:c:\WinPE_%SUFFIX%\pxe\Boot\winpe_%SUFFIX%.wim /index:1 /mountdir:c:\WinPE_%SUFFIX%\rootfs copy startnet.cmd c:\WinPE_%SUFFIX%\rootfs\Windows\system32 +copy getnextserver.exe c:\WinPE_%SUFFIX%\rootfs\Windows\system32 copy "C:\Program Files\Windows AIK\Tools\%ARCH%\imagex.exe" c:\WinPE_%SUFFIX%\rootfs\Windows\system32 dism /Image:c:\WinPE_%SUFFIX%\rootfs /add-package /packagepath:"C:\Program Files\Windows AIK\Tools\PETools\%ARCH%\WinPE_FPs\winpe-wmi.cab" dism /Image:c:\WinPE_%SUFFIX%\rootfs /add-package /packagepath:"C:\Program Files\Windows AIK\Tools\PETools\%ARCH%\WinPE_FPs\winpe-scripting.cab" @@ -46,7 +47,7 @@ copy c:\WinPE_%SUFFIX%\rootfs\Windows\Boot\PXE\wdsmgfw.efi c:\WinPE_%SUFFIX%\pxe copy c:\WinPE_%SUFFIX%\rootfs\Windows\Boot\EFI\bootmgfw.efi c:\WinPE_%SUFFIX%\pxe\Boot\bootmgfw.efi copy c:\WinPE_%SUFFIX%\rootfs\Windows\Boot\EFI\bootmgr.efi c:\WinPE_%SUFFIX%\pxe\Boot\bootmgr.efi copy c:\WinPE_%SUFFIX%\rootfs\Windows\Boot\PXE\bootmgr.exe c:\WinPE_%SUFFIX%\pxe\ -for /r c:\drivers %%d in (*.inf) do dism /image c:\WinPE_%SUFFIX%\rootfs /add-driver /driver:%%d +for /r c:\drivers %%d in (*.inf) do dism /image:c:\WinPE_%SUFFIX%\rootfs /add-driver /driver:%%d dism /Unmount-Wim /commit /mountdir:c:\WinPE_%SUFFIX%\rootfs echo Upload c:\WinPE_%SUFFIX%\pxe to somewhere diff --git a/xCAT-server/share/xcat/netboot/windows/startnet.cmd b/xCAT-server/share/xcat/netboot/windows/startnet.cmd index a63f63abb..f2929f633 100644 --- a/xCAT-server/share/xcat/netboot/windows/startnet.cmd +++ b/xCAT-server/share/xcat/netboot/windows/startnet.cmd @@ -9,11 +9,16 @@ echo "Dhcpv6DUID"=hex:00,04,%guid:~0,2%,%guid:~2,2%,%guid:~4,2%,%guid:~6,2%,%gui echo. >> duiduuid.reg regedit /s duiduuid.reg wpeinit -ping -n 60 127.0.0.1 > NUL 2>&1 +start /min cmd +for /f %%A IN ('getnextserver.exe') DO SET XCATD=%%A +echo Waiting for xCAT server %XCATD% to become reachable (check WinPE network drivers if this does not proceeed) +:noping +ping -n 1 %XCATD% 2> NUL | find "TTL=" > NUL || goto :noping md \xcat -for /f "delims=: tokens=2" %%c in ('ipconfig /all ^|find "DHCP Server"') do set XCATD=%%c -for /f %%c in ('echo %XCATD%') do set XCATD=%%c -net use i: \\%XCATD%\install +echo Waiting for successful mount of \\%XCATD%\install (if this hangs, check that samba is running) +:nomount +net use i: \\%XCATD%\install || goto :nomount +echo Successfully mounted \\%XCATD%\install, moving on to execute remote script for /f "delims=: tokens=2" %%c in ('ipconfig ^|find "IPv4 Address. . ."') do set NODEIP=%%c for /f %%c in ('echo %NODEIP%') do set NODEIP=%%c if exist i:\autoinst\%NODEIP%.cmd copy i:\autoinst\%NODEIP%.cmd x:\xcat\autoscript.cmd