3 # remove all lustre modules. Won't succeed if they're in use, or if you
4 # manually did a 'lctl network up'.
5 ###############################################################################
10 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
11 LCTL=${LCTL:-"$LUSTRE/utils/lctl"}
12 [ ! -f "$LCTL" ] && export LCTL=$(which lctl 2> /dev/null)
15 if [ `uname -r | cut -c 3` -eq 4 ]; then
20 # libcfs 107852 17 llite_lloop,lustre,obdfilter,ost,...
22 local DEPS="$(lsmod | awk '($1 == "'$MODULE'") { print $4 }' | tr ',' ' ')"
23 for SUBMOD in $DEPS; do
24 unload_dep_module $SUBMOD
26 [ "$MODULE" = "libcfs" ] && $LCTL dk $TMP/debug >/dev/null || true
27 $RMMOD $MODULE 2>/dev/null || true
31 lsmod | grep obdclass > /dev/null && $LCTL dl
32 lsmod | grep $FSTYPE > /dev/null && unload_dep_module $FSTYPE
33 lsmod | grep ptlrpc > /dev/null && unload_dep_module ptlrpc
34 lsmod | grep libcfs > /dev/null && unload_dep_module libcfs
36 MODULES=$($LCTL modules | awk '{ print $2 }')
37 if [ -n "$MODULES" ]; then
38 echo "Modules still loaded: "