diff --git a/scripts/reboot b/scripts/reboot index 1264180f7b..4a70085f33 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -7,6 +7,7 @@ ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type) DEVPATH="/usr/share/sonic/device" PLAT_REBOOT="platform_reboot" REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt" +PLATFORM_REBOOT_PRE_CHECK="platform_reboot_pre_check" VERBOSE=no EXIT_NEXT_IMAGE_NOT_EXISTS=4 @@ -72,6 +73,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 + # Make sure that the next image exists if [[ ! -d ${IMAGE_PATH} ]]; then VERBOSE=yes debug "Next image ${NEXT_SONIC_IMAGE} doesn't exist ..."