lundi 2 avril 2012

Add a driver to a wim image (offline and online)

Offline


2003 environment

1) Open a command prompt.

2) Go to the directory where you can use imagex utility.
cd "c:\Program files\Symantec\Ghost\PETools\x86\"
3) Mount your wim image in a directory you created for this purpose
imagex /mountrw "D:\Program Files\TFTPBOOT\boot\winpe.wim" 1 d:\IMG\mount
4) Add your driver
peimg.exe /inf=D:\IMG\drivers\VISTAX32\E1K6032.INF /image="d:\IMG\mount"
5) Unmount an commit the changes
imagex /unmount /commit D:\IMG\mount

2008 environment

In 2008, you can use DISM (Deployment Image Servicing and Management), and the best is that this tool is integrated with Windows 2008.

1) Open a command prompt.

2) If you have multiple editions in your wim image, get the index of edition to be modified
dism /get-wiminfo /Wimfile:C:\tmp\winpe.wim
3) Mount your wim image in a directory you created for this purpose
dism /Mount-Wim /WimFile:C:\tmp\winpe.wim /Index:1 /MountDir:C:\tmp\mount
4) List out drivers already present in this wim
dism /image:C:\tmp\mount /get-drivers
5) Add your third party driver (in my case it was an Intel 82579LM and 82579V Gigabit Ethernet Driver)
dism /image:C:\tmp\mount /add-driver /driver:C:\tmp\WIN7x32\E1C6232.inf
6) Unmount and commit your image
dism /unmount-Wim  /MountDir:C:\tmp\mount /commit

----------------------

Online

In my case, I had to add a NIC driver to boot in PXE/TFTP mode and make an image of a laptop with GostCast Server.

When I boot on LAN, in Ghost32, I do not have network. So I dynamically loaded the drivers provided by HP with the tool drvload that I have added to my wim image.

I downloaded the drivers, saved on a USB drive and loaded the key into the laptop. Then I loaded the drivers for vista, and it does not works. I finally used drivers for Seven and when I try ipconfig /renew, the laptop get an IP. Then I add this driver to my wim image with dism.

In your winpe environment, type

drvload.exe inf_path