[ipxe-devel] wimboot

Marek Salwerowicz marek_sal at wp.pl
Thu Sep 27 11:45:03 UTC 2012

W dniu 2012-09-27 01:28, Michael Brown pisze:
> I have tested with iSCSI; WinPE_is_  able to see (and install to) the
> sanhooked drive.  There's an annoying 60-second timeout while Windows waits to
> see if the (virtual) boot disk is going to show up as an iSCSI disk, but once
> it times out it does all work as expected.
Sorry, you were right - the iSCSI target is visible.

But I had to replace the BCD and bootmgr files - I took them from 
Windows7 Pro ISO image
Is it possible to take it from WinPE we create ?

> How did you create your WinPE image?

I am using the Windows 2012 Server and ADK 8.
My script for creating both amd64 and x86 versions and BCD with 
interactive bootmenu is in attachment.
It works in my PXE environment.


-------------- next part --------------
set BCD_CMD=%systemroot%\system32\bcdedit
set WRK_DIR=c:\tmp\ms
set TFTP_SIZE=8192
set ARCH=x86
set ADK_DIR="C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Environment"

if exist %WRK_DIR% rmdir %WRK_DIR% /s /q
mkdir %WRK_DIR%
mkdir %WRK_DIR%\Boot
echo ------------%ARCH%---------------

call copype %ARCH% %WRK_DIR%\%ARCH%
rem pause
echo direcotry Boot - copy to TFTP server
md %WRK_DIR%\%ARCH%\Boot
copy %ADK_DIR%\%ARCH%\Media\Boot\boot.sdi %WRK_DIR%\%ARCH%\Boot

rem pause
echo mount image in RW mode

dism /Mount-Image /imagefile:%WRK_DIR%\%ARCH%\media\sources\boot.wim /mountdir:%WRK_DIR%\%ARCH%\mount /index:1
rem pause
echo copy PXE environment  and fonts to \Boot 
xcopy %WRK_DIR%\%ARCH%\mount\Windows\Boot\Pxe\* %WRK_DIR%\%ARCH%\Boot /s /e
rem pause
md %WRK_DIR%\%ARCH%\Boot\Fonts 
xcopy %WRK_DIR%\%ARCH%\mount\Windows\Boot\Fonts\* %WRK_DIR%\%ARCH%\Boot\Fonts /s /e
rem pause
copy %WRK_DIR%\%ARCH%\Boot\pxeboot.n12 %WRK_DIR%\%ARCH%\Boot\pxeboot.0

rem pause
echo copy WinPE_OCs - for packages
xcopy %ADK_DIR%\%ARCH%\WinPE_OCs\* %WRK_DIR%\%ARCH%\WinPE_OCs /s /e
rem pause

echo packages list
dism /image:%WRK_DIR%\%ARCH%\mount /Get-Packages
rem pause
echo add packages (if necessary)

rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\WinPE-Scripting.cab
rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\en-us\WinPE-Scripting_en-us.cab
rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\WinPE-WMI.cab
rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\en-us\WinPE-WMI_en-us.cab
rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\WinPE-NetFX4.cab
rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\en-us\WinPE-NetFX4_en-us.cab
rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\WinPE-StorageWMI.cab
rem dism /image:%WRK_DIR%\%ARCH%\mount /add-package /PackagePath:%WRK_DIR%\%ARCH%\WinPE_OCs\en-us\WinPE-StorageWMI_en-us.cab

echo packages list
dism /image:%WRK_DIR%\%ARCH%\mount /Get-Packages
rem pause
echo now edit startnet.cmd (if necessary) and hit Enter
rem pause

echo umount WIM
dism /Unmount-Wim /MountDir:%WRK_DIR%\%ARCH%\mount /commit
rem pause

echo copy WIM to Boot/
copy %WRK_DIR%\%ARCH%\media\sources\boot.wim %WRK_DIR%\%ARCH%\Boot\%ARCH%.wim
copy %WRK_DIR%\%ARCH%\media\sources\boot.wim %WRK_DIR%\Boot\%ARCH%.wim

if %ARCH% EQU amd64 goto bcd
rem pause
set ARCH=amd64
goto start


echo -------------------------BCD---------amd64 and x86----
rem copy PXE
xcopy %WRK_DIR%\%ARCH%\Boot\* %WRK_DIR%\Boot /s /e /y
copy %WRK_DIR%\Boot\pxeboot.n12 %WRK_DIR%\Boot\pxeboot.0

pushd %WRK_DIR%\Boot
%BCD_CMD% -createstore BCD
%BCD_CMD% -store BCD -create {bootmgr} /d "WinPE4 boot salwerom at iem"
%BCD_CMD% -store BCD -set {bootmgr} device boot
%BCD_CMD% -store BCD -set {bootmgr} timeout 60

%BCD_CMD% -store BCD -create {ramdiskoptions}
%BCD_CMD% -store BCD -set {ramdiskoptions} ramdisksdidevice boot
%BCD_CMD% -store BCD -set {ramdiskoptions} ramdisksdipath \Boot\boot.sdi
%BCD_CMD% -store BCD -set {ramdiskoptions} ramdisktftpblocksize %TFTP_SIZE%

for /f " usebackq delims={} tokens=2" %%i IN (`%BCD_CMD% -store BCD -create /d "WinPE4-%ARCH% salwerom at iem" /application osloader`) do set GUID=%%i
echo GUID=%GUID%
%BCD_CMD% -store BCD -set {%GUID%} systemroot \Windows
%BCD_CMD% -store BCD -set {%GUID%} detecthal Yes
%BCD_CMD% -store BCD -set {%GUID%} winpe Yes
%BCD_CMD% -store BCD -set {%GUID%} osdevice ramdisk=[boot]\Boot\%ARCH%.wim
%BCD_CMD% -store BCD -set {%GUID%} device ramdisk=[boot]\Boot\%ARCH%.wim,{ramdiskoptions}
%BCD_CMD% -store BCD /displayorder {%GUID%} /addlast

if %ARCH% EQU x86 goto end
set ARCH=x86
goto bcd-loop

%BCD_CMD% -store BCD -enum all
echo END!

More information about the ipxe-devel mailing list