diff options
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/initfs/files/obmc-shutdown.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-shutdown.sh b/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-shutdown.sh index 90e5dfbeb..c91f5efac 100644 --- a/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-shutdown.sh +++ b/meta-phosphor/common/recipes-phosphor/initfs/files/obmc-shutdown.sh @@ -33,10 +33,21 @@ set +x update=/run/initramfs/update image=/run/initramfs/image- +wdt="-t 1 -T 5" +wdrst="-T 15" + if ls $image* > /dev/null 2>&1 then if test -x $update then + if test -c /dev/watchdog + then + echo Pinging watchdog ${wdt+with args $wdt} + watchdog $wdt -F /dev/watchdog & + wd=$! + else + wd= + fi $update --clean-saved-files remaining=$(ls $image*) if test -n "$remaining" @@ -46,6 +57,20 @@ then else echo "Flash update completed." fi + + if test -n "$wd" + then + kill -9 $wd + if test -n "$wdrst" + then + echo Reseting watchdog timeouts to $wdrst + watchdog $wdrst -F /dev/watchdog & + sleep 1 + # Kill the watchdog daemon, setting a timeout + # for the remaining shutdown work + kill -9 $! + fi + fi else echo 1>&2 "Flash update requested but $update program missing!" fi |