From: Benjamin Szőke <egyszer...@freemail.hu>

To make use of the hardware watchdog it is sufficient to set
the RuntimeWatchdogSec= option in /etc/systemd/system.conf.
It defaults to 0 (i.e. no hardware watchdog use). Set it to
a value like 20s and the watchdog is enabled.

ref: https://0pointer.de/blog/projects/watchdog.html
Signed-off-by: Benjamin Szőke <egyszer...@freemail.hu>
---
 meta/recipes-core/systemd/systemd_256.9.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd_256.9.bb 
b/meta/recipes-core/systemd/systemd_256.9.bb
index a9224915c6..84888b88f1 100644
--- a/meta/recipes-core/systemd/systemd_256.9.bb
+++ b/meta/recipes-core/systemd/systemd_256.9.bb
@@ -266,6 +266,11 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
 # The 60 seconds is watchdog's default vaule.
 WATCHDOG_TIMEOUT ??= "60"
 
+# To make use of the hardware watchdog it is sufficient to set 
WATCHDOG_RUNTIME_SEC
+# (RuntimeWatchdogSec= option in /etc/systemd/system.conf) to a value like 20s
+# and the watchdog is enabled. (defaults is no hardware watchdog use)
+WATCHDOG_RUNTIME_SEC ??= ""
+
 do_install() {
        meson_do_install
 
@@ -383,6 +388,11 @@ do_install() {
                        ${D}/${sysconfdir}/systemd/system.conf
        fi
 
+       if [ -n "${WATCHDOG_RUNTIME_SEC}" ]; then
+               sed -i -e 
's/#RuntimeWatchdogSec=off/RuntimeWatchdogSec=${WATCHDOG_RUNTIME_SEC}/' \
+                       ${D}/${sysconfdir}/systemd/system.conf
+       fi
+
        if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', 
d)}; then
                if ! grep -q '^NamePolicy=.*mac' 
${D}${nonarch_libdir}/systemd/network/99-default.link; then
                        sed -i '/^NamePolicy=/s/$/ mac/' 
${D}${nonarch_libdir}/systemd/network/99-default.link
-- 
2.47.1.windows.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#208905): 
https://lists.openembedded.org/g/openembedded-core/message/208905
Mute This Topic: https://lists.openembedded.org/mt/110196053/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to