Cool Solutions

Adding more Addon Image files based on PC Configuration

coolguys

By:

May 26, 2006 12:00 am

Reads: 11222

Comments:0

Score:0

ENVIRONMENT:
ZEN 7 Boot Environment

Ever wish you could add more Addon Image files based on the configuration of the PC? Here’s how you do it. Using HWINFO and DMIDECODE you can determine hardware configuration using a scripted image.

(Note: dmidecode is available in my cool tool:
http://www.novell.com/coolsolutions/tools/17306.html

and referenced in my other Cool Solutions article. )

To determine if a CD-RW is present at imaging time, add the following lines in your imaging script:

  CDRCOUNT=`hwinfo --cdrom | grep -i 'Features' | grep -ic 'CD-RW'`

     if [ $CDRCOUNT -gt 0 ]; then
        echo    CD-RW software would be installed
     fi

To determine if a DVD is present at imaging time, add the following lines in your imaging script:

DVDCOUNT=`hwinfo --cdrom | grep -i 'Features' | grep -ic 'DVD'`

     if [ $DVDCOUNT -gt 0 ]; then
        echo    DVD player software would be installed
     fi

To determine if the PC is a desktop or a laptop at imaging time, add the following lines to your script:

  CLASS=`dmidecode -t chassis|grep -i -m1 'type:'|awk 'BEGIN {FS = ": "} {print $2}'`

     case "$CLASS" in

        "Other" )
           CLASS="Other"
        ;;
     
        "Unknown" )
           CLASS="Unknown"
        ;;

        "Desktop" )
           CLASS="Desktop"
        ;;
     
        "Low Profile Desktop" )
           CLASS="Desktop"
        ;;
     
        "Pizza Box" )
           CLASS="Desktop"
        ;;
     
        "Mini Tower" )
           CLASS="Desktop"
        ;;
     
        "Tower" )
           CLASS="Desktop"
        ;;
     
        "Portable" )
           CLASS="Laptop"
        ;;
     
        "Laptop" )
           CLASS="Laptop"
        ;;
     
        "Notebook" )
           CLASS="Laptop"
        ;;
     
        "Handheld" )
           CLASS="Handheld"
        ;;
     
        "Docking Station" )
           CLASS="Laptop"
        ;;
     
        "Sub-Notebook" )
           CLASS="Laptop"
        ;;
     
        "Space Saving" )
           CLASS="Desktop"
        ;;
     
        "Lunch Box" )
           CLASS="Desktop"
        ;;
     
        "Main System Chassis" )
           CLASS="Desktop"
        ;;
     
        "Expansion Chassis" )
           CLASS="Desktop"
        ;;
     
        "Sub-Chassis" )
           CLASS="Desktop"
        ;;
     
        "Bus Expansion Chassis" )
           CLASS="Desktop"
        ;;
     
        "Peripheral Chassis" )
           CLASS="Desktop"
        ;;
     
        "Storage Chassis" )
           CLASS="Desktop"
        ;;
     
        "Rack Mount Chassis" )
           CLASS="Desktop"
        ;;
     
        "Sealed-Case PC" )
           CLASS="Desktop"
        ;;
     
        * )
           CLASS="Unknown"
        ;;
     
     esac

To determine the PC Model at Imaging time, add the following line to your scripted image:

SYSTEMNAME=`dmidecode -s system-product-name|awk 'BEGIN {FS = "  "} {print $1}'` 
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS