Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DMI information during imaging 1

Status
Not open for further replies.

ackitsme

IS-IT--Management
Oct 15, 2002
21
US
I have need to pull a computer's serial number from DMI during the imaging process.

I'm using a scripted image and we are using ZfD 7 SP1.

I've seen mention about using dmidecode in a number of places, but neither have I been able to find a pre-compiled version of dmidecode that will work with the ZEN imaging kernel, nor have I been able to successfully compile one in any system that was able to work.

Can someone either help me find a pre-built one (the kernel is showing 2.6.5-7.191-default with gcc version 3.3.3) or send me to some instructions about how to correctly compile something such that it will work with the ZEN linux environment?

Thank you in advance.

-------------------------------------------------------------------------
Charlie Silverman
Sr. Systems Administrator
Globalstar, LLC

-------------------------------------------------------------------------
We now return you to your regularly scheduled reality.
 
What do you want to do with the computers serial number once you are done with it?


To build a system that has the same kernel as the ZfD imaging engine, build a Suse 9 Sp2 system.

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
Brent Schmidt Certified nut case [hippy]
Senior Network Engineer
Keep IT Simple
 
We want to use two pieces of information from DMI.

The serial number will become the PC's workstation name.

The model number will be used to determine the correct driver add-on for imaging.

I will get a copy of SLES9 SP2 to build the program.

Thank you for your help!

-------------------------------------------------------------------------
Charlie Silverman
Sr. Systems Administrator
Globalstar, Inc.

-------------------------------------------------------------------------
We now return you to your regularly scheduled reality.
 
Well, for naming the PC, jump up to and download the tool Zcnc.exe add it to your workstation setup script and use the command
Code:
zcnc.exe /wmi:"Win32_BIOS" /sn: /q

and it will name the PC by the BIOS serial number

the second part ... I think your doing it the hard way, but if you get it to work .... share the code :).


Personally I would just lump all of the drivers together, or if your trying to conserve disk space, use the imaging rules to determine which drive package to use.

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
Brent Schmidt Certified nut case [hippy]
Senior Network Engineer
Keep IT Simple
 
Personally I would just lump all of the drivers together, or if your trying to conserve disk space, use the imaging rules to determine which drive package to use.

I prefer to have the drivers in separate packages. It makes it much easier to update as we get new systems, and also makes our base image much simpler.

As far as using the imaging rules, that's fine except it still requires I have a scripted image created for each and every system type.

If I have the drivers separated out, I can set up a fairly simple scripted image that looks at the system model number gleaned from DMI and determines the file name of the drivers image that it needs to add.

As soon as I have a copy of SLES9 downloaded (it's going slow, currently saying it's going to take about 24 hours to download the DVD image) I will compile dmidecode and post back the resulting script.

-------------------------------------------------------------------------
Charlie Silverman
Sr. Systems Administrator
Globalstar, Inc.

-------------------------------------------------------------------------
We now return you to your regularly scheduled reality.
 
I was able to compile dmidecode without issue using the SLES 9.2 install.

I added the following lines to the settings.txt file so that dmidecode was downloaded every time the imaging engine is started:
Code:
tftp $TFTPIP -m binary -c get $TFTPIP:decode /bin/decode
mv /bin/decode /bin/dmidecode
chmod +x /bin/dmidecode

I then use a scripted image with the following code:
Code:
# ************************************************************************
# Globalstar Standard Baseline Imaging Script
# Version: 1.0
# ************************************************************************
# Description: This script will place a default baseline onto a PC.
# ************************************************************************
# Change Log:
#    2006-08-25 - CJS - File created
# ************************************************************************

## Set the base path for all images
BASEPATH=//$TFTPIP/VOL1/Images/
## Set the name for the current base image file
BASEIMAGE=xpsp2-base-1_0.zmg
## Retrieve the workstation name from Image Safe Data
ZISNAME=`zisview Name`

## If there was no workstation name in Image Safe, retrieve the 
## PC's serial number from DMI
if [ -n "$ZISNAME" ]; then
   ZISNAME=`dmidecode -s chassis-serial-number`
fi

## Retrieve the PC's model number from DMI and strip trailing spaces
MODEL=`dmidecode -s system-product-name | sed 's/[ \t]*$//'`

## Set the workstation's name in Image Safe Data
zisedit Name=$ZISNAME

## Delete all existing partitions
img pd-all
## Create one ntfs partition using all available space
img pc1 ntfs
## Activate the partition
img pa1
## Download the base image file
img rp $TFTPIP "$BASEPATH$BASEIMAGE" a1:p1
## Download the driver add-on image file
img rp $TFTPIP "$BASEPATH$MODEL.zmg" a1:p1

## Download the baseapps script to install default baseline apps
tftp $TFTPIP -c get $TFTPIP:baseapps /bin/baseapps
chmod +x /bin/baseapps
/bin/baseapps

## Reboot
reboot

This works for all system types. If we have a Dell Latitude D610, for example, the system product name returned is "Latitude D610 ". (Dell adds that space to the end for some reason, which is why I strip trailing spaces.)

I then created a driver add-on image called "Latitude D610.zmg".

The baseapps script contains lines to download each of the baseline apps.

I chose to implement this as a separate script so that it did not require modification of the scripted image just to add or remove an application from the baseline.

This makes for a very streamlined image, and also solves the problem of having multiple system types with similar hardware as we do not have to rely on imaging rules. I set my imaging server rule to look for any machine that has a 2 in the IP address. As all of our fixed IP ranges have 2's in them, as well as all of our DHCP address ranges, this will always be positive.

I hope this helps others with their implementations.

-------------------------------------------------------------------------
Charlie Silverman
Sr. Systems Administrator
Globalstar, Inc.

-------------------------------------------------------------------------
We now return you to your regularly scheduled reality.
 
This is pretty kewl. Thank you for sharing the info.


I smell a Cool Solution artical here.

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
Brent Schmidt Certified nut case [hippy]
Senior Network Engineer
Keep IT Simple
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top