@george1421 Hi !
I changed my script for the newer … :
fog.postdownloadscript :
#!/bin/bash
. /usr/share/fog/lib/funcs.sh
[[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
. ${postdownpath}/fog.custominstall
esac
fog.copydrivers :
#!/bin/bash
ceol=`tput el`;
manu=`dmidecode -s system-manufacturer`;
dots "Identifying hardware"
case $manu in
[Ll][Ee][Nn][Oo][Vv][Oo])
machine=$(dmidecode -s system-version)
;;
*[Dd][Ee][Ll][Ll]*)
machine=$(dmidecode -s system-product-name)
;;
*I[Nn][Tt][Ee][Ll]*)
# For the Intel NUC and intel mobo pick up the system type from the
# baseboard product name
machine=$(dmidecode -s baseboard-product-name)
;;
*)
# Technically, we can remove the Dell entry above as it is the same as this [default]
machine=$(dmidecode -s system-product-name)
;;
esac
# if the machine isn't identified then no need to continue with this script, just return to caller
if [[ -z $machine ]]; then
echo "Unable to identify the hardware for manufacturer ${manu}";
debugPause;
return;
fi
echo "${machine} Identified";
# Removes Spaces in machine name, works better with path definitions
machine="${machine%"${machine##*[![:space:]]}"}";
# Jeffrey Boulais posted that the above code did not work for his install. He
# supplied this code as an alternative. If you run in to a problem using my code
# comment out my code and see if his code works better for your installation. The
# only right way is the one that works. Thank you Jeff for your input.
# machine="$(echo -e “${machine}” | tr -d ‘[:space:]’)"
dots "Verifying we've found the OS disk"
if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
echo "! OS root Not found !";
debugPause
return;
fi
echo "Found";
dots "Verifying target Arch"
system64="/ntfs/Windows/SysWOW64/regedit.exe"
[[ ! -f $system64 ]] && arch="x86" || arch="x64"
echo "${arch} found";
debugPause
# set osn path names based on the osid set in the FOG WebGui
case $osid in
5) osn="Win7" ;;
6) osn="win8" ;;
7) osn="win8.1" ;;
9) osn="Win10" ;;
esac
dots "Preparing Drivers"
clientdriverpath="/ntfs/Windows/DRV"
# remotedriverpath="/images/Drivers/$machine/$osn/$arch"
remotedriverpath="/images/Drivers/$osn/$machine/$arch"
debugPause
if [[ ! -d "${remotedriverpath}" ]]; then
echo "failed";
echo " ! Driver package not found for ${machine}/$osn/$arch ! ";
debugPause;
return;
fi
echo "Ready";
debugPause
[[ ! -d $clientdriverpath ]] && mkdir -p "$clientdriverpath" >/dev/null 2>&1
echo -n "In Progress"
rsync -aqz "$remotedriverpath" "$clientdriverpath" >/dev/null 2>&1
[[ ! $? -eq 0 ]] && handleError "Failed to download driver information for [$machine/$osn/$arch]"
debugPause
# the following code is only valid for Windows 7 operating systems since Windows 8 and beyond
# relies on the unattend.xml section to locate OEM drivers. If you are no longer deploying Win7
# you may exclude this section.
regfile="/ntfs/Windows/System32/config/SOFTWARE"
key="\Microsoft\Windows\CurrentVersion\DevicePath"
devpath="%SystemRoot%\DRV;%SystemRoot%\inf;";
reged -e "$regfile" &>/dev/null <<EOFREG
ed $key
$devpath
q
y
EOFREG
After that, i ran a new debug task on the 640G2 and manually mount the wrong partition :
[Mon Dec 12 root@fogclient /]# mkdir ntfs
[Mon Dec 12 root@fogclient /]# ntfs-3g -o force,rw /dev/sda1 /ntfs
[Mon Dec 12 root@fogclient /]# ls -lha /ntfs/
total 418K
drwxrwxrwx 1 root root 4.0K May 23 2022 .
drwxr-xr-x 19 root root 1.0K Dec 12 14:02 ..
-rwxrwxrwx 1 root root 1 Mar 19 2019 BOOTNXT
-rwxrwxrwx 1 root root 8.0K Jan 30 2020 BOOTSECT.BAK
drwxrwxrwx 1 root root 0 Oct 19 07:44 Recovery
drwxrwxrwx 1 root root 0 Jan 30 2020 'System Volume Information'
-rwxrwxrwx 1 root root 402K Jun 22 2020 bootmgr
[Mon Dec 12 root@fogclient /]#
As you can see, there is no Windows folder in the Reserved Partition …
After that, i umount /ntfs and ran fog script …
Just after the copy of drivers, i breaked the script (CTRL+C).
* Testing partition /dev/sda1.......................Not found
* Testing partition /dev/sda2.......................Success
Done
* Press [Enter] key to continue
* Preparing Drivers.................................Done
* Preparing Sysprep File............................Done
* Writing Computer Name.............................Done
* ComputerName Set To...............................xxxxxxx
* Set PC To Join The Domain.........................Skipped
....................................
....................................
....................................
....................................
....................................
fog.log deleted ........................ Done !
* Mounting directory................................Done
* Press [Enter] key to continue
^C
[Mon Dec 12 root@fogclient /]# cd /ntfs/
[Mon Dec 12 root@fogclient /ntfs]# ls
BOOTNXT BOOTSECT.BAK Recovery 'System Volume Information' bootmgr
[Mon Dec 12 root@fogclient /ntfs]# cd ..
[Mon Dec 12 root@fogclient /]# umount /ntfs
[Mon Dec 12 root@fogclient /]# ntfs-3g -o force,rw /dev/sda2 /ntfs/
[Mon Dec 12 root@fogclient /]# cd /ntfs/Windows/DRV/
[Mon Dec 12 root@fogclient /ntfs/Windows/DRV]# ls
x86
[Mon Dec 12 root@fogclient /ntfs/Windows/DRV]#
For the test, i have 2 folders on my NAS:/images/Drivers/Win10/HP ProBook 640 G2 :
x86
x64
I think, in the fog.copydrivers, the script who seek the architecture of the 640G2 failling because he select the x86 folder … what do you think about that ?