-
Notifications
You must be signed in to change notification settings - Fork 0
/
lustre-dkms_pre-build.sh
executable file
·91 lines (80 loc) · 2.36 KB
/
lustre-dkms_pre-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
# $1 : $module
# $2 : $module_version
# $3 : $kernelver
# $4 : $kernel_source_dir
# $5 : $arch
# $6 : $source_tree
# $7 : $dkms_tree
case $1 in
lustre-client)
SERVER="--disable-server"
KERNEL_STUFF=""
;;
lustre-zfs|lustre-all)
LDISKFS=""
if [ "$1" == "lustre-zfs" ]; then
LDISKFS="--disable-ldiskfs"
fi
SPL_VERSION=$(dkms status -m spl -k $3 -a $5 | awk -F', ' '{print $2; exit 0}' | grep -v ': added$')
if [ -z $SPL_VERSION ] ; then
echo "spl-dkms package must already be installed and built under DKMS control"
exit 1
fi
ZFS_VERSION=$(dkms status -m zfs -k $3 -a $5 | awk -F', ' '{print $2; exit 0}' | grep -v ': added$')
if [ -z $ZFS_VERSION ] ; then
echo "zfs-dkms package must already be installed and built under DKMS control"
exit 1
fi
SERVER="--enable-server $LDISKFS \
--with-linux=$4 --with-linux-obj=$4 \
--with-spl=$6/spl-${SPL_VERSION} \
--with-spl-obj=$7/spl/${SPL_VERSION}/$3/$5 \
--with-zfs=$6/zfs-${ZFS_VERSION} \
--with-zfs-obj=$7/zfs/${ZFS_VERSION}/$3/$5"
KERNEL_STUFF="--with-linux=$4 --with-linux-obj=$4"
;;
lustre-ldiskfs)
SERVER="--enable-server --without-zfs --without-spl \
--with-linux=$4 --with-linux-obj=$4"
KERNEL_STUFF="--with-linux=$4 --with-linux-obj=$4"
;;
esac
PACKAGE_CONFIG="/etc/sysconfig/lustre"
DKMS_CONFIG_OPTS=$(
[[ -r ${PACKAGE_CONFIG} ]] \
&& source ${PACKAGE_CONFIG} \
&& shopt -q -s extglob \
&& \
{
if [[ ${LUSTRE_DKMS_DISABLE_CDEBUG,,} == @(y|yes) ]]
then
echo --disable-libcfs-cdebug
fi
if [[ ${LUSTRE_DKMS_DISABLE_TRACE,,} == @(y|yes) ]]
then
echo --disable-libcfs-trace
fi
if [[ ${LUSTRE_DKMS_DISABLE_ASSERT,,} == @(y|yes) ]]
then
echo --disable-libcfs-assert
fi
}
)
rpm -qa | grep krb5-devel >/dev/null
if [ $? == 0 ] ; then
GSS="--enable-gss"
else
GSS="--disable-gss"
fi
# run a configure pass to clean "--enable-dist" only effect and also to
# ensure local/on-target environment to be taken into account for
# dkms.mkconf script customizations and before next build/MAKE step
./configure --prefix=/usr --enable-modules --disable-iokit --disable-snmp \
--disable-doc --disable-utils --disable-tests --disable-maintainer-mode \
$KERNEL_STUFF $GSS $SERVER $DKMS_CONFIG_OPTS \
--disable-manpages --disable-mpitests
if [ $? != 0 ] ; then
echo "configure error, check $7/$1/$2/build/config.log"
exit 1
fi