From f10f79b7546c6efe48be5a0c44510c4f43e46293 Mon Sep 17 00:00:00 2001 From: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com> Date: Fri, 2 Dec 2022 06:46:10 +0530 Subject: [PATCH] [DellEMC] Master: S6100: SSD upgrade status: Moving from smartctl to iSMART (#12784) Why I did it smartctl tool is available only in PMON docker. Hence, the tool may be not accessible incase PMON docker goes down. Using iSMART_64 tool to fetch the SSD firmware version and device model information. How I did it Replacing smartctl with iSMART_64. --- .../s6100/scripts/s6100_ssd_upgrade_status.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh index 2c074fd331..b06de8184c 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh @@ -15,11 +15,14 @@ fi SSD_UPGRADE_LOG="$SSD_FW_UPGRADE/upgrade.log" +iSMART="/usr/local/bin/iSMART_64" +iSMART_OPTIONS="-d /dev/sda" +iSMART_CMD=`$iSMART $iSMART_OPTIONS` SMART_CMD=`smartctl -a /dev/sda` -SSD_FW_VERSION=$(echo "$SMART_CMD" | grep "Firmware Version" | awk '{print $NF}') +SSD_FW_VERSION=$(echo "$iSMART_CMD" | grep "FW Version" | awk '{print $NF}') SSD_FW_VERSION=${SSD_FW_VERSION,,} -SSD_MODEL=$(echo "$SMART_CMD" | grep "Device Model" | awk '{print $NF}') +SSD_MODEL=$(echo "$iSMART_CMD" | grep "Model" | awk '{print $NF}') if [ -e $SSD_FW_UPGRADE/GPIO7_pending_upgrade ]; then if [ $SSD_MODEL == "3IE" ] && [ $SSD_FW_VERSION == "s141002c" ]; then @@ -34,10 +37,6 @@ fi echo "$0 `date` SSD FW upgrade logs post reboot." >> $SSD_UPGRADE_LOG -iSMART="/usr/local/bin/iSMART_64" -iSMART_OPTIONS="-d /dev/sda" -iSMART_CMD=`$iSMART $iSMART_OPTIONS` - SSD_UPGRADE_STATUS1=`io_rd_wr.py --set --val 06 --offset 210; io_rd_wr.py --set --val 09 --offset 211; io_rd_wr.py --get --offset 212` SSD_UPGRADE_STATUS1=$(echo "$SSD_UPGRADE_STATUS1" | awk '{print $NF}') @@ -69,11 +68,10 @@ elif [ $SSD_FW_VERSION == "s210506g" ] || [ $SSD_FW_VERSION == "s16425cg" ]; the echo "$0 `date` soft-/fast-/warm-reboot is allowed." >> $SSD_UPGRADE_LOG else + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_high + systemctl start --no-block s6100-ssd-monitor.timer if [ $SSD_UPGRADE_STATUS1 == "0" ]; then - rm -rf $SSD_FW_UPGRADE/GPIO7_* - touch $SSD_FW_UPGRADE/GPIO7_high - systemctl start --no-block s6100-ssd-monitor.timer - if [ $SSD_MODEL == "3IE" ];then echo "$0 `date` SSD FW upgraded from S141002C to S210506G in first mp_64." >> $SSD_UPGRADE_LOG else