]> git.openfabrics.org - ~vlad/ofed_scripts.git/commitdiff
Remove OFED kernel modules from updates directory on uninstall.
authorVladimir Sokolovsky <vlad@mellanox.co.il>
Mon, 8 Dec 2008 11:03:27 +0000 (13:03 +0200)
committerVladimir Sokolovsky <vlad@mellanox.co.il>
Mon, 8 Dec 2008 11:03:27 +0000 (13:03 +0200)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
uninstall.sh

index e760f12e4a7315d469f8df3d11c68d3acc48a0ff..e737bd0399c7999d3558880ea189ae47b27d12a2 100755 (executable)
@@ -245,6 +245,13 @@ uninstall()
         STACK_PREFIX=$($RPM -ql libibverbs | grep "libibverbs.so" | head -1 | sed -e 's@/lib.*/libibverbs.so.*@@')            
     fi
 
+    if [ -x /etc/infiniband/info ]; then
+        if [ -z ${STACK_PREFIX} ]; then
+            STACK_PREFIX=`/etc/infiniband/info | grep -w prefix | cut -d '=' -f 2`
+        fi
+        KVERSION=`/etc/infiniband/info | grep -w Kernel | cut -d '=' -f 2`
+    fi
+
     if [ -n "${packs_to_remove}" ]; then
         ex "$RPM -e --allmatches $packs_to_remove"
     fi
@@ -264,10 +271,6 @@ uninstall()
         fi  
     fi
 
-    if [ -z ${STACK_PREFIX} ] && [ -x /etc/infiniband/info ]; then
-        STACK_PREFIX=`/etc/infiniband/info | grep -w prefix | cut -d '=' -f 2`
-    fi
-
     # Remove /usr/local/ofed* if exist
     # BUG: https://bugs.openfabrics.org/show_bug.cgi?id=563
     if [ -d ${STACK_PREFIX} ]; then
@@ -299,6 +302,15 @@ uninstall()
         ex $RPM -e ${voltaire_rpms}
     fi
 
+    if [ ! -z "${KVERSION}" ]; then
+        # Remove OFED kernel modules from updates directory
+        LIB_MOD_DIR=/lib/modules/${KVERSION}/updates
+        /bin/rm -rf ${LIB_MOD_DIR}/kernel/drivers/infiniband
+        /bin/rm -rf ${LIB_MOD_DIR}/kernel/drivers/net/mlx4
+        /bin/rm -rf ${LIB_MOD_DIR}/kernel/drivers/net/cxgb3
+        /bin/rm -rf ${LIB_MOD_DIR}/kernel/net/rds
+    fi
+
     perl -ni -e "print unless (/mlx4_core/)" /etc/modprobe.conf
 }