Skip to content

Commit 1fd720f

Browse files
[warm-reboot]: added automated recover for ISSU file
Signed-off-by: Vadym Hlushko <[email protected]>
1 parent 4e27ad7 commit 1fd720f

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

scripts/fast-reboot

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -170,26 +170,21 @@ function request_pre_shutdown()
170170
}
171171
}
172172
173-
function recover_issu_bank_file_instruction()
173+
function recover_issu_bank_file()
174174
{
175-
debug "To recover (${ISSU_BANK_FILE}) file, do the following:"
176-
debug "$ docker exec -it syncd sx_api_dbg_generate_dump.py"
177-
debug "$ docker exec -it syncd cat /tmp/sdkdump | grep 'ISSU Bank'"
178-
debug "Command above will print the VALUE of ISSU BANK - 0 or 1, use this VALUE in the next command"
179-
debug "$ printf VALUE > /host/warmboot/issu_bank.txt"
175+
debug "Recovering the (${ISSU_BANK_FILE}) file"
176+
docker exec -it syncd sx_api_dbg_generate_dump.py
177+
issu_bank_value=`docker exec -it syncd cat /tmp/sdkdump | grep 'ISSU Bank' | grep -o -E '[0-9]+'`
178+
printf $issu_bank_value > /host/warmboot/issu_bank.txt
180179
}
181180
182181
function check_issu_bank_file()
183182
{
184183
ISSU_BANK_FILE=/host/warmboot/issu_bank.txt
185-
MLNX_ISSU_BANK_BROKEN=102
186184
187185
if [[ ! -s "$ISSU_BANK_FILE" ]]; then
188186
error "(${ISSU_BANK_FILE}) does NOT exist or empty ..."
189-
recover_issu_bank_file_instruction
190-
if [[ "$1" = true ]]; then
191-
exit "${MLNX_ISSU_BANK_BROKEN}"
192-
fi
187+
recover_issu_bank_file
193188
return
194189
fi
195190
@@ -199,10 +194,7 @@ function check_issu_bank_file()
199194
if [[ $issu_file_chars_count != 1 ]] ||
200195
[[ "$issu_file_content" != "0" && "$issu_file_content" != "1" ]]; then
201196
error "(${ISSU_BANK_FILE}) is broken ..."
202-
recover_issu_bank_file_instruction
203-
if [[ "$1" = true ]]; then
204-
exit "${MLNX_ISSU_BANK_BROKEN}"
205-
fi
197+
recover_issu_bank_file
206198
fi
207199
}
208200

0 commit comments

Comments
 (0)