[Fai-commit] r6040 - branches/stable/3.4/examples/simple/class

Michael Prokop mika at alioth.debian.org
Tue Aug 17 12:58:36 UTC 2010


Author: mika
Date: 2010-08-17 12:58:34 +0000 (Tue, 17 Aug 2010)
New Revision: 6040

Modified:
   branches/stable/3.4/examples/simple/class/20-hwdetect.source
Log:
20-hwdetect.source: make sure the kernel module directory drivers/ide/pci exists before using it.

Signed-off-by: Michael Prokop <mika at grml.org>

Modified: branches/stable/3.4/examples/simple/class/20-hwdetect.source
===================================================================
--- branches/stable/3.4/examples/simple/class/20-hwdetect.source	2010-08-17 12:58:29 UTC (rev 6039)
+++ branches/stable/3.4/examples/simple/class/20-hwdetect.source	2010-08-17 12:58:34 UTC (rev 6040)
@@ -12,10 +12,13 @@
 # load all IDE drivers
 
 # DMA does not work if we load all modules in drivers/ide, so only try pci modules
-mod=$(find /lib/modules/$(uname -r)/kernel/drivers/ide/pci -type f | sed 's/\.ko$//' | sed 's/.*\///')
-for i in $mod; do
-    modprobe $i 1>/dev/null 2>&1
-done
+if [ -d /lib/modules/$(uname -r)/kernel/drivers/ide/pci ] ; then
+    mod=$(find /lib/modules/$(uname -r)/kernel/drivers/ide/pci -type f | sed 's/\.ko$//' | sed 's/.*\///')
+    for i in $mod; do
+        modprobe $i 1>/dev/null 2>&1
+    done
+fi
+
 # Booting from CD does not always enable DMA.
 for d in $( echo /proc/ide/hd[a-z] 2>/dev/null); do
     [ -d $d ] && echo "using_dma:1" > $d/settings




More information about the Fai-commit mailing list