@Tom-Elliott iâve tried this fog.custominstall
Create the following file named fog.custominstall in the following path on the FOG server /images/postdownloadscripts.
Copy the content into that newly created file
#!/bin/bash
. /usr/share/fog/lib/funcs.sh
[[ -z $postdownpath ]] && postdownpath=â/images/postdownloadscripts/â
case $osid in
5|6|7|9)
clear
[[ ! -d /ntfs ]] && mkdir -p /ntfs
getHardDisk
if [[ -z $hd ]]; then
handleError âCould not find hdd to useâ
fi
getPartitions $hd
for part in $parts; do
umount /ntfs >/dev/null 2>&1
fsTypeSetting â$partâ
case $fstype in
ntfs)
dots âTesting partition $partâ
ntfs-3g -o force,rw $part /ntfs
ntfsstatus=â$?â
if [[ ! $ntfsstatus -eq 0 ]]; then
echo âSkippedâ
continue
fi
if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
echo âNot foundâ
umount /ntfs >/dev/null 2>&1
continue
fi
echo âSuccessâ
break
;;
)
echo " * Partition $part not NTFS filesystem"
;;
esac
done
if [[ ! $ntfsstatus -eq 0 ]]; then
echo âFailedâ
debugPause
handleError "Failed to mount $part ($0)\n Args: $"
fi
echo âDoneâ
debugPause
. ${postdownpath}fog.copydrivers
# . ${postdownpath}fog.updateunattend
umount /ntfs
;;
*)
echo âNon-Windows Deploymentâ
debugPause
return
;;
esac
Save and exit your text editor.
Make the script executable with chmod 755 /images/postdownloadscripts/fog.custominstall **this part i get chmod: cannot * chmod 755 â/images/postdownloadscripts/fog.custominstallâ :No such file or directory please help!!!
fog.copydrivers
Create the following file named fog.copydrivers in the following path on the FOG server /images/postdownloadscripts.
Copy the content into that newly created file
#!/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:]]}â}â;
14-Sep-23 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:]â)â
03-Jan-24 marsface posted that he could not get either of the two above machine clean up commands to work correctly so he provided this one below which worked for him.
machine=â${machine//[[: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/Driversâ
remotedriverpath=â/images/drivers/$machine/$osn/$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