diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index 29e8ba559..809e42b64 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -99,17 +99,13 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86 if [ -z "$MTM" ]; then FRU=`ipmitool fru print 0` if [ $? -eq 0 ]; then - m=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {print $2}'` - n=`echo "$FRU" | awk -F': ' '/Product Name/ {print $2}'` - if [ -z "$n" -o "$n" == "NONE" ]; then - n=`echo "$FRU" | awk -F': ' '/Product Part Number/ {print $2}'` - fi + MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name|Product Part Number/ {if (n==""||n=="NONE") {n=$2}} END {print m":"n}'` else logger -s -t $log_label -p local4.warning "Couldn't find MTM information in FRU, falling back to DMI (MTMS-based discovery may fail)" m=`cat /sys/devices/virtual/dmi/id/sys_vendor` n=`cat /sys/devices/virtual/dmi/id/product_name` + MTM="$m:$n" fi - MTM="$m:$n" fi SERIAL=`cat /sys/devices/virtual/dmi/id/product_serial` fi