summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2022-05-26 23:23:14 -0700
committerRobert Yang <liezhi.yang@windriver.com>2022-05-27 00:05:42 -0700
commitc05b2737acb3c1b1d91085eb38c183214f478c62 (patch)
tree83abb7254c50b7cbb5129c27397bbcacec11d5eb /meta/recipes-extended
parent579906b9f4ea32c8d4e0e11a87ee6c9e27cdf0dc (diff)
downloadopenembedded-core-contrib-rbt/watdog.tar.gz
systemd: Set RebootWatchdogSec to 60s as watchdogrbt/watdog
The systemd-shutdown sets watchdog timeout to 10m (600 seconds) which is too large, and caused errors when reboot on boars such as rpi4: systemd-shutdown[1]: Failed to set timeout to 10min: Invalid argument The watchog's default value is 60s, so set RebootWatchdogSec to 60s to fix the errors. And <machin.conf> can set WATCHDOG_TIMEOUT when needed, for example, the max timeout of rpi4 is 15 seconds. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/watchdog/watchdog-config.bb7
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/recipes-extended/watchdog/watchdog-config.bb b/meta/recipes-extended/watchdog/watchdog-config.bb
index a28d28033b..f138952128 100644
--- a/meta/recipes-extended/watchdog/watchdog-config.bb
+++ b/meta/recipes-extended/watchdog/watchdog-config.bb
@@ -13,8 +13,15 @@ SRC_URI = " \
file://watchdog.conf \
"
+# The default value is 60 seconds when null.
+WATCHDOG_TIMEOUT ??= ""
+
do_install() {
install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog
install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf
+
+ if [ -n "${WATCHDOG_TIMEOUT}" ]; then
+ echo "watchdog-timeout = ${WATCHDOG_TIMEOUT}" >> ${D}/etc/watchdog.conf
+ fi
}