2 # SPDX-License-Identifier: GPL-2.0
5 # This file is part of Lustre, http://www.lustre.org/
7 # lustre-dkms_pre-build.sh
9 # Script run before dkms build
14 # $2 : $module_version
16 # $4 : $kernel_source_dir
24 SERVER="--disable-server"
25 KERNEL_STUFF="--with-linux=$4 --with-linux-obj=$4"
28 lustre-zfs|lustre-all)
30 if [ "$1" == "lustre-zfs" ]; then
31 LDISKFS="--disable-ldiskfs"
34 # ZFS and SPL are version locked
35 ZFS_VERSION=$(dkms status -m zfs -k $3 -a $5 2>/dev/null |
36 sed -e 's:zfs/::g' -e 's:,.*::g' | cut -d: -f1 |
38 if [ -z $ZFS_VERSION ] ; then
39 echo "zfs-dkms package must already be installed and built under DKMS control"
43 SERVER="--enable-server $LDISKFS \
44 --with-linux=$4 --with-linux-obj=$4 \
45 --with-spl=$(realpath $7/spl/${ZFS_VERSION}/source) \
46 --with-spl-obj=$(realpath $7/spl/kernel-$3-$5) \
47 --with-zfs=$(realpath $7/zfs/${ZFS_VERSION}/source) \
48 --with-zfs-obj=$(realpath $7/zfs/kernel-$3-$5)"
50 KERNEL_STUFF="--with-linux=$4 --with-linux-obj=$4"
54 SERVER="--enable-server --without-zfs --without-spl \
55 --with-linux=$4 --with-linux-obj=$4"
57 KERNEL_STUFF="--with-linux=$4 --with-linux-obj=$4"
61 PACKAGE_CONFIG="/etc/sysconfig/lustre"
63 [[ -r ${PACKAGE_CONFIG} ]] \
64 && source ${PACKAGE_CONFIG} \
65 && shopt -q -s extglob \
68 if [[ ${LUSTRE_DKMS_DISABLE_CDEBUG,,} == @(y|yes) ]]
70 echo --disable-libcfs-cdebug
72 if [[ ${LUSTRE_DKMS_DISABLE_TRACE,,} == @(y|yes) ]]
74 echo --disable-libcfs-trace
76 if [[ ${LUSTRE_DKMS_DISABLE_ASSERT,,} == @(y|yes) ]]
78 echo --disable-libcfs-assert
83 rpm -qa | grep krb5-devel >/dev/null
90 # run a configure pass to clean "--enable-dist" only effect and also to
91 # ensure local/on-target environment to be taken into account for
92 # dkms.mkconf script customizations and before next build/MAKE step
93 ./configure --prefix=/usr --enable-modules --disable-iokit \
94 --disable-doc --disable-utils --disable-tests --disable-maintainer-mode \
95 $KERNEL_STUFF $GSS $SERVER $DKMS_CONFIG_OPTS \
96 --disable-manpages --disable-mpitests
99 echo "configure error, check $7/$1/$2/build/config.log"