5 while getopts "n:v:f:" opt; do
13 if [ -z "${pkgname}" -o -z "${pkgver}" -o -z "${filename}" ]; then
14 echo "Usage: $PROG -n <pkgname> -v <pkgver> -f <filename>"
18 rpm -qa | grep krb5-devel >/dev/null
25 cat >${filename} <<EOF
26 PACKAGE_NAME="${pkgname}"
27 PACKAGE_VERSION="${pkgver}"
28 PACKAGE_CONFIG="/etc/sysconfig/lustre"
29 # re-evaluate/create dkms.conf on-target based on local build-time products/dependencies
30 # (like krb5-devel presence) and also upon configure results/errors before dkms builds
31 PRE_BUILD="lustre-dkms_pre-build.sh \$module \$module_version \$kernelver \$kernel_source_dir \
32 \$arch \$source_tree \$dkms_tree"
33 # to ensure all just built Lustre kernel modules will be saved for further install
34 POST_BUILD="lustre-dkms_post-build.sh \$module \$module_version \$kernelver \$kernel_source_dir \
35 \$arch \$source_tree \$dkms_tree"
37 if [ $pkgname = "lustre" ] ; then
38 cat >>${filename} <<EOF
39 BUILD_DEPENDS[0]="zfs"
42 cat >>${filename} <<EOF
46 # just have to set STRIP[0], it will become the new default.
48 [[ -r \${PACKAGE_CONFIG} ]] \\
49 && source \${PACKAGE_CONFIG} \\
50 && shopt -q -s extglob \\
51 && [[ \${LUSTRE_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\
55 # Common modules for both Client & Server
56 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lnet_selftest"
57 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lnet/selftest/"
58 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lnet/"
59 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lnet"
60 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lnet/lnet/"
61 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lnet/"
62 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="ksocklnd"
63 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lnet/klnds/socklnd/"
64 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lnet/"
65 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="ko2iblnd"
66 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lnet/klnds/o2iblnd/"
67 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lnet/"
68 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="libcfs"
69 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="libcfs/libcfs/"
70 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
71 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="ptlrpc"
72 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/ptlrpc/"
73 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
74 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lov"
75 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/lov/"
76 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
77 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="fld"
78 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/fld/"
79 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
80 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="obdecho"
81 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/obdecho/"
82 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
83 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="osc"
84 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/osc/"
85 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
86 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="mgc"
87 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/mgc/"
88 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
89 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="fid"
90 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/fid/"
91 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
92 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="mdc"
93 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/mdc/"
94 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
95 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="obdclass"
96 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/obdclass/"
97 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
98 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lmv"
99 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/lmv/"
100 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
101 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lustre"
102 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/llite/"
103 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
105 if [ $GSS = "yes" ] ; then
106 cat >>${filename} <<EOF
107 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="ptlrpc_gss"
108 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/ptlrpc/gss/"
109 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
112 if [ $pkgname = "lustre" ] ; then
113 cat >>${filename} <<EOF
114 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="ofd"
115 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/ofd/"
116 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
117 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="ost"
118 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/ost/"
119 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
120 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lfsck"
121 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/lfsck/"
122 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
123 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="osd_zfs"
124 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/osd-zfs/"
125 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
126 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="mgs"
127 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/mgs/"
128 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
129 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lquota"
130 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/quota/"
131 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
132 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="mdt"
133 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/mdt/"
134 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
135 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="osp"
136 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/osp/"
137 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
138 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="mdd"
139 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/mdd/"
140 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
141 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="llog_test"
142 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/obdclass/"
143 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"
144 BUILT_MODULE_NAME[\${#BUILT_MODULE_NAME[@]}]="lod"
145 BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/lod/"
146 DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/@KMP_MODDIR@/lustre/"