#!/bin/bash #driverinstall.sh #Script version .2alpha #2014/11/2 #FOG version 1.2.0 #Copies drivers to a C:\drivers on a universal image based on the hardware #detected on PCI, USB & PNP. Full documentation & How-To's on the FOG Wiki. #http://www.fogproject.org/wiki/index.php/Auto_driver_Install #Andrew Single - Frontier School Division (Frontier loves FOG!) win7sys="/dev/sda2"; mkdir /ntfs 2>/dev/null echo -n " * Mounting Windows File System..................."; mount.ntfs-3g $win7sys /ntfs 2>/tmp/mntfail mntRet="$?"; if [ ! "$mntRet" = "0" ] then echo "Failed to mount C:"; echo ""; echo -n " * "; cat /tmp/mntfail echo ""; sleep 2; else #Mount successful echo "Done."; mkdir /ntfs/Drivers 2>/dev/null echo ""; echo -n " * Copying Common Drivers........................."; cp -r /images/drivers/Common /ntfs/Drivers if [ -d /ntfs/Windows/Setup/Scripts ]; then cp /images/drivers/Common/SetupComplete.cmd /ntfs/Windows/Setup/Scripts/ cat /images/drivers/Common/commoninstall.bat >>/ntfs/Windows/Setup/Scripts/SetupComplete.cmd unix2dos /ntfs/Windows/Setup/Scripts/SetupComplete.cmd echo "Done."; else mkdir /ntfs/Windows/Setup/Scripts cp /images/drivers/Common/SetupComplete.cmd /ntfs/Windows/Setup/Scripts/ cat /images/drivers/Common/commoninstall.bat >>/ntfs/Windows/Setup/Scripts/SetupComplete.cmd unix2dos /ntfs/Windows/Setup/Scripts/SetupComplete.cmd echo "Done."; fi #Needs to be executed with bash bash /images/postdownloadscripts/machinedrivers.sh echo " "; echo " * Driver copy completed."; umount /ntfs sleep 5; fi