Skip to content

Commit

Permalink
[DellEMC] Master: S6100: SSD upgrade status: Moving from smartctl to …
Browse files Browse the repository at this point in the history
…iSMART (sonic-net#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.
  • Loading branch information
santhosh-kt authored and mssonicbld committed Dec 7, 2022
1 parent fa31cac commit 8ee240a
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}')

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8ee240a

Please sign in to comment.