diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2022-05-27 00:07:11 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-05-31 15:24:18 +0100 |
| commit | 00400b63578bc1544af27d45ac7367343cf60113 (patch) | |
| tree | 1fef1343f3be7e171d0ec378126dc07a8825f1c2 | |
| parent | add49bc7e0910ba36230937389836f7de1acd757 (diff) | |
| download | poky-00400b63578bc1544af27d45ac7367343cf60113.tar.gz | |
systemd: Set RebootWatchdogSec to 60s as watchdog
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.
(From OE-Core rev: 20a7ab9ff6ed777c6617a338d049ebe03fcc588c)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/systemd/systemd_250.5.bb | 8 | ||||
| -rw-r--r-- | meta/recipes-extended/watchdog/watchdog-config.bb | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index 006b2f86ea..6fac27ee56 100644 --- a/meta/recipes-core/systemd/systemd_250.5.bb +++ b/meta/recipes-core/systemd/systemd_250.5.bb | |||
| @@ -238,6 +238,9 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \ | |||
| 238 | -Dnologin-path=${base_sbindir}/nologin \ | 238 | -Dnologin-path=${base_sbindir}/nologin \ |
| 239 | -Dumount-path=${base_bindir}/umount" | 239 | -Dumount-path=${base_bindir}/umount" |
| 240 | 240 | ||
| 241 | # The 60 seconds is watchdog's default vaule. | ||
| 242 | WATCHDOG_TIMEOUT ??= "60" | ||
| 243 | |||
| 241 | do_install() { | 244 | do_install() { |
| 242 | meson_do_install | 245 | meson_do_install |
| 243 | install -d ${D}/${base_sbindir} | 246 | install -d ${D}/${base_sbindir} |
| @@ -337,6 +340,11 @@ do_install() { | |||
| 337 | 340 | ||
| 338 | # add a profile fragment to disable systemd pager with busybox less | 341 | # add a profile fragment to disable systemd pager with busybox less |
| 339 | install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh | 342 | install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh |
| 343 | |||
| 344 | if [ -n "${WATCHDOG_TIMEOUT}" ]; then | ||
| 345 | sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \ | ||
| 346 | ${D}/${sysconfdir}/systemd/system.conf | ||
| 347 | fi | ||
| 340 | } | 348 | } |
| 341 | 349 | ||
| 342 | python populate_packages:prepend (){ | 350 | python populate_packages:prepend (){ |
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 = " \ | |||
| 13 | file://watchdog.conf \ | 13 | file://watchdog.conf \ |
| 14 | " | 14 | " |
| 15 | 15 | ||
| 16 | # The default value is 60 seconds when null. | ||
| 17 | WATCHDOG_TIMEOUT ??= "" | ||
| 18 | |||
| 16 | do_install() { | 19 | do_install() { |
| 17 | install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog | 20 | install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog |
| 18 | install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf | 21 | install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf |
| 22 | |||
| 23 | if [ -n "${WATCHDOG_TIMEOUT}" ]; then | ||
| 24 | echo "watchdog-timeout = ${WATCHDOG_TIMEOUT}" >> ${D}/etc/watchdog.conf | ||
| 25 | fi | ||
| 19 | } | 26 | } |
| 20 | 27 | ||
