Skip to content

Commit 59ed6f3

Browse files
authored
platform pre-check for reboot in master branch (sonic-net#1556)
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.
1 parent f5efe89 commit 59ed6f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/reboot

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DEVPATH="/usr/share/sonic/device"
33
PLAT_REBOOT="platform_reboot"
44
PLATFORM_UPDATE_REBOOT_CAUSE="platform_update_reboot_cause"
55
REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt"
6+
PLATFORM_REBOOT_PRE_CHECK="platform_reboot_pre_check"
67
REBOOT_TIME=$(date)
78

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

125+
if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} ]; then
126+
${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK}
127+
[[ $? -ne 0 ]] && exit $?
128+
fi
129+
124130
# Verify the next image by sonic-installer
125131
local message=$(sonic-installer verify-next-image 2>&1)
126132
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)