]> git.ipfire.org Git - thirdparty/util-linux.git/commit
wdctl: Workaround reported boot-status bits not being present in wd->ident.options
authorHans de Goede <hdegoede@redhat.com>
Fri, 30 Jul 2021 11:22:54 +0000 (13:22 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Aug 2021 09:45:22 +0000 (11:45 +0200)
commitb1b0259fe42aad1bf0997ce1c03a020ce59e38ab
treeeeeac255ae236397403b5a9ce5266fed54cd597d
parente826aa3f4914ac6a8685454f18f41b2053c18346
wdctl: Workaround reported boot-status bits not being present in wd->ident.options

Some watchdog drivers are capable of reporting WDIOF_CARDRESET in their
bootstatus, but they do not advertise this in the options field
returned by the WDIOC_GETSUPPORT ioctl.

This causes wdctl to not print the CARDRESET flag on these devices,
even when the reset was caused by the watchdog and this is being
reported in the WDIOC_GETBOOTSTATUS return.

Add a workaround by or-ing any bits which are set in the status and
bstatus returns into wd->ident.options so that reported flags will
get printend independent of them being advertised as supported in
wd->ident.options.

This will make wdctl print a CARDRESET line when the system was
actually reset by the watchdog while omitting it when it was not
reset by the watchdog.  At least on drivers which have the
CARDRESET is missing from info.options problem.  On other drivers
the CARDRESET line will always be printend, but the actual reported
value will change.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sys-utils/wdctl.c