From 7067220128d4ff4fdb39ada7401921959b260a19 Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Wed, 24 May 2017 15:38:31 -0700 Subject: [PATCH 1/2] Enhance MTM detection from FRU pages For systems that don't provide "Product Name", try to use "Product Part Number" instead. Supermicro does this, for instance: # ipmitool fru print 0 Chassis Type : Other Chassis Part Number : CSE-118GQETS-R2K03P Chassis Serial : [...] Board Mfg Date : Sun Dec 31 16:00:00 1995 Board Mfg : Supermicro Board Serial : [...] Board Part Number : X10DGQ Product Manufacturer : Supermicro Product Part Number : SYS-1028GQ-TR Product Serial : [...] --- xCAT-genesis-scripts/bin/dodiscovery | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index f33ef9c3d..338f13c42 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -75,13 +75,17 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86 if [ -z "$MTM" ]; then FRU=`ipmitool fru print 0` if [ $? -eq 0 ]; then - MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name/ {n=$2} END {print m":"n}'` + m=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {print $2}'` + n=`echo "$FRU" | awk -F': ' '/Product Name/ {print $2}'` + if [ -z "$n" ]; then + n=`echo "$FRU" | awk -F': ' '/Product Part Number/ {print $2}'` + fi 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 From b7676f7448df6b29a05fba4a2e84605f2d3b9156 Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Thu, 25 May 2017 17:24:23 -0700 Subject: [PATCH 2/2] MTM: some systems have FRU entries, but set to "NONE" --- xCAT-genesis-scripts/bin/dodiscovery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index 338f13c42..0ac4b9bd2 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -77,7 +77,7 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86 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" ]; then + if [ -z "$n" -o "$n" == "NONE" ]; then n=`echo "$FRU" | awk -F': ' '/Product Part Number/ {print $2}'` fi else