diff --git a/debian/README.Debian b/debian/README.Debian index c464a20..9664496 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -69,6 +69,24 @@ Be aware that this doesn't replace the Documentation and Installation Howtos fro +5. (Optional). Building client modules with dkms + + Lustre client-only kernel modules can built against non-patched, vanilla kernels. This may be + more convenient than installing the patched kernel and server modules. + + Installing the lustre-client-modules-dkms package will automatically build modules for all + currently installed kernels using dkms (http://linux.dell.com/dkms/). (You will need to have + the relevent linux-headers packages installed.) When a new kernel is installed on the machine, + dkms will automatically build a new set of lustre client modules. + + You can also use dkms to create a new deb containing the pre-build kernel modules, suitable for + installing on other machines which may not have a full build environment. + + - dkms build -m lustre-client-modules -v -k + (repeat the above step for all required kernel versions) + - dkms mkdeb -m lustre-client-modules -v --all + - dkms mkdsc -m lustre-client-modules -v --all + ########### Please have also a look into the official documentation for lustre available at: diff --git a/debian/control b/debian/control index 43b04c7..4e4e1f0 100644 --- a/debian/control +++ b/debian/control @@ -42,6 +42,20 @@ Description: source for Lustre filesystem client kernel modules can be built for kernels from 2.6.18 - 2.6.26 from it using module-assistant or make-kpkg. +Package: lustre-client-modules-dkms +Section: admin +Architecture: all +Priority: optional +Depends: dkms, debhelper (>= 5.0.0), automake (>=1.7), libsnmp-dev, dpatch +Description: dkms package for the client kernel modules + Lustre is a scalable, secure, robust, highly-available cluster file system. + This release is maintained by Whamcloud, Inc. and available from + http://wiki.whamcloud.com/ + . + This package contains the kernel client module source. The client kernel + modules can be built for kernels from 2.6.18 - 2.6.32 using dkms. + + Package: lustre-utils Section: utils Architecture: i386 powerpc amd64 ia64 diff --git a/debian/control.main b/debian/control.main index 43b04c7..4e4e1f0 100644 --- a/debian/control.main +++ b/debian/control.main @@ -42,6 +42,20 @@ Description: source for Lustre filesystem client kernel modules can be built for kernels from 2.6.18 - 2.6.26 from it using module-assistant or make-kpkg. +Package: lustre-client-modules-dkms +Section: admin +Architecture: all +Priority: optional +Depends: dkms, debhelper (>= 5.0.0), automake (>=1.7), libsnmp-dev, dpatch +Description: dkms package for the client kernel modules + Lustre is a scalable, secure, robust, highly-available cluster file system. + This release is maintained by Whamcloud, Inc. and available from + http://wiki.whamcloud.com/ + . + This package contains the kernel client module source. The client kernel + modules can be built for kernels from 2.6.18 - 2.6.32 using dkms. + + Package: lustre-utils Section: utils Architecture: i386 powerpc amd64 ia64 diff --git a/debian/dkms.conf.in b/debian/dkms.conf.in new file mode 100644 index 0000000..1437623 --- /dev/null +++ b/debian/dkms.conf.in @@ -0,0 +1,75 @@ +# lustre kernel module dkms files +# Created by Guy Coates +# Copyright 2012 Genome Research Ltd. + +MAKE="sh autogen.sh ; ./configure --disable-server --disable-utils --with-linux=$kernel_source_dir ; make" +CLEAN="make distclean || true" + +AUTOINSTALL=yes +PACKAGE_NAME=lustre-client-modules +PACKAGE_VERSION=@UPVERSION@ + +#Restrict builds to the patchess client support matrix. +BUILD_EXCLUSIVE_KERNEL="^2.6.(1[8-9]|2[0-9]|3[0-2])" +STRIP="no" + +# Module names +BUILT_MODULE_NAME[0]="lquota" +BUILT_MODULE_NAME[1]="lvfs" +BUILT_MODULE_NAME[2]="quotafmt_test" +BUILT_MODULE_NAME[3]="lustre" +BUILT_MODULE_NAME[4]="llite_lloop" +BUILT_MODULE_NAME[5]="mdc" +BUILT_MODULE_NAME[6]="ptlrpc" +BUILT_MODULE_NAME[7]="mgc" +BUILT_MODULE_NAME[8]="obdecho" +BUILT_MODULE_NAME[9]="osc" +BUILT_MODULE_NAME[10]="lov" +BUILT_MODULE_NAME[11]="llog_test" +BUILT_MODULE_NAME[12]="obdclass" +BUILT_MODULE_NAME[13]="libcfs" +BUILT_MODULE_NAME[14]="ksocklnd" +BUILT_MODULE_NAME[15]="ko2iblnd" +BUILT_MODULE_NAME[16]="lnet" +BUILT_MODULE_NAME[17]="lnet_selftest" + +# Location of the modules in the source tree after build +BUILT_MODULE_LOCATION[0]="lustre/quota" +BUILT_MODULE_LOCATION[1]="lustre/lvfs" +BUILT_MODULE_LOCATION[2]="lustre/lvfs" +BUILT_MODULE_LOCATION[3]="lustre/llite" +BUILT_MODULE_LOCATION[4]="lustre/llite" +BUILT_MODULE_LOCATION[5]="lustre/mdc" +BUILT_MODULE_LOCATION[6]="lustre/ptlrpc" +BUILT_MODULE_LOCATION[7]="lustre/mgc" +BUILT_MODULE_LOCATION[8]="lustre/obdecho" +BUILT_MODULE_LOCATION[9]="lustre/osc" +BUILT_MODULE_LOCATION[10]="lustre/lov" +BUILT_MODULE_LOCATION[11]="lustre/obdclass" +BUILT_MODULE_LOCATION[12]="lustre/obdclass" +BUILT_MODULE_LOCATION[13]="lnet/libcfs" +BUILT_MODULE_LOCATION[14]="lnet/klnds/socklnd" +BUILT_MODULE_LOCATION[15]="lnet/klnds/o2iblnd" +BUILT_MODULE_LOCATION[16]="lnet/lnet" +BUILT_MODULE_LOCATION[17]="lnet/selftest" + +# Final destination of the modules under /lib/modules// +DEST_MODULE_LOCATION[0]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[1]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[2]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[3]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[4]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[5]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[6]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[7]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[8]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[9]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[10]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[11]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[12]="/updates/kernel/fs/lustre" +DEST_MODULE_LOCATION[13]="/updates/kernel/net/lustre" +DEST_MODULE_LOCATION[14]="/updates/kernel/net/lustre" +DEST_MODULE_LOCATION[15]="/updates/kernel/net/lustre" +DEST_MODULE_LOCATION[16]="/updates/kernel/net/lustre" +DEST_MODULE_LOCATION[17]="/updates/kernel/net/lustre" + diff --git a/debian/lustre-client-modules-dkms.postinst b/debian/lustre-client-modules-dkms.postinst new file mode 100755 index 0000000..e15ab1a --- /dev/null +++ b/debian/lustre-client-modules-dkms.postinst @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +# Get the package version, which is the version of batman-adv-dkms +package=lustre-client-modules +version=`dpkg-query -W -f='${Version}' "$package-dkms" \ + | sed -e 's/[+-].*//'` + +dkms add -m "$package" -v "$version" +dkms build -m "$package" -v "$version" && dkms install -m "$package" -v "$version" || true diff --git a/debian/lustre-client-modules-dkms.prerm b/debian/lustre-client-modules-dkms.prerm new file mode 100755 index 0000000..ce4f464 --- /dev/null +++ b/debian/lustre-client-modules-dkms.prerm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +# Get the package version, which is the version of batman-adv-dkms +package=lustre-client-modules +version=`dpkg-query -W -f='${Version}' "$package-dkms" \ + | sed -e 's/[+-].*//'` + +dkms remove -m "$package" -v "$version" --all || true + diff --git a/debian/rules b/debian/rules index 5e59622..eb6eb8b 100755 --- a/debian/rules +++ b/debian/rules @@ -44,7 +44,7 @@ TOP_DIR:=$(shell pwd) VERSION=$(shell sed -n -e '1s/.*(\(.*\)) .*/\1/p' debian/changelog) #SUPPORTED_KERNELS=2.6.27 SUPPORTED_KERNELS=2.6.18 2.6.20 2.6.22 -UPVERSION=$(shell echo $VERSION | sed -e 's/-[^-]*$$//') +UPVERSION=$(shell echo $(VERSION) | cut -d- -f1) #KERNEL_VERSION=2.6.27 # the kernel version to build all of this with #KVER=2.6.27-11-generic @@ -66,7 +66,7 @@ DEV_PKG=lustre-dev LIB_PKG=liblustre SOURCE_PKG=lustre-source MODS_PKG=lustre-client-modules - +DKMS_PKG=lustre-client-modules-dkms #Build dir #BUILDDIR=debian/build #SRCDIR=../.. @@ -153,7 +153,7 @@ build-stamp: patch-stamp configure-stamp # binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) binary-$(LIB_PKG) binary-$(MODS_PKG) binary-kern-mods binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) binary-$(LIB_PKG) -binary-indep: binary-$(PATCH_PKG) binary-$(SOURCE_PKG) +binary-indep: binary-$(PATCH_PKG) binary-$(SOURCE_PKG) binary-$(DKMS_PKG) binary: binary-indep binary-arch @@ -293,6 +293,36 @@ binary-$(SOURCE_PKG): build-stamp dh_md5sums -p $(SOURCE_PKG) dh_builddeb -p $(SOURCE_PKG) +binary-$(DKMS_PKG): build-stamp + dh_testdir + dh_testroot + # create the /usr/src/lustre-client-modules-version + dh_installdirs -p $(DKMS_PKG) usr/src/lustre-client-modules-$(UPVERSION) + # copy the src + rsync -av --exclude='debian/$(DKMS_PKG)/*' --exclude='.git/' \ + --link-dest=$(PWD) \ + . debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION) + #clean it up + $(MAKE) -C debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION) -f debian/rules clean + + # put the dkms conf file in place... + sed -e 's/[@]UPVERSION[@]/$(UPVERSION)/' debian/dkms.conf.in > debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION)/dkms.conf + # Stop the build system complaining about the lack of meta files + touch debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION)/META + dh_installdocs -p $(DKMS_PKG) + dh_install -p $(DKMS_PKG) + dh_installdebconf -p $(DKMS_PKG) + dh_installchangelogs -p $(DKMS_PKG) lustre/ChangeLog + dh_compress -p $(DKMS_PKG) + dh_installdeb -p $(DKMS_PKG) + dh_strip -p $(DKMS_PKG) + dh_fixperms -p $(DKMS_PKG) + dh_gencontrol -p $(DKMS_PKG) + dh_md5sums -p $(DKMS_PKG) + dh_builddeb -p $(DKMS_PKG) + + + # if only we could use m-a for this, but this stupid "compliant.list" # thing fouls that up binary-kern-mods: @@ -401,7 +431,7 @@ clean: dpatch deapply-all -v -$(MAKE) distclean rm -rf debian/substvars debian/*.bak debian/*~ *~ *-stamp debian/$(PATCH_PKG) - ls -d debian/lustre-client-modules-* | grep -v _KVERS_ | xargs rm -f || true + ls -d debian/lustre-client-modules-* | grep -v _KVERS_ | grep -v dkms | xargs rm -f || true # only remove this if the clean was not called from kdist_clean if [ "$$MA_SOURCE_PKG" = "" ]; then \ rm -rf debian/m-a_root; \