How to use FOG to supply machine specific drivers for Windows 7 Sysprepped machines
-
You are right. You need suppress the Found New Hardware Wizard.
To do it, in XP 32 bits:
[QUOTE]
[I]To fix the issue in Windows XP 32-bit versions, add a DWORD value that is named “SuppressNewHWUI” to the following registry subkey: [/I]
[I] HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceInstall\Settings [/I]
[I] To configure this registry setting, follow these steps: [/I]
[LIST=1]
[][I]Click [B]Start[/B], click [B]Run[/B], type regedit, and then click [B]OK[/B].[/I]
[][I]Locate the following subkey in the registry, and then click it: [/I]
[I] HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DeviceInstall\Settings [/I]
[][I]On the [B]Edit[/B] menu, point to [B]New[/B], and then click [B]DWORD Value[/B]. [/I]
[][I]Type SuppressNewHWUI for the name of the DWORD entry, and then press [B]ENTER[/B].[/I]
[][I]Right-click [B]SuppressNewHWUI[/B], and then click [B]Modify[/B]. [/I]
[][I]Do one of the following: [/I]
[LIST]
[][I]To suppress messages, type 1 in the [B]Value data[/B] box, and then click [B]OK[/B].[/I]
[][I]To stop suppressing messages, type 0 in the [B]Value data[/B] box, and then click [B]OK[/B].[/I]
[/LIST]
[*][I]Exit Registry Editor, and then restart the computer. [/I][I][B]Note[/B] The setting does not take effect until the computer is restarted.[/I][/LIST][/QUOTE][LIST=1]
[/LIST]
To see all microsoft article, [URL=‘http://support.microsoft.com/kb/938596/en-us’]here[/URL] -
I really liked Andrew’s idea of copying machine specific drivers.
I changed his script slightly and incorporated it with some other changes I have done to funcs.sh
[quote=“Andrew Single, post: 3130, member: 1006”]
machine=
dmidecode -s system-product-name
;
machine2=${machine// /};
…
echo -n " * Copying $machine Drivers…";
cp -r /images/drivers/${machine// /} /ntfs/Drivers[/quote]
Became
[CODE]machine=
dmidecode -s system-product-name
;
machine=“${machine%”${machine##[![:space:]]}“}” # Remove trailing whitespace
ln -s “/images/drivers/${machine}/” /root/mydrivers
…
echo -n " * Copying $machine Drivers…";
cp -r /root/mydrivers/ /ntfs/Drivers
[/CODE]The symbolic link is just a simple way to overcome the space-in-path-names problem, so I can have folder names just as they appear under “System Product” in the FOG hardware inventory.
Bjorn
-
Solid solution. I like it.
[quote=“Andrew Single, post: 3130, member: 1006”]
I have FOG triggering this function after the Disk Cleanup stage, where it does the NTFS extend. It’s then copying drivers from /images/drivers/Common, and then /images/drivers/Optiplex745 (Or whatever model it pulls)
[/quote]I know this is a bit of a thread resurrection, but if you still check this thread, could you quickly walk us through how to set up the script so FOG automatically kicks it off? I’m sure I could figure out the syntax, but I’m not sure where to look.
-
In order to make use of Andrew’s modification, you start by [URL=‘http://www.fogproject.org/wiki/index.php/Modifying_the_Init_Image’]modifying the init image[/URL]. The modifications you want to do is as follows:
Edit the file initmountdir/bin/fog (path as in wiki link above), and add a call to the new function. I added it just before the call to changeHostname() around line 606, like this:
[CODE]…
if [ “$capone” != “1” ]; thencopyDrivers #Copy machine specific drivers changeHostname
…[/CODE]
Then, you add the function to the file initmountdir/usr/share/fog/lib/funcs.sh, somewhere in the file, i put it at the very end:
[CODE]copyDrivers()
{
machine=dmidecode -s system-product-name
;
machine=“${machine%”${machine##[![:space:]]}“}” #Remove trailing spaces
echo " “;
echo " * FOG Driver copy for $machine”;
echo " “;
mkdir /ntfs &>/dev/null
if [ “$osid” = “5” ]
then
ntfs-3g -o force,rw $win7sys /ntfs
elif [ “$osid” = “1” ]
then
ntfs-3g -o force,rw $part /ntfs
fi
ln -s “/images/drivers/${machine}/” /root/mydrivers
mkdir /ntfs/Drivers >/dev/null
echo -n " * Copying Common Drivers…”;
cp -r /images/drivers/Common/ /ntfs/Drivers
echo “Done.”;
echo -n " * Copying $machine Drivers…";
cp -r /root/mydrivers/* /ntfs/Drivers
umount /ntfs
echo “Done.”;
echo " “;
echo " * Driver copy completed.”;
sleep 2;
}[/CODE]Follow the wiki link on how to save the modified init back into place.
Then you add your drivers to your fog server, placing them under /images/drivers/<product name>, and modify your Windows 7 image, so that it [URL=‘http://support.microsoft.com/kb/254078’]looks for new drivers[/URL] under C:\Drivers (use the registry mod, adding the path to
[LEFT][FONT=Segoe UI][COLOR=#333333]HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\DevicePath.)[/COLOR][/FONT][/LEFT] -
This post is deleted! -
If you are lazy, like me, you can let FOG change the registry setting in your images, so you don’t have to create new ones. Then the function should look like this:
[CODE]copyDrivers()
{
machine=dmidecode -s system-product-name
;
machine=“${machine%”${machine##[![:space:]]}“}” #Remove trailing spaces
echo " “;
echo " * FOG Driver copy for $machine”;
echo " “;
mkdir /ntfs &>/dev/null
if [ “$osid” = “5” ]
then
ntfs-3g -o force,rw $win7sys /ntfs
elif [ “$osid” = “1” ]
then
ntfs-3g -o force,rw $part /ntfs
fi
ln -s “/images/drivers/${machine}/” /root/mydrivers
mkdir /ntfs/Drivers >/dev/null
echo -n " * Copying Common Drivers…”;
cp -r /images/drivers/Common/ /ntfs/Drivers
echo “Done.”;
echo -n " * Copying $machine Drivers…";
cp -r /root/mydrivers/* /ntfs/Driversregfile="/ntfs/Windows/System32/config/SOFTWARE" key1="\Microsoft\Windows\CurrentVersion\DevicePath" devicepath="%SystemRoot%\inf;C:\Drivers" reged -e "$regfile" &>/dev/null <<EOFREG
ed $key1
$devicepath
q
y
EOFREGumount /ntfs echo "Done."; echo " "; echo " * Driver copy completed."; sleep 2;
}[/CODE]
-
Oh that reg bit is interesting too. I like that.
I actually currently have all the drivers saved locally to c:\drivers on my image, and the reg pointed in the right direction. What I was really interested in was using that script, but instead of copying drivers over, copying over some scripts to silently set up the computer post-image. I currently have the scripts located on the image, but it seems a bit ridiculous to take the hours to update the VM, take a snapshot of it, copy the scripts over, seal it up, and reupload it when I could just use this fantastic bit of code to push the scripts to my FOG server, have it upload them to the newly imaged computer, and be done with it.
-
Here’s another question for you: is there a way to pull drivers/scripts/whatever off of a network drive or shared drive?
My FOG server is currently in a guest VM with the host’s hard drive mounted as /media/localshare. What I would like to do is have the script also kick off this command:
cp -r /media/localshare/scripts/* /images/scripts
to make sure the scripts being pushed are the most recent, without having to log in to the VM and run that command by hand every time I make an update to them. Will I have to re-mount the network drive inside of the FOG script, even though the drive is always mounted on the FOG server? (my first thought was to use ln -s to make a link to the network drive, but that didn’t work for me either).
-
The Drivers function is a fantastic addition to FOG but i struggle with drivers for each dell model. What do you guys do for drivers? because the driverpacks are quite outdated or bloated with unneccessary drivers, the .cab files on the dell website aren’t as up to date as the individual drivers listed and downloading each driver is tedious and time consuming and also only want to have whats required (.inf and files) to keep it as unbloated as possible. what do you recommend?
Cheers
-
I actually use the cab files on the Dell site, plus a few extra (my company often orders different network cards, and those aren’t in the cab files by default). A lot of the files may not be 100% up to date, but they sure are close.
If you absolutely must have the newest drivers, you could look into using Microsoft’s Deployment Toolkit (MDT). You can use the deployment workbench to strip drivers down to the minimum using the Import Drivers function for the “Out-of-Box” drivers. You can use it to pull drivers off of a 100% functioning computer too (but be careful: it’ll often pull in a bunch of drivers that are unnecessary, depending on what’s all been installed on the computer).
That being said, it’s a little bit tedious as well. You could always try Dell’s automatic update client, allow it to download drivers, then use MDT to convert them to a deployable form. I’ve never had much luck with their update client, though.
-
Thanks for the info, it’s not so much having the newest but the minimal without having an in-complete drivers set. will start with the .cabs and see how it goes thanks again dvlsg
-
No problem. And if you need to fill the holes, you can always use the MDT to grab the extra stuff. My only experience is with the D and E series laptops, but the only extra driver I had to add in with MDT was an Intel Centrino wireless driver, and I believe that’s only because they aren’t standard parts for Dell machines.
-
Hi all,
i’m getting “can’t stat no such file or directory” when trying to copy the drivers… example directory is /images/Drivers/WinXP/Optiplex 755 on imaging node and relevant code is:
ln -s “/images/Drivers/WinXP/${machine}/” /root/mydrivers;
cp -r /root/mydrivers/* /ntfs/WINDOWS/TestDrivers; # folder already exists on the imagei must be doing something silly because when i run the code directly on the server through ssh it works! (change destination directory obviously)… i’ve checked all paths and been conscious of case sensitive. what am i doing wrong? :-S oh and $machine is working it (correct name without trailing space etc… got that code above this section. i’m also not adding it as a function, i want to include it directly into fog code itself (bin/fog)
-
This post is deleted! -
This worked:
machine=dmidecode -s system-product-name
;
machine=“${machine%”${machine##[![:space:]]}“}”; # Remove trailing whitespace
echo -n " * Downloading $machine Drivers…";
cp -r /images/Drivers/WinXP/“Optiplex 755”/ /ntfs/WINDOWS/TestDrivers; #Hardcoded Model/$machinehowever changing:
[I]cp -r /images/Drivers/WinXP/“Optiplex 755”/* /ntfs/WINDOWS/TestDrivers; [/I]#Hardcoded Model/$machine
to
[I]cp -r /images/Drivers/WinXP/“[B]$machine[/B]”/* /ntfs/WINDOWS/TestDrivers;[/I]
or
cp -r /images/Drivers/WinXP/“[B]{$machine}[/B]”/* /ntfs/WINDOWS/TestDrivers;fails. i’m pulling my hair out now! lol
-
This worked:
machine=“Optiplex 755”
[I]cp -r /images/Drivers/WinXP/“[B]$machine[/B]”/* /ntfs/WINDOWS/TestDrivers;[/I][I]so somethings going wrong with the following two lines but i can’t see what because if you print the variable within an echo it displays as it should (no space before or after but one space in between i.e Optiplex 755)[/I]
[B]machine=dmidecode -s system-product-name
;[/B]
[B]machine=“${machine%”${machine##*[![:space:]]}“}”; # Remove trailing whitespace[/B] -
i can’t get the script to work even if i follow the instructions step by on the first page and have the same directories etc… i’m close to giving up
-
Hmm… the difference that stands out to me is the fact that you currently have the folder in place on the image, but the other scripts are creating it. Maybe a permissions issue? But then the fact that you can do it by “hand”… I guess i’m not sure.
If using just “$machine” is working for you, is there a reason you cant just use that?
-
If it makes you feel better, I uploaded a new image over the weekend and now I’m having errors too, haha.
Something about not having enough white space for the CP. Reuploading right now to see the error again…
-
Ah. Yeah, it doesn’t actually perform the clean up, and as a result doesn’t perform the ntfs extend.
The only real difference I can see here is that one image is single partition resizable, and one image is multi-disk single partition non-resizable.
I’m guessing that it’s not running an ntfs extend by design for the multi-disk single partition image. Maybe. Is anyone else who is using this function using an image type other than single partition?