Systemd have a RebootWatchdogSec option that use watchdog to prevent
reboot hangs. And it can help prevent many kinds of hangs upon kdump
reboot, either it's systemd bug or kernel issue.
The overhead of watchdog drivers is trivial, and dracut have this new
watchdog-driver module that only load the kernel driver. So alway
install this module.
Also install all driver of watchdog instead of just active watchdog,
upstream dracut have changed the behaviour so follow up.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
---
dracut-module-setup.sh | 1 +
kdumpctl | 7 ++-----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index db9250d..9f25172 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -40,6 +40,7 @@ depends() {
dwarning "Required modules to build a squashed kdump image is
missing!"
fi
+ add_opt_module watchdog-modules
if is_wdt_active; then
add_opt_module watchdog
fi
diff --git a/kdumpctl b/kdumpctl
index 2f7e7e3..f633ccb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -438,13 +438,10 @@ check_drivers_modified()
# Detect watchdog drivers, if watchdog is available and not manually omitted
_record_wd_drivers() {
- local _active _wdtdrv _wdtppath _dir
+ local _wdtdrv _wdtppath _dir
# Copied logic from dracut 04watchdog/module-setup.sh::installkernel()
for _dir in /sys/class/watchdog/*; do
- [[ -f "$_dir/state" ]] || continue
- _active=$(< "$_dir/state")
- [[ "$_active" = "active" ]] || continue
# device/modalias will return driver of this device
[[ -f "$_dir/device/modalias" ]] || continue
_wdtdrv=$(< "$_dir/device/modalias")
@@ -462,7 +459,7 @@ check_drivers_modified()
fi
done
}
- is_dracut_mod_omitted watchdog || _record_wd_drivers
+ is_dracut_mod_omitted watchdog || is_dracut_mod_omitted watchdog-modules ||
_record_wd_drivers
[ -z "$_new_drivers" ] && return 0
--
2.28.0