[PATCH 3/3] insert wdt kernel modules when watchdog is active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When watchdog is enabled in 1st kernel, then crash dump in kdump
kernel will be interrupted if watchdog is timeout. Since some
wdt drivers can stop the watchdog when its driver is loaded,
e.g iTCO_wdt, this can benefit crash dump.

Add watchdog driver which is active in system to initramfs, its
loading can stop watchdog.
---
 modules.d/04watchdog/module-setup.sh | 37 +++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
index 44dce61..51d454b 100755
--- a/modules.d/04watchdog/module-setup.sh
+++ b/modules.d/04watchdog/module-setup.sh
@@ -14,18 +14,29 @@ depends() {
 
 # called by dracut
 install() {
-    inst_hook cmdline   00 "$moddir/watchdog.sh"
-    inst_hook cmdline   50 "$moddir/watchdog.sh"
-    inst_hook pre-trigger 00 "$moddir/watchdog.sh"
-    inst_hook initqueue 00 "$moddir/watchdog.sh"
-    inst_hook mount     00 "$moddir/watchdog.sh"
-    inst_hook mount     50 "$moddir/watchdog.sh"
-    inst_hook mount     99 "$moddir/watchdog.sh"
-    inst_hook pre-pivot 00 "$moddir/watchdog.sh"
-    inst_hook pre-pivot 99 "$moddir/watchdog.sh"
-    inst_hook cleanup   00 "$moddir/watchdog.sh"
-    inst_hook cleanup   99 "$moddir/watchdog.sh"
-    inst_hook emergency 02 "$moddir/watchdog-stop.sh"
-    inst_multiple -o wdctl
+    if [[$testonly = "yes" ]]; then
+        inst_hook cmdline   00 "$moddir/watchdog.sh"
+        inst_hook cmdline   50 "$moddir/watchdog.sh"
+        inst_hook pre-trigger 00 "$moddir/watchdog.sh"
+        inst_hook initqueue 00 "$moddir/watchdog.sh"
+        inst_hook mount     00 "$moddir/watchdog.sh"
+        inst_hook mount     50 "$moddir/watchdog.sh"
+        inst_hook mount     99 "$moddir/watchdog.sh"
+        inst_hook pre-pivot 00 "$moddir/watchdog.sh"
+        inst_hook pre-pivot 99 "$moddir/watchdog.sh"
+        inst_hook cleanup   00 "$moddir/watchdog.sh"
+        inst_hook cleanup   99 "$moddir/watchdog.sh"
+        inst_hook emergency 02 "$moddir/watchdog-stop.sh"
+        inst_multiple -o wdctl
+    fi
 }
 
+installkernel() {
+    if [[$testonly = "no" ]]; then
+        wdt=$(lsmod|cut -f1 -d' '|grep "wdt$")
+        if [ -n "$wdt" ]; then
+            instmods $wdt
+            [ "$wdt" = "iTCO_wdt" ] && instmods lpc_ich
+        fi
+    fi
+}
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux