From 04d07502a4155d8552649b798687ed65f90715eb Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 16 Mar 2009 10:18:18 +0100 Subject: * pcidev: modprobe in kernel 2.4 does not support module lists --- scripts/pcidev | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3