[PATCH V3 dracut 3/3] watchdog: ensure that module is loaded as early as possible

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

 



It is expected that a watchdog module will disable an active watchdog when
its probe is called ie, when it is loaded. So an early load of the module
will help to disable it earlier.
This can be helpful in some corner cases where kdump and watchdog daemon
both are active.

Signed-off-by: Pratyush Anand <panand@xxxxxxxxxx>
Cc: Dave Young <dyoung@xxxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Harald Hoyer <harald@xxxxxxxxxx>
---
 modules.d/04watchdog/module-setup.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
index 62e3fdf7829f..7667850ece8f 100755
--- a/modules.d/04watchdog/module-setup.sh
+++ b/modules.d/04watchdog/module-setup.sh
@@ -33,6 +33,7 @@ install() {
 }
 
 installkernel() {
+    wdtcmdline=""
     cd /sys/class/watchdog
     for dir in */; do
 	    cd $dir
@@ -46,6 +47,7 @@ installkernel() {
 		    # represented by modalias
 		    wdtdrv=`modprobe -R $wdtdrv | tr "\n" "," | sed 's/.$//'`
 		    instmods $wdtdrv
+		    wdtcmdline="$wdtcmdline$wdtdrv,"
 		    # however in some cases, we also need to check that if
 		    # there is a specific driver for the parent bus/device.
 		    # In such cases we also need to enable driver for parent
@@ -56,9 +58,14 @@ installkernel() {
 			    wdtpdrv=`cat $wdtppath/modalias`
 			    wdtpdrv=`modprobe -R $wdtpdrv | tr "\n" "," | sed 's/.$//'`
 			    instmods $wdtpdrv
+			    wdtcmdline="$wdtcmdline$wdtpdrv,"
 			    wdtppath="$wdtppath/.."
 		    done
 	    fi
 	    cd ..
     done
+    # ensure that watchdog module is loaded as early as possible
+    if [[ $wdtcmdline ]]; then
+	    echo "rd.driver.pre=$wdtcmdline" > ${initdir}/etc/cmdline.d/04-watchdog.conf
+    fi
 }
-- 
2.5.0

--
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