On Mon, 2026-07-27 at 12:08 +0200, Fabian Pflug wrote:
> Some systems may have multiple watchdogs and want systemd to manage a
> different one. This patch allows to set the WatchdogDevice setting in
> system.conf
> 
> Signed-off-by: Fabian Pflug <[email protected]>
> ---
>  meta/recipes-core/systemd/systemd_259.5.bb | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/meta/recipes-core/systemd/systemd_259.5.bb 
> b/meta/recipes-core/systemd/systemd_259.5.bb
> index f3ec0edae7..8cb523a330 100644
> --- a/meta/recipes-core/systemd/systemd_259.5.bb
> +++ b/meta/recipes-core/systemd/systemd_259.5.bb
> @@ -253,6 +253,11 @@ WATCHDOG_TIMEOUT ??= "60"
>  # and the watchdog is enabled. (defaults is no hardware watchdog use)
>  WATCHDOG_RUNTIME_SEC ??= ""
>  
> +# If a different device, other then /dev/watchdog0 should be used, set
> +# WATCHDOG_DEVICE_PATH to the full path to the watchdog device.
> +# (Will set the WatchdogDevice= option in /etc/systemd/system.conf)
> +WATCHDOG_DEVICE_PATH ??= ""
> +
>  do_install() {
>       meson_do_install
>  
> @@ -368,6 +373,11 @@ do_install() {
>                       ${D}/${sysconfdir}/systemd/system.conf
>       fi
>  
> +     if [ -n "${WATCHDOG_DEVICE_PATH}" ]; then
> +             sed -i -e 
> 's|#WatchdogDevice=|WatchdogDevice=${WATCHDOG_DEVICE_PATH}|' \
> +                     ${D}/${sysconfdir}/systemd/system.conf
> +     fi
> +
>       # Actively disable Predictable Network Interface Names
>       if ! ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 
> 'false', d)}; then
>               sed -i 
> 's/^NamePolicy=.*/NamePolicy=/;s/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=/'
>  ${D}${nonarch_libdir}/systemd/network/99-default.link

Hi Fabian,

I'm not sure we need a new variable for this. If I understand correctly
you can install a drop-in file in ${sysconfdir}/systemd/system.conf.d to
set WatchdogDevice. That can easily be done from a bbappend or a new
recipe without needing any changes in OE-core.

Thanks,

-- 
Paul Barker

Attachment: signature.asc
Description: This is a digitally signed message part

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#242095): 
https://lists.openembedded.org/g/openembedded-core/message/242095
Mute This Topic: https://lists.openembedded.org/mt/120464520/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to