Novell Home

Delivering the Right Drivers via Imaging

Novell Cool Solutions: Tip
By Kris Smith

Digg This - Slashdot This

Posted: 22 Aug 2006
 

"A very useful technique! For those who are unfamiliar with scripting in Linux, a similar option, based upon WMI, is used by Novell partners ENGL in their Ztoolkit product."

Shaun Pond–
ZENworks Product Specialist
Novell, Inc.

ENVIRONMENT: The tftp commands used in the script are for the SUSE Linux-based ZENworks 7 Image environment (it's slightly different in 6.5).

We used the tftp server running on the Image Server to pull this script, lspci & pci.isd down to the workstation but this could be done via the Addfiles directory.

PROBLEM: With the increasing number of new devices around, we were having a problem getting the right drivers delivered to workstations during Imaging.

We had previously thrown all the drivers we needed together in one Addon Image which attempted to do a silent install in the hopes that the workstation could work out which it needed. This only works up to a point.

SOLUTION: What we needed was a way to identify what devices were in a specific machine.

We found that each device has a Vendor-Device-subVendor-subDevice number. The utility lspci will report these pci device ID numbers.

We then use this to attempt to restore addon images that match the PCI IDs found. As the script extracts these numbers on-the-fly, we do not need to change the script to take account of new devices. If a new device comes along that needs new drives we simply create a new addon image with the filename of the device ID.

Although these are not guaranteed to be unique, it's a lot better than our previous approach.

You can extract the device information from the Windows device manager as well (for those unknown devices).

EXAMPLE

#!/bin/bash

Script:

###########################################################
#
#RestoreImage.sh
#Restore standard Image data files
#
#ZenWorks Imaging script to setup KU workstations
#Created by:
#Kris Smith
#Faculty of Science
# Kingston University
# 09/05/06
#
#Global Vars:
#ImgPathBase path to zmg file on Image server
#LogFile Define Log File
#PROXXYADDRaddress of Image server
#Local Vars:
#Used to determin which drivers to restore:
#DEVICEPCI device string
#PCIKEYPCI device ID
#See http://pciids.sourceforge.net/ 
#
#
#
###########################################################
echo "Start $0 `date` "
echo "Created By Kris@king.ac.uk" 

#Get Hardware Info.

#Attempt to get "Other" pci devices...
tftp $TftpSrv -v -m binary -c get Script/bin/pci.ids /bin/pci.ids
tftp $TftpSrv -v -m binary -c get Script/bin/lspci /bin/lspci
chmod +x /bin/lspci

for DEVICE in `lspci -m -n | tr -d " " ` 
do
#This Line is to get the PCI Device ID in the right format:
PCIKEY=`echo $DEVICE | sed 's#.*\"\(.*\)\".*\"\(.*\)\".*\"\(.*\)\".*\"\(.*\)\".*\"\(.*\)\".*#\2-\3-\4-\5#'`
echo "Need to restore img rp $PROXYADDR $IMGPATH $PCIKEY.zmg" 
img rp $PROXYADDR $ImgPath/addon/$PCIKEY.zmg s1 a1:p1  
done

End Script.

The addon Image this script looks for would be called:

1102-0007-1102-1007.zmg for a SBLive! 24bit
( http://pci ( http://pci/ )-ids.ucw.cz/iii/?i=11020007 )

If you have any questions you may contact Kris at Kris@king.ac.uk


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell