Skip to content

Commit f909542

Browse files
committed
[mellanox] Fix FW utils review comments
Signed-off-by: Nazarii Hnydyn <[email protected]>
1 parent 1534a01 commit f909542

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

platform/mellanox/mlnx-fw-upgrade.j2

+4-2
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,13 @@ function ShowProgressBar() {
132132
return "${EXIT_SUCCESS}"
133133
fi
134134

135+
# Print progress bar: use carriage return to overwrite command line content
135136
for i in "${SPIN[@]}"; do
136137
echo -ne "\r[${i}] ${1}"
137138
sleep 0.5s
138139
done
139140

141+
# Clear command line content + carriage return
140142
echo -ne "\033[1K\r"
141143
}
142144

@@ -219,7 +221,7 @@ function UpgradeCPLDFW_Worker() {
219221
local -r _CPLD_REFRESH_FILE="${2}"
220222
local -r _ASIC_DEV="$(find /dev/mst -iname '*_pciconf0')"
221223

222-
if [[ "${UPDATE_MLNX_CPLD_FW}" = "1" ]]; then
224+
if [[ -f /tmp/cpld_fw_updated ]]; then
223225
RunCmd "cpldupdate --dev ${_ASIC_DEV} ${_CPLD_REFRESH_FILE}"
224226
return "${EXIT_SUCCESS}"
225227
fi
@@ -231,7 +233,7 @@ function UpgradeCPLDFW_Worker() {
231233
function UpgradeCPLDFW() {
232234
local -r _CPLD_ARCHIVE="$1"
233235

234-
if [[ "${UPDATE_MLNX_CPLD_FW}" = "1" ]]; then
236+
if [[ -f /tmp/cpld_fw_updated ]]; then
235237
LogWarning "forced CPLD refresh was requested for ${ONIE_PLATFORM}"
236238
CPLD_UPGRADE="${YES_PARAM}"
237239
fi

0 commit comments

Comments
 (0)