@Quazz I do not have anything further. Here is what I do have. this first script works for all devices with mechanical SATA, and SSD’s, but not M.2 SATA:
#!/bin/sh
osdiskpart=“/dev/sda2”;
driverver=“Win7”
mkdir /ntfs 2>/dev/null
mount.ntfs-3g “${osdiskpart}” /ntfs 2>/tmp/mntfail
mkdir /ntfs/Drivers 2>/dev/null
if [ -d “/ntfs/Windows/SysWOW64” ]
then
setarch=“x64”;
else
setarch=“x86”;
fi
machine=dmidecode -s system-product-name
;
machine=“${machine%”${machine##[![:space:]]}“}”;
echo "Detected [${machine}] [${driverver}] with this arch [${setarch}] " >> /ntfs/Drivers/machine.txt
rm -f /tmp/mydrivers;
ln -s “/images/Drivers/${driverver}/${machine}/${setarch}/” /tmp/mydrivers;
if [ -d “/tmp/mydrivers” ]
then
cp -r /tmp/mydrivers/ /ntfs/Drivers;
fi
regfile=“/ntfs/Windows/System32/config/SOFTWARE”
key=“\Microsoft\Windows\CurrentVersion\DevicePath”
devpath=“%SystemRoot%\inf;C:\Drivers”;
reged -e “$regfile” &>/dev/null <<EOFREG
ed $key
$devpath
q
y
EOFREG
rm -f /tmp/mydrivers;
umount /ntfs
The following scirpt works with the M.2 SATA and mechanical SATAs, and the SSD’s. HOWEVER, it will not work with the OptiPlex 790’s nor 990’s They are the only two models giving the “space” problem.
#!/bin/sh
if [[ $hd == /dev/sda* ]]
then
osdiskpart=“/dev/sda2”;
else [[ $hd == /dev/nvme* ]]
osdiskpart="/dev/nvme0n1p2";
fi
driverver=“Win7”
mkdir /ntfs 2>/dev/null
mount.ntfs-3g “${osdiskpart}” /ntfs 2>/tmp/mntfail
mkdir /ntfs/Drivers 2>/dev/null
if [ -d “/ntfs/Windows/SysWOW64” ]
then
setarch=“x64”;
else
setarch=“x86”;
fi
machine=dmidecode -s system-product-name
;
machine=“${machine%”${machine##[![:space:]]}“}”;
echo "Detected [${machine}] [${driverver}] with this arch [${setarch}] " >> /ntfs/Drivers/machine.txt
rm -f /tmp/mydrivers;
ln -s “/images/Drivers/${driverver}/${machine}/${setarch}/” /tmp/mydrivers;
if [ -d “/tmp/mydrivers” ]
then
cp -r /tmp/mydrivers/ /ntfs/Drivers;
fi
regfile=“/ntfs/Windows/System32/config/SOFTWARE”
key=“\Microsoft\Windows\CurrentVersion\DevicePath”
devpath=“%SystemRoot%\inf;C:\Drivers”;
reged -e “$regfile” &>/dev/null <<EOFREG
ed $key
$devpath
q
y
EOFREG
rm -f /tmp/mydrivers;
umount /ntfs
for now I reverted back to the first script for imaging as we only have 1 lab of the M.2 SATA machines. I have not had the time to look at this yet. If anyone has an idea on what to change for the scirpts I would be all ears, but for now I do not have a resolution. (due to time)