aboutsummaryrefslogtreecommitdiff
path: root/scripts/pcidev
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2009-03-16 10:18:18 +0100
committerWilly Tarreau <w@1wt.eu>2009-03-16 10:18:18 +0100
commit04d07502a4155d8552649b798687ed65f90715eb (patch)
tree8cfec6cb3bce8b11ceab83f5c6d650bb4362f5ff /scripts/pcidev
parent* pcidev: use modprobe $list and not modprobe on each element (diff)
downloadflxutils-04d07502a4155d8552649b798687ed65f90715eb.tar.xz
* pcidev: modprobe in kernel 2.4 does not support module lists
Diffstat (limited to '')
-rwxr-xr-xscripts/pcidev18
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/pcidev b/scripts/pcidev
index 82b4744..07ef5c3 100755
--- a/scripts/pcidev
+++ b/scripts/pcidev
@@ -33,6 +33,7 @@ ONLYMASK=( )
MAPFILE=
NBCLASS=0
PCIDEVDIR=/proc/bus/pci
+KVER=$(uname -r)
if [ ! -d "$PCIDEVDIR" ]; then
echo "No PCI support on this host. Aborting."
@@ -153,11 +154,20 @@ for device in $pcidev; do
if [ "$list" -a "$list" != "$oldlist" ]; then
oldlist="$list"
if [ $MODPROBE -gt 0 ]; then
- # modprobe is smart enough to try several modules
- if [ $VERBOSE -gt 0 ]; then
- echo "modprobe $list"
+ if [ -z "${KVER##2.6*}" ]; then
+ # modprobe in 2.6 is smart enough to try several modules
+ if [ $VERBOSE -gt 0 ]; then
+ echo "modprobe $list"
+ fi
+ modprobe $list
+ else
+ for module in $list; do
+ if [ $VERBOSE -gt 0 ]; then
+ echo "modprobe $module"
+ fi
+ modprobe $module
+ done
fi
- modprobe $list
else
echo $list
fi