Whamcloud - gitweb
LU-6158 mdt: always shrink_capsule in getxattr_all
[fs/lustre-release.git] / lustre / scripts / ko2iblnd-probe
1 #!/bin/sh
2
3 # flags of IB devices which present
4 HFI=0
5 QIB=0
6
7 # no profile name by default
8 PROFILE=""
9
10 INFINIBAND="/sys/class/infiniband"
11
12 if [ -d $INFINIBAND ]; then
13         for dev in `ls -d $INFINIBAND/* | sed -e "s#^$INFINIBAND/##" -e 's#_[0-9]*$##'`; do
14                 ver=`echo $dev | sed -ne 's#[^0-9]*##p'`
15                 case $dev in
16                 hfi*) HFI=1 ;;
17                 qib*) QIB=1 ;;
18                 esac
19         done
20
21         # Set profile name according priority
22         if [ $HFI -ne 0 ]; then
23                 PROFILE="-opa"
24         elif [ $QIB -ne 0 ]; then
25                 PROFILE="-opa"
26         fi
27 fi
28
29 exec /sbin/modprobe --ignore-install ko2iblnd$PROFILE $CMDLINE_OPTS