Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
LU-1032 build: Add Lustre DKMS spec file
Add a lustre-dkms.spec file which can be used to distribute dkms style Lustre modules. The spec file is originally based on the generic dkms template and the default behavior is as follows: * Disable ldiskfs osd support. The ldiskfs packages currently cannot be built reliably against arbitrary kernels and are therefore disabled by default. * Enable zfs osd support. ZFS dkms packages are hosted at http://archive.zfsonlinux.org/{epel,fedora}/{release}/ and are compatible once LU-3117 is merged in to the Lustre source. * Some of the default Lustre build options can be changed by setting parameted in the /etc/sysconfig/lustre config file. Going forward the options can be extended as needed. The currently supported options are: * LUSTRE_DKMS_DISABLE_CDEBUG=y|N * LUSTRE_DKMS_DISABLE_TRACE=y|N * LUSTRE_DKMS_DISABLE_ASSERT=y|N * LUSTRE_DKMS_DISABLE_STRIP=y|N * A build target was not added for the lustre-dkms.spec file. To create lustre dkms packages you must manually invoke rpmbuild. ./configure --enable-dist make dist rpmbuild -bs lustre-dkms.spec lustre-x.y.z.tar.gz rpmbuild --rebuild lustre-dkms-x.y.z-r.dist.src.rpm Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Change-Id: I870f362b8948d5cd28a8dccd98b565e38ad2da7c
- Loading branch information
1 parent
d3f91c4
commit 4afc957
Showing
5 changed files
with
266 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| %define module @PACKAGE@ | ||
| %define buildid 1 | ||
| %define mkconf lustre/scripts/dkms.mkconf | ||
|
|
||
| Name: %{module}-dkms | ||
|
|
||
| Version: @VERSION@ | ||
| Release: %{buildid}%{?dist} | ||
| Summary: Kernel module(s) (dkms) | ||
|
|
||
| Group: System Environment/Kernel | ||
| License: GPLv2+ | ||
| URL: http://lustre.opensfs.org/ | ||
| Source0: %{module}-%{version}.tar.gz | ||
| BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
| BuildArch: noarch | ||
|
|
||
| Requires: dkms >= 2.2.0.2 | ||
| Requires: spl-dkms >= 0.6.1 | ||
| Requires: zfs-dkms >= 0.6.1 | ||
| Requires: zfs-devel >= 0.6.1 | ||
| Requires: gcc, make, perl | ||
| Requires: kernel-devel | ||
| Provides: %{module}-kmod = %{version} | ||
| Provides: %{module}-modules = %{version} | ||
| Provides: lustre-osd | ||
|
|
||
| %description | ||
| This package contains the dkms Lustre kernel modules. | ||
|
|
||
| %prep | ||
| %setup -q -n %{module}-%{version} | ||
|
|
||
| %build | ||
| %{mkconf} -n %{module} -v %{version} -f dkms.conf | ||
| sed -i 's/BUILDID[[:print:]]*/BUILDID = %{buildid}/' META | ||
| sed -i 's/PRISTINE[[:print:]]*/PRISTINE = 1/' META | ||
| cp META ldiskfs/META | ||
|
|
||
| %install | ||
| if [ "$RPM_BUILD_ROOT" != "/" ]; then | ||
| rm -rf $RPM_BUILD_ROOT | ||
| fi | ||
| mkdir -p $RPM_BUILD_ROOT/usr/src/ | ||
| cp -rfp ${RPM_BUILD_DIR}/%{module}-%{version} $RPM_BUILD_ROOT/usr/src/ | ||
|
|
||
| %clean | ||
| if [ "$RPM_BUILD_ROOT" != "/" ]; then | ||
| rm -rf $RPM_BUILD_ROOT | ||
| fi | ||
|
|
||
| %files | ||
| %defattr(-,root,root) | ||
| /usr/src/%{module}-%{version} | ||
|
|
||
| %post | ||
| for POSTINST in /usr/lib/dkms/common.postinst; do | ||
| if [ -f $POSTINST ]; then | ||
| $POSTINST %{module} %{version} | ||
| exit $? | ||
| fi | ||
| echo "WARNING: $POSTINST does not exist." | ||
| done | ||
| echo -e "ERROR: DKMS version is too old and %{module} was not" | ||
| echo -e "built with legacy DKMS support." | ||
| echo -e "You must either rebuild %{module} with legacy postinst" | ||
| echo -e "support or upgrade DKMS to a more current version." | ||
| exit 1 | ||
|
|
||
| %preun | ||
| dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade | ||
| exit 0 | ||
|
|
||
| %changelog | ||
| * Thu Aug 8 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 2.4.0-1 | ||
| - DKMS packages. | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,186 @@ | ||
| #!/bin/sh | ||
|
|
||
| PROG=$0 | ||
|
|
||
| pkgcfg=/etc/sysconfig/lustre | ||
|
|
||
| while getopts "n:v:c:f:" opt; do | ||
| case $opt in | ||
| n) pkgname=$OPTARG ;; | ||
| v) pkgver=$OPTARG ;; | ||
| c) pkgcfg=$OPTARG ;; | ||
| f) filename=$OPTARG ;; | ||
| esac | ||
| done | ||
|
|
||
| if [ -z "${pkgname}" -o -z "${pkgver}" -o -z "${filename}" ]; then | ||
| echo "Usage: $PROG -n <pkgname> -v <pkgver> -c <pkgcfg> -f <filename>" | ||
| exit 1 | ||
| fi | ||
|
|
||
| cat >${filename} <<EOF | ||
| PACKAGE_NAME="${pkgname}" | ||
| PACKAGE_VERSION="${pkgver}" | ||
| PACKAGE_CONFIG="${pkgcfg}" | ||
| SPL_VERSION=\$(dkms status -m spl | awk -F', ' '{print \$2; exit 0}') | ||
| ZFS_VERSION=\$(dkms status -m zfs | awk -F', ' '{print \$2; exit 0}') | ||
| PRE_BUILD="configure | ||
| --prefix=/usr | ||
| --with-linux=\${kernel_source_dir} | ||
| --with-linux-obj=\${kernel_source_dir} | ||
| --with-spl=\${dkms_tree}/spl/\${SPL_VERSION}/build | ||
| --with-spl-obj=\${dkms_tree}/spl/\${SPL_VERSION}/\${kernelver}/\${arch} | ||
| --with-zfs=\${dkms_tree}/zfs/\${ZFS_VERSION}/build | ||
| --with-zfs-obj=\${dkms_tree}/zfs/\${ZFS_VERSION}/\${kernelver}/\${arch} | ||
| --without-ldiskfs | ||
| --without-sysio | ||
| --without-lustre-iokit | ||
| --disable-snmp | ||
| --disable-doc | ||
| --disable-utils | ||
| --disable-tests | ||
| --disable-maintainer-mode | ||
| \$( | ||
| [[ -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 | ||
| } | ||
| ) | ||
| " | ||
| BUILD_DEPENDS[0]="zfs" | ||
| AUTOINSTALL="yes" | ||
| REMAKE_INITRD="no" | ||
| MAKE[0]="make" | ||
| STRIP[0]="\$( | ||
| [[ -r \${PACKAGE_CONFIG} ]] \\ | ||
| && source \${PACKAGE_CONFIG} \\ | ||
| && shopt -q -s extglob \\ | ||
| && [[ \${LUSTRE_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\ | ||
| && echo -n no | ||
| )" | ||
| STRIP[1]="\${STRIP[0]}" | ||
| STRIP[2]="\${STRIP[0]}" | ||
| STRIP[3]="\${STRIP[0]}" | ||
| STRIP[4]="\${STRIP[0]}" | ||
| STRIP[5]="\${STRIP[0]}" | ||
| STRIP[6]="\${STRIP[0]}" | ||
| STRIP[7]="\${STRIP[0]}" | ||
| STRIP[8]="\${STRIP[0]}" | ||
| STRIP[9]="\${STRIP[0]}" | ||
| STRIP[10]="\${STRIP[0]}" | ||
| STRIP[11]="\${STRIP[0]}" | ||
| STRIP[12]="\${STRIP[0]}" | ||
| STRIP[13]="\${STRIP[0]}" | ||
| STRIP[14]="\${STRIP[0]}" | ||
| STRIP[15]="\${STRIP[0]}" | ||
| STRIP[16]="\${STRIP[0]}" | ||
| STRIP[17]="\${STRIP[0]}" | ||
| STRIP[18]="\${STRIP[0]}" | ||
| STRIP[19]="\${STRIP[0]}" | ||
| STRIP[20]="\${STRIP[0]}" | ||
| STRIP[21]="\${STRIP[0]}" | ||
| STRIP[22]="\${STRIP[0]}" | ||
| STRIP[23]="\${STRIP[0]}" | ||
| STRIP[24]="\${STRIP[0]}" | ||
| STRIP[25]="\${STRIP[0]}" | ||
| STRIP[26]="\${STRIP[0]}" | ||
| STRIP[27]="\${STRIP[0]}" | ||
| BUILT_MODULE_NAME[0]="lnet_selftest" | ||
| BUILT_MODULE_LOCATION[0]="lnet/selftest/" | ||
| DEST_MODULE_LOCATION[0]="/extra/lnet/" | ||
| BUILT_MODULE_NAME[1]="lnet" | ||
| BUILT_MODULE_LOCATION[1]="lnet/lnet/" | ||
| DEST_MODULE_LOCATION[1]="/extra/lnet/" | ||
| BUILT_MODULE_NAME[2]="ksocklnd" | ||
| BUILT_MODULE_LOCATION[2]="lnet/klnds/socklnd/" | ||
| DEST_MODULE_LOCATION[2]="/extra/lnet/" | ||
| BUILT_MODULE_NAME[3]="ko2iblnd" | ||
| BUILT_MODULE_LOCATION[3]="lnet/klnds/o2iblnd/" | ||
| DEST_MODULE_LOCATION[3]="/extra/lnet/" | ||
| BUILT_MODULE_NAME[4]="libcfs" | ||
| BUILT_MODULE_LOCATION[4]="libcfs/libcfs/" | ||
| DEST_MODULE_LOCATION[4]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[5]="ptlrpc" | ||
| BUILT_MODULE_LOCATION[5]="lustre/ptlrpc/" | ||
| DEST_MODULE_LOCATION[5]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[6]="lvfs" | ||
| BUILT_MODULE_LOCATION[6]="lustre/lvfs/" | ||
| DEST_MODULE_LOCATION[6]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[7]="lov" | ||
| BUILT_MODULE_LOCATION[7]="lustre/lov/" | ||
| DEST_MODULE_LOCATION[7]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[8]="osd_zfs" | ||
| BUILT_MODULE_LOCATION[8]="lustre/osd-zfs/" | ||
| DEST_MODULE_LOCATION[8]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[9]="fld" | ||
| BUILT_MODULE_LOCATION[9]="lustre/fld/" | ||
| DEST_MODULE_LOCATION[9]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[10]="obdecho" | ||
| BUILT_MODULE_LOCATION[10]="lustre/obdecho/" | ||
| DEST_MODULE_LOCATION[10]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[11]="mgs" | ||
| BUILT_MODULE_LOCATION[11]="lustre/mgs/" | ||
| DEST_MODULE_LOCATION[11]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[12]="osc" | ||
| BUILT_MODULE_LOCATION[12]="lustre/osc/" | ||
| DEST_MODULE_LOCATION[12]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[13]="lquota" | ||
| BUILT_MODULE_LOCATION[13]="lustre/quota/" | ||
| DEST_MODULE_LOCATION[13]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[14]="mgc" | ||
| BUILT_MODULE_LOCATION[14]="lustre/mgc/" | ||
| DEST_MODULE_LOCATION[14]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[15]="mdt" | ||
| BUILT_MODULE_LOCATION[15]="lustre/mdt/" | ||
| DEST_MODULE_LOCATION[15]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[16]="osp" | ||
| BUILT_MODULE_LOCATION[16]="lustre/osp/" | ||
| DEST_MODULE_LOCATION[16]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[17]="mdd" | ||
| BUILT_MODULE_LOCATION[17]="lustre/mdd/" | ||
| DEST_MODULE_LOCATION[17]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[18]="lustre" | ||
| BUILT_MODULE_LOCATION[18]="lustre/llite/" | ||
| DEST_MODULE_LOCATION[18]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[19]="llite_lloop" | ||
| BUILT_MODULE_LOCATION[19]="lustre/llite/" | ||
| DEST_MODULE_LOCATION[19]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[20]="fid" | ||
| BUILT_MODULE_LOCATION[20]="lustre/fid/" | ||
| DEST_MODULE_LOCATION[20]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[21]="mdc" | ||
| BUILT_MODULE_LOCATION[21]="lustre/mdc/" | ||
| DEST_MODULE_LOCATION[21]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[22]="obdclass" | ||
| BUILT_MODULE_LOCATION[22]="lustre/obdclass/" | ||
| DEST_MODULE_LOCATION[22]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[23]="llog_test" | ||
| BUILT_MODULE_LOCATION[23]="lustre/obdclass/" | ||
| DEST_MODULE_LOCATION[23]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[24]="lod" | ||
| BUILT_MODULE_LOCATION[24]="lustre/lod/" | ||
| DEST_MODULE_LOCATION[24]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[25]="lmv" | ||
| BUILT_MODULE_LOCATION[25]="lustre/lmv/" | ||
| DEST_MODULE_LOCATION[25]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[26]="ofd" | ||
| BUILT_MODULE_LOCATION[26]="lustre/ofd/" | ||
| DEST_MODULE_LOCATION[26]="/extra/lustre/" | ||
| BUILT_MODULE_NAME[27]="ost" | ||
| BUILT_MODULE_LOCATION[27]="lustre/ost/" | ||
| DEST_MODULE_LOCATION[27]="/extra/lustre/" | ||
| EOF |