I’m attempting to use this in our image deployment to push drivers and am having some trouble that is hopefully not difficult to overcome, I’m just not real script savvy. I have placed my drivers in the /images/Drivers folder and my fog.postdownload is as follows:
#!/bin/sh
if [ $osid == "5" -o $osid == "6" -o $osid == "7" ]; then #only handling Win7/8/8.1
clearScreen;
mkdir /ntfs &>/dev/null
ntfs-3g -o force,rw $part /ntfs
# mkdir /fog &>/dev/null
# mount -o nolock,proto=tcp $storageip:/fog/ /fog
# dots "Mounting Device";
if [ "$?" = "0" ]; then
echo "Done";
. ${postdownpath}fog.drivers
# . ${postdownpath}fog.ad
# . ${postdownpath}fog.snapins
umount /ntfs; # unmount when all is done :-)
else
echo "Failed To Mount Device";
sleep 30;
fi
fi
The computer responds with :
ntfs-3g: No mountpoint is specified
gives lots of usage instructions and options then
Failed to mount device
then restarts after about 30 seconds.
My fog.drivers file is as follows:
#!/bin/sh
ceol=`tput el`;
machine=`dmidecode -s system-product-name`; # Gets machine model
machine="${machine%"${machine##*[![:space:]]}"}" #Removes Trailing Space
#system64="/ntfs/Windows/SysWOW64/regedit.exe"; # dirty way to determine if it's 64bit or not
#if [ -f "$system64" ]; then
# setarch="x64"
#else
# setarch="x86"
#fi
#############################################
#this is not section necessary needed, it's just to make the path "human readable"
#rather than using osid for filepath
if [ $osid == "5" ]; then
osn="Win7"
elif [ $osid == "7" ]; then
osn="Win8.1"
elif [ $osid == "9" ]; then
osn="Win10"
fi
#############################################
dots "Preparing Drivers";
# below creates local folder on imaged pc
#this can be anywhere you want just remember
#to make sure it matches throughout!
mkdir /ntfs/Windows/DRV &>/dev/null;
echo -n "In Progress";
#there's 3 ways you could handle this,
#driver cab file, extracted driver files or both
#so on the server put extracted driver files to match below folder tree
#i.e. Model Latitude E5410, Windows 7 x86 image would be:
#/images/Drivers/Win7/Latitude E5410/x86
rsync -aqz "/images/Drivers/$osn/${machine}/*.*" /ntfs/Windows/DRV &>/dev/null;
#if you wanted to use driver.cab use this line below.
#i.e. /images/Drivers/Win7/Latitude E5410/E5410-Win7-A07-KTT4G.CAB
#cabextract -d /ntfs/Windows/DRV "/images/Drivers/$osn/${machine}"/*.CAB &>/dev/null;
#if you wanted to mix both cab and extracted use these next two lines:
# rsync -aqz --exclude='*.CAB' "/images/Drivers/$osn/${machine}/$setarch" /ntfs/Windows/DRV &>/dev/null;
# cabextract -d /ntfs/Windows/DRV "/images/Drivers/$osn/${machine}"/*.CAB &>/dev/null;
#this next bit adds driver location on pc to devicepath in registry (so sysprep uses it to reference)
# remember to make devicepath= match the path you've used locally
#also do not remove %SystemRoot%\inf
#and to add more locations just use ; in between each location
regfile="/ntfs/Windows/System32/config/SOFTWARE"
key="\Microsoft\Windows\CurrentVersion\DevicePath"
devpath="%SystemRoot%\inf;%SystemRoot%\DRV";
reged -e "$regfile" &>/dev/null <<EOFREG
ed $key
$devpath
q
y
EOFREG
echo -e "\b\b\b\b\b\b\b\b\b\b\b${ceol}Done"; # this just removes "In Progress and replaces it with done :-)"
Would you be able to assist?
Thanks,
Gregg W.