forked from sonic-net/sonic-utilities
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add disabling HW watchdog during boot for fast-reboot and warm-reboot…
… (#4927) * Add disabling HW watchdog during boot for fast-reboot and warm-reboot case * typo
- Loading branch information
1 parent
517592a
commit ff6cb6c
Showing
4 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
files/image_config/watchdog-control/watchdog-control.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=watchdog control service | ||
After=swss.service | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/local/bin/watchdog-control.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#! /bin/bash | ||
|
||
VERBOSE=no | ||
WATCHDOG_UTIL="/usr/bin/watchdogutil" | ||
|
||
function debug() | ||
{ | ||
/usr/bin/logger "$0 : $1" | ||
if [[ x"${VERBOSE}" == x"yes" ]]; then | ||
echo "$(date) $0: $1" | ||
fi | ||
} | ||
|
||
|
||
function getBootType() | ||
{ | ||
# same code snippet in files/scripts/syncd.sh | ||
case "$(cat /proc/cmdline)" in | ||
*SONIC_BOOT_TYPE=warm*) | ||
TYPE='warm' | ||
;; | ||
*SONIC_BOOT_TYPE=fastfast*) | ||
TYPE='fastfast' | ||
;; | ||
*SONIC_BOOT_TYPE=fast*|*fast-reboot*) | ||
TYPE='fast' | ||
;; | ||
*) | ||
TYPE='cold' | ||
esac | ||
echo "${TYPE}" | ||
} | ||
|
||
function disable_watchdog() | ||
{ | ||
# Obtain boot type from kernel arguments | ||
BOOT_TYPE=`getBootType` | ||
if [[ -x ${WATCHDOG_UTIL} ]]; then | ||
debug "Disabling Watchdog during bootup after $BOOT_TYPE" | ||
${WATCHDOG_UTIL} disarm | ||
fi | ||
} | ||
|
||
disable_watchdog |
Submodule sonic-utilities
updated
from ef0b1f to 098f8e