From e4761966f32d32599c6b40db59ed2703f5557591 Mon Sep 17 00:00:00 2001 From: /rootzoll Date: Mon, 8 Apr 2024 12:17:33 +0200 Subject: [PATCH] #4534 activating watchdog reboot on halt (#4536) --- build_sdcard.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build_sdcard.sh b/build_sdcard.sh index df84ba3a8..40fc911c0 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -442,6 +442,19 @@ if ! compgen -u pi; then adduser pi sudo fi +# activate watchdog if ls /dev/watchdog exists - see #4534 +if [ -e /dev/watchdog ]; then + echo "Activating watchdog ..." + if [ "${baseimage}" = "raspios_arm64" ]; then + echo "dtparam=watchdog=on" | tee -a $raspi_configfile + fi + sed -i "s/^#RuntimeWatchdogSec=.*/RuntimeWatchdogSec=600s/g" /etc/systemd/system.conf + sed -i "s/^#RebootWatchdogSec=.*/RebootWatchdogSec=3min/g" /etc/systemd/system.conf + sed -i "s/^#WatchdogDevice=.*/WatchdogDevice=\/dev\/watchdog/g" /etc/systemd/system.conf +else + echo "No watchdog device /dev/watchdog found - keep watchdog like default" +fi + # special prepare when RaspberryPi OS if [ "${baseimage}" = "raspios_arm64" ]; then @@ -463,7 +476,6 @@ if [ "${baseimage}" = "raspios_arm64" ]; then fi echo "max_usb_current=1" | tee -a $raspi_configfile echo "dtparam=nvme" | tee -a $raspi_configfile - echo "dtparam=watchdog=on" | tee -a $raspi_configfile echo 'dtoverlay=pi3-disable-bt' | tee -a $raspi_configfile echo 'dtoverlay=disable-bt' | tee -a $raspi_configfile else