Whamcloud - gitweb
LU-11085 ldlm: optimise extent locks with identical extent
[fs/lustre-release.git] / debian / dkms.conf.in
1 # SPDX-License-Identifier: NOASSERTION
2
3 #
4 # Copyright 2012 Genome Research Ltd.
5 #           2017-2018 Universität Hamburg
6 #
7
8 #
9 # This file is part of Lustre, http://www.lustre.org/
10 #
11 # debian/dkms.conf.in
12 #
13 # Lustre Linux kernel module (DKMS)
14 #
15 # Created by Guy Coates
16 # Updated by Michael Kuhn
17 #
18
19 PACKAGE_NAME="lustre-client-modules"
20 PACKAGE_CONFIG="/etc/sysconfig/lustre"
21 PACKAGE_VERSION="@UPVERSION@"
22
23 OPTS=""
24 if [[ "x${PACKAGE_NAME}" = "xlustre-client-modules" ]] ; then
25     OPTS="${OPTS} --disable-server --disable-quilt"
26 fi
27 OPTS="${OPTS} --disable-dependency-tracking --disable-doc"
28 OPTS="${OPTS} --disable-utils --disable-iokit --disable-tests"
29 OPTS="${OPTS} --enable-quota --with-kmp-moddir=updates"
30
31 if [[ -r ${PACKAGE_CONFIG} ]] ; then
32    source ${PACKAGE_CONFIG}
33    shopt -q -s extglob
34    if [[ -n ${LUSTRE_DKMS_DISABLE_CDEBUG} ]] ; then
35       [[ ${LUSTRE_DKMS_DISABLE_CDEBUG,,} == @(y|yes) ]] &&
36          OPTS="${OPTS} --disable-libcfs-cdebug" ||
37          OPTS="${OPTS} --enable-libcfs-cdebug"
38    fi
39    if [[ -n ${LUSTRE_DKMS_DISABLE_TRACE} ]] ; then
40       [[ ${LUSTRE_DKMS_DISABLE_TRACE,,} == @(y|yes) ]] &&
41          OPTS="${OPTS} --disable-libcfs-trace" ||
42          OPTS="${OPTS} --enable-libcfs-trace"
43    fi
44    if [[ -n ${LUSTRE_DKMS_DISABLE_ASSERT} ]] ; then
45       [[ ${LUSTRE_DKMS_DISABLE_ASSERT,,} == @(y|yes) ]] &&
46          OPTS="${OPTS} --disable-libcfs-assert" ||
47          OPTS="${OPTS} --enable-libcfs-assert"
48    fi
49    if [[ -n ${LUSTRE_DKMS_ENABLE_GSS} ]] ; then
50       [[ ${LUSTRE_DKMS_ENABLE_GSS,,} == @(y|yes) ]] &&
51          OPTS="${OPTS} --enable-gss" || OPTS="${OPTS} --disable-gss"
52    fi
53    if [[ -n ${LUSTRE_DKMS_ENABLE_GSS_KEYRING} ]] ; then
54       [[ ${LUSTRE_DKMS_ENABLE_GSS_KEYRING,,} == @(y|yes) ]] &&
55          OPTS="${OPTS} --enable-gss-keyring" ||
56          OPTS="${OPTS} --disable-gss-keyring"
57    fi
58    if [[ -n ${LUSTRE_DKMS_ENABLE_CRYPTO} ]] ; then
59       [[ ${LUSTRE_DKMS_ENABLE_CRYPTO,,} == @(y|yes) ]] &&
60          OPTS="${OPTS} --enable-crypto" || OPTS="${OPTS} --disable-crypto"
61    fi
62    [[ -n ${LUSTRE_DKMS_CONFIGURE_EXTRA} ]] &&
63        OPTS="${OPTS} ${LUSTRE_DKMS_CONFIGURE_EXTRA}"
64 fi
65 echo "${OPTS} " | grep -E -q -- '--disable-gss[^-]|--enable-gss[^-]' ||
66   dpkg -l | grep libkrb5-dev | grep -q ^ii &&
67       OPTS="${OPTS} --enable-gss" || OPTS="${OPTS} --disable-gss"
68
69 AUTOGEN="sh ./autogen.sh"
70 CONFIGURE="./configure --with-linux=$kernel_source_dir"
71 CONFIGURE="${CONFIGURE} --with-linux-obj=$kernel_source_dir ${OPTS}"
72
73 # Note OPTS, AUTOGEN, CONFIGURE are not exposed to dkms parser
74
75 MAKE="${AUTOGEN} && ${CONFIGURE} && make"
76 CLEAN="make distclean || true"
77
78 NO_WEAK_MODULES="yes"
79 AUTOINSTALL="yes"
80 STRIP="no"
81
82 # Where modules are installed
83 kmoddir="updates/kernel"
84
85 module() {
86   built_name=$1
87   built_loc=$2
88   dest=$3
89   do_strip=$4
90
91   [[ -z $do_strip ]] && do_strip=${STRIP}
92   BUILT_MODULE_NAME[${#BUILT_MODULE_NAME[@]}]=${built_name}
93   BUILT_MODULE_LOCATION[${#BUILT_MODULE_LOCATION[@]}]=${built_loc}/
94   DEST_MODULE_LOCATION[${#DEST_MODULE_LOCATION[@]}]="/updates/kernel/${dest}/"
95   STRIP[${#STRIP[@]}]=${do_strip}
96 }
97
98 module libcfs        libcfs/libcfs      net/lustre
99 module lnet          lnet/lnet          net/lustre
100 module lnet_selftest lnet/selftest      net/lustre
101 module ksocklnd      lnet/klnds/socklnd net/lustre
102
103 # LNet lnd modules
104 lnds="socklnd"
105 if [ -f /usr/src/kfabric/default/Module.symvers ] ; then
106     module kkfilnd   lnet/klnds/kfilnd  net/lustre
107 fi
108 if pkg-config --cflags cray-gni cray-gni-headers cray-krca lsb-cray-hss > /dev/null 2>&1 ; then
109     module kgnilnd   lnet/klnds/gnilnd  net/lustre
110 fi
111 # Determine which, if any, o2ib to install:
112 can_o2ib_mofed=no
113 can_o2ib_in_kernel=no
114 ext_mofed=no
115 int_mofed=no
116 [[ -f ${kernel_source_dir}/include/rdma/rdma_cm.h ]] &&
117 [[ -f ${kernel_source_dir}/include/rdma/ib_cm.h ]] &&
118 [[ -f ${kernel_source_dir}/include/rdma/ib_verbs.h ]] &&
119    can_o2ib_in_kernel=yes
120 # Now check if ext_o2ib is explicit, or will be auto-detected:
121 o2ib=$(echo ${OPTS} | tr ' ' '\\n' | grep -- '--with-o2ib=' | cut -c 13-)
122 if [[ "x$o2ib" = "xno" ]] ; then
123    can_o2ib_in_kernel=no
124 elif [[ -f $o2ib ]] ; then
125    # User specified path, if the build completes it will be ext_ofed
126    can_o2ib_mofed=yes
127    ext_mofed=yes
128 else
129    # could be either, ext_ofed will be preferred by default
130    if which ofed_info >/dev/null ; then
131       pkgs="mlnx-ofed-kernel-dkms|mlnx-ofed-kernel-modules|mlnx-ofa_kernel-devel"
132       pkgs="${pkgs}|compat-rdma-devel|kernel-ib-devel|ofa_kernel-devel"
133       paths=$(dpkg -l | awk '{print $2}' |
134               grep -E -w "${pkgs}" | xargs dpkg --listfiles 2>/dev/null |
135               grep -E '/ofa_kernel|/ofa_kernel/default|/openib' |
136               grep -v /ofed_scripts/ | head -n1)
137       if [[ -n "$paths" ]]; then
138           epaths=$(find $paths -name rdma_cm.h |
139                    grep -F -e "$(uname -r)" -e default |
140                    sed -e 's:/include/rdma/rdma_cm.h::')
141           if [ $(echo $epaths | wc -w) -eq 1 ]; then
142              can_o2ib_mofed=yes
143              ext_mofed=yes
144           fi
145       fi
146    fi
147 fi
148 [[ "x${ext_mofed}" = "xno" ]] && [[ x${can_o2ib_in_kernel} = "xyes" ]] &&
149    int_mofed=yes
150
151 if [ "x${ext_mofed}" = "xyes" ] ; then
152     module ko2iblnd lnet/klnds/o2iblnd net/lustre
153 elif [ "x${int_mofed}" = "xyes" ] ; then
154     module ko2iblnd lnet/klnds/in-kernel-o2iblnd net/lustre
155 fi
156
157 module fid       lustre/fid      fs/lustre
158 module fld       lustre/fld      fs/lustre
159 module lmv       lustre/lmv      fs/lustre
160 module lov       lustre/lov      fs/lustre
161 module lustre    lustre/llite    fs/lustre
162 module mdc       lustre/mdc      fs/lustre
163 module mgc       lustre/mgc      fs/lustre
164 module obdclass  lustre/obdclass fs/lustre
165 module obdecho   lustre/obdecho  fs/lustre
166 module osc       lustre/osc      fs/lustre
167 module ptlrpc    lustre/ptlrpc   fs/lustre
168
169 # Lustre optional gss module:
170 if echo "${OPTS} " | grep -E -q -- '--enable-gss[^-]' ; then
171     module ptlrpc_gss lustre/ptlrpc/gss fs/lustre
172 fi