Blame SOURCES/powerpc-utils-081e7ac9.patch

956c23
commit 081e7ac9675b49346e937236f38822b33c8c751b
956c23
Author: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
956c23
Date:   Sun Jan 21 21:10:07 2018 +0530
956c23
956c23
    update_flash: Use inband ipmi path to get firmware version
956c23
    
956c23
    update_flash_nv uses 'ipmitool -I usb' interface to get firmware version
956c23
    details. This is AMI BMC OEM feature and not available on other BMC systems.
956c23
    Hence lets use inband interface to get firmware version details.
956c23
    
956c23
    Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
956c23
    Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
956c23
956c23
diff --git a/scripts/update_flash_nv b/scripts/update_flash_nv
956c23
index 0cec2eb..0ef765c 100755
956c23
--- a/scripts/update_flash_nv
956c23
+++ b/scripts/update_flash_nv
956c23
@@ -588,16 +588,27 @@ opp_manage_flash() {
956c23
 }
956c23
 
956c23
 opp_display_current_fw_version() {
956c23
-	check_ipmitool
956c23
+	which ipmitool >/dev/null 2>&1
956c23
+	if [ $? -ne 0 ]; then
956c23
+		echo "update_flash: ipmitool command not found."
956c23
+		error $E_IPMI "Please install ipmitool and retry."
956c23
+	fi
956c23
+
956c23
+	# Use inband interface to get firmware version
956c23
+	ipmitool mc info >/dev/null 2>&1 && break;
956c23
+	if [ $? -ne 0 ]; then
956c23
+		echo "update_flash: ipmi inband interface is not working."
956c23
+		error $E_IPMI "Check 'ipmi_devintf' kernel module loaded or not."
956c23
+	fi
956c23
 
956c23
 	echo
956c23
-	id=`ipmitool -I usb fru 2>/dev/null |grep "System Firmware" | cut -d " " -f8 | cut -d ")" -f1`
956c23
+	id=`ipmitool fru 2>/dev/null |grep "System Firmware" | cut -d " " -f8 | cut -d ")" -f1`
956c23
 	if [ "x$id" = "x" ]; then
956c23
 		error $E_IPMI "Failed to get firmware version."
956c23
 	fi
956c23
 
956c23
 	echo "Firmware version:"
956c23
-	ipmitool -I usb fru print $id
956c23
+	ipmitool fru print $id
956c23
 
956c23
 	exit $E_SUCCESS
956c23
 }