From 3fce21989176c684592c44b4229c766ca8a1d48f Mon Sep 17 00:00:00 2001 From: st Date: Tue, 2 Mar 2021 11:46:20 +0530 Subject: [PATCH 1/2] [201911] platform pre-check for reboot --- scripts/reboot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/reboot b/scripts/reboot index 1264180f7b..2fa9249fa7 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 ..." From a34b8bb48bc5bd26d669a5b0adbd4bb71b76520c Mon Sep 17 00:00:00 2001 From: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com> Date: Wed, 3 Mar 2021 09:42:13 +0530 Subject: [PATCH 2/2] changed tabs into spaces --- scripts/reboot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/reboot b/scripts/reboot index 2fa9249fa7..4a70085f33 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -74,8 +74,8 @@ function reboot_pre_check() rm ${filename} if [ -x ${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} ]; then - ${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} - [[ $? -ne 0 ]] && exit + ${DEVPATH}/${PLATFORM}/${PLATFORM_REBOOT_PRE_CHECK} + [[ $? -ne 0 ]] && exit fi # Make sure that the next image exists