From 0abd72d84deb0bd2b8034073d605d0ba79670488 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Wed, 26 Jun 2019 22:50:04 +0300 Subject: [PATCH] [syncd_init_common.sh] fix fast reboot backwards compatibility (#480) * [syncd_init_common.sh] fix fast reboot backwards compatibility We should handle both cases for backward-compatible with 201803: - fast-reboot - SONIC_BOOT_TYPE=fast-reboot * handle review comments --- syncd/scripts/syncd_init_common.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/syncd/scripts/syncd_init_common.sh b/syncd/scripts/syncd_init_common.sh index e73a47e1a..a07c66733 100755 --- a/syncd/scripts/syncd_init_common.sh +++ b/syncd/scripts/syncd_init_common.sh @@ -24,17 +24,15 @@ fi # Use temporary view between init and apply CMD_ARGS+=" -u" -BOOT_TYPE="$(cat /proc/cmdline | grep -o 'SONIC_BOOT_TYPE=\S*' | cut -d'=' -f2)" - -case "$BOOT_TYPE" in - fast-reboot) - FAST_REBOOT='yes' - ;; - fastfast) +case "$(cat /proc/cmdline)" in + *SONIC_BOOT_TYPE=fastfast*) if [ -e /var/warmboot/warm-starting ]; then FASTFAST_REBOOT='yes' fi ;; + *SONIC_BOOT_TYPE=fast*|fast-reboot*) + FAST_REBOOT='yes' + ;; *) FAST_REBOOT='no' FASTFAST_REBOOT='no'