diff options
author | Willy Tarreau <w@1wt.eu> | 2009-03-16 10:18:18 +0100 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2009-03-16 10:18:18 +0100 |
commit | 04d07502a4155d8552649b798687ed65f90715eb (patch) | |
tree | 8cfec6cb3bce8b11ceab83f5c6d650bb4362f5ff /scripts/pcidev | |
parent | * pcidev: use modprobe $list and not modprobe on each element (diff) | |
download | flxutils-04d07502a4155d8552649b798687ed65f90715eb.tar.xz |
* pcidev: modprobe in kernel 2.4 does not support module lists
Diffstat (limited to '')
-rwxr-xr-x | scripts/pcidev | 18 |
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 |