Skip to content

Commit

Permalink
platform pre-check for reboot in master branch (sonic-net#1556)
Browse files Browse the repository at this point in the history
What I did
Added platform pre check support in reboot script.
Checking platform based changes before stopping dockers and sonic services.
Porting changes in master from 201911 branch sonic-net#1472
How I did it
On branch reboot_pre_check_master
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified:   scripts/reboot
How to verify it
Write a platform pre check script(platform_reboot_pre_check) and place it in /usr/share/sonic/device// directory.
If the script exit with status 0, reboot will be proceeded.
If script exit with non-zero status, the reboot script gets stopped.
  • Loading branch information
santhosh-kt authored Apr 22, 2021
1 parent f5efe89 commit 59ed6f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DEVPATH="/usr/share/sonic/device"
PLAT_REBOOT="platform_reboot"
PLATFORM_UPDATE_REBOOT_CAUSE="platform_update_reboot_cause"
REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt"
PLATFORM_REBOOT_PRE_CHECK="platform_reboot_pre_check"
REBOOT_TIME=$(date)

# Reboot immediately if we run the kdump capture kernel
Expand Down Expand Up @@ -121,6 +122,11 @@ function reboot_pre_check()
fi
rm ${filename}

if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} ]; then
${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK}
[[ $? -ne 0 ]] && exit $?
fi

# Verify the next image by sonic-installer
local message=$(sonic-installer verify-next-image 2>&1)
if [ $? -ne 0 ]; then
Expand Down

0 comments on commit 59ed6f3

Please sign in to comment.