Make small changes to dump ipmi MAC addresses, and cloner3 fixes
Kyle Sheumaker [Fri, 2 Jan 2015 15:03:57 +0000 (09:03 -0600)]
etc/cloner3/cloner_server.sh
etc/hardware_output.sh

index 1e96237..324e402 100755 (executable)
@@ -103,9 +103,10 @@ server_get_netcfg() {
        NODE=$1
 
        RELEASE=`chroot /cloner/mnt lsb_release -i | awk '{print $3}'`
-       server_log "Get netcfg data for ${NODE} release ${RELEASE}"
+       RELEASE_VER=`chroot /cloner/mnt lsb_release -r | awk '{print $2}'`
+       server_log "Get netcfg data for ${NODE} release ${RELEASE} ver ${RELEASE_VER}"
        
-       echo "clonernetcfg|${NODE}|${RELEASE}" | $NETCAT -w 5 ${_server} ${PORT} > /tmp/nc.log
+       echo "clonernetcfg|${NODE}|${RELEASE}|${RELEASE_VER}" | $NETCAT -w 5 ${_server} ${PORT} > /tmp/nc.log
        if [ "$?" != "0" ];
        then
                echo "Can't send message to $_server on port $PORT"
index e076166..8e73fde 100755 (executable)
@@ -83,8 +83,27 @@ network_list() {
 
                NIC_COUNT=`expr ${NIC_COUNT} + 1`
        done
-       echo "NIC_COUNT=\"${NIC_COUNT}\""
 
+       if [ -e /dev/ipmi0 ]
+       then
+               for i in 1 2 3 4 5 6 7 8 9
+               do
+                       ipmitool lan print $i > /tmp/ipmi.lan.out 2>&1
+                       IPMI_MAC=`grep ^MAC /tmp/ipmi.lan.out | awk '{print $4}'`
+       
+                       if [ "${IPMI_MAC}" != "" ]
+                       then
+                               echo "NIC_${NIC_COUNT}_DEV=\"ipmi${i}\""
+                               echo "NIC_${NIC_COUNT}_HWADDR=\"${IPMI_MAC}\""
+                               echo "NIC_${NIC_COUNT}_DRIVER=\"ipmi\""
+                               echo "NIC_${NIC_COUNT}_PCIDEV=\"ipmi\""
+                               echo "NIC_${NIC_COUNT}_PCIVENDOR=\"ipmi\""
+               
+                               NIC_COUNT=`expr ${NIC_COUNT} + 1`
+                       fi
+               done
+       fi
+       echo "NIC_COUNT=\"${NIC_COUNT}\""
 }
 
 pci_list() {