@Tom-Elliott Here is the script. I modified the original script to attempt to remove the detection for OS version and x86 or x64 version. I am only going to be deploying Windows 11 64 bit.
I tested this on my Lenovo ThinkPad and the system is detecting the Lenovo correctly, but the script still errors out with "Failed to download driver information for [ThinkPad P14s Gen 4]
Its possible I have not setup the target path correctly in the script, still playing with this part.
#!/bin/bash
ceol=`tput el`;
manu=`dmidecode -s system-manufacturer`;
case $manu in
[Ll][Ee][Nn][Oo][Vv][Oo])
machine=$(dmidecode -s system-version)
;;
*[Dd][Ee][Ll][Ll]*)
machine=$(dmidecode -s system-product-name) #pruduct is typo, just realized sorry :(
;;
*)
machine=$(dmidecode -s system-product-name) # Technically, we can remove the dell one as it's the "default"
;;
esac
[[ -z $machine ]] && return #assuming you want it to break if it is not lenovo or dell?
machine="${machine%"${machine##*[![:space:]]}"}" #Removes Trailing Spaces
#############################################
# Quick hack to find out if the installed OS image is a x86 or x64
#system64="/ntfs/Windows/SysWOW64/regedit.exe" # sloppy detect if 64bit or not
#[[ ! -f $system64 ]] && arch="x86" || arch="x64"
#############################################
#this section has been updated to bring the osn names in line
# with how the Dell CABs are defined
#case $osid in
# 5) osn="win7" ;;
# 6) osn="win8" ;;
# 7) osn="win8.1" ;;
# 9) osn="win10" ;;
#esac
#############################################
dots "Preparing Drivers"
# below creates local folder on imaged pc
# this can be anywhere you want just remember
# to make sure it matches throughout! (case IS important here)
clientdriverpath="/ntfs/Windows/DRV"
remotedriverpath="/images/drivers/$machine"
[[ ! -d $clientdriverpath ]] && mkdir -p "$clientdriverpath" >/dev/null 2>&1
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:
#/fog/Drivers/Latitude E5410/win7/x86
rsync -aqz "$remotedriverpath" "$clientdriverpath" >/dev/null 2>&1
[[ ! $? -eq 0 ]] && handleError "Failed to download driver information for [$machine]"
#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%\DRV;%SystemRoot%\inf;";
#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 :-)"