#Copy Drivers and HAL to Computer
# The image was created from a D610 with halaacpi.dll. Some
# computers require a different HAL, specifically the D600
# requires halacpi.dll. Note the method this is copied below.
PATH=$PATH:/mnt/ds/RDeploy/Linux
#Determine the product name of the computer and copy drivers
#Can use model_num in place of prod_name but you then have to substitute the numbers in for the product name.
MODEL="%#!computer@prod_name%"
echo "Copying drivers for $MODEL to computer..." > /dev/tty1
#If you used model_num in place of prod_name in the MODEL= area above, "Optiplex GX260" etc... would be replaced by the DS model number.
case "$MODEL" in
# 'OptiPlex GX260')
# firm -recurse Copy "/mnt/ds/Drivers/GX260" "prod:/Drivers"
# ;;
# 'OptiPlex GX270')
# firm -recurse Copy "/mnt/ds/Drivers/GX270" "prod:/Drivers"
# ;;
'Latitude D610')
firm -recurse Copy "/mnt/ds/Deploy/Drivers/D610" "prod:/Drivers"
;;
'Latitude D600')
firm -recurse Copy "/mnt/ds/Deploy/Drivers/D600" "prod:/Drivers"
echo "Replacing halaacpi.dll with halacpi.dll..." > /dev/tty1
firm delete "prod:/Windows/System32/hal.dll"
firm delete "prod:/Windows/System32/ntoskrnl.exe"
firm delete "prod:/Windows/System32/ntkrnlpa.exe"
firm delete "prod:/Windows/Inf/hal.inf"
firm -recurse Copy "/mnt/ds/Deploy/HAL/HALACPI" "prod:/Windows/System32"
firm copy "/mnt/ds/Deploy/HAL/HALACPI/hal.inf" "prod:/Windows/Inf/hal.inf"
echo "Finished replacing hal.dll." > /dev/tty1
;;
'Latitude X300')
firm -recurse Copy "/mnt/ds/Deploy/Drivers/X300" "prod:/Drivers"
echo "Replacing halaacpi.dll with halacpi.dll..." > /dev/tty1
firm delete "prod:/Windows/System32/hal.dll"
firm delete "prod:/Windows/System32/ntoskrnl.exe"
firm delete "prod:/Windows/System32/ntkrnlpa.exe"
firm delete "prod:/Windows/Inf/hal.inf"
firm -recurse Copy "/mnt/ds/Deploy/HAL/HALACPI" "prod:/Windows/System32"
firm copy "/mnt/ds/Deploy/HAL/HALACPI/hal.inf" "prod:/Windows/Inf/hal.inf"
echo "Finished replacing hal.dll." > /dev/tty1
;;
*)
echo "ERROR: NO DRIVERS FOR $MODEL CONFIGURED!" > /dev/tty1
echo "PLEASE CONFIGURE THE SERVER TO COPY DRIVERS FOR THIS MODEL." > /dev/tty1
echo "NO DRIVERS HAVE BEEN COPIED!" > /dev/tty1
sleep 120
exit 99
;;
esac
echo "Finished copying drivers to computer." > /dev/tty1
echo "Booting to Windows..." > /dev/tty1
exit 0