# whether to use module-assistant to build the kernel modules or not
USE_MA = true
+# Whether to build the DKMS packages
+BUILD_DKMS ?= false
+
+ifeq ($(BUILD_DKMS),true)
+ DKMS_TARGET = binary-$(DKMS_PKG)
+else
+ DKMS_TARGET =
+endif
+
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
# This is the Lustre version
VERSION=$(shell sed -n -e '1s/.*(\(.*\)) .*/\1/p' debian/changelog)
-UPVERSION=$(shell echo $VERSION | sed -e 's/-[^-]*$$//')
+UPVERSION=$(shell echo $(VERSION) | sed -e 's/-[^-]*$$//')
# KVER is set to LINUXRELEASE being by autoconf which is either
# $(uname -r) or the version of the source specified by the user
KVERS?=$(KVER)
KSRC?=$(LINUX_OBJ)
KSRC_TREE?=$(LINUX)
-IB_OPTIONS?=""
+EXTRA_OPTIONS?=$(IB_OPTIONS)
# Packages provided for both client and server builds
IOKIT_PKG=lustre-iokit
ifneq (,$(findstring server,$(DEB_BUILD_PROFILES)))
UTILS_PKG=lustre-server-utils
MODS_PKG=lustre-server-modules
+ RESOURCE_PKG=lustre-resource-agents
+ RESOURCE_TARGET=binary-$(RESOURCE_PKG)
+ DKMS_PKG=
else
UTILS_PKG=lustre-client-utils
MODS_PKG=lustre-client-modules
+ RESOURCE_TARGET=
+ RESOURCE_PKG=
+ DKMS_PKG=lustre-client-modules-dkms
endif
#Build dir
# binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) \
# binary-$(MODS_PKG) binary-kern-mods
binary-arch: binary-$(UTILS_PKG) binary-$(DEV_PKG) \
- binary-$(IOKIT_PKG) binary-$(TESTS_PKG)
+ binary-$(IOKIT_PKG) binary-$(TESTS_PKG) \
+ $(RESOURCE_TARGET)
-binary-indep: binary-$(SOURCE_PKG)
+binary-indep: binary-$(SOURCE_PKG) $(DKMS_TARGET)
binary: binary-indep binary-arch
dh_md5sums -p $(UTILS_PKG)
dh_builddeb -p $(UTILS_PKG)
+binary-$(RESOURCE_PKG): build-stamp
+ dh_testdir
+ dh_testroot
+ dh_installdirs -p $(RESOURCE_PKG)
+ dh_installdocs -p $(RESOURCE_PKG)
+ dh_installman -p $(RESOURCE_PKG)
+ dh_install -p $(RESOURCE_PKG)
+ dh_makeshlibs -p $(RESOURCE_PKG)
+ dh_installexamples -p $(RESOURCE_PKG)
+ dh_installchangelogs -p $(RESOURCE_PKG) lustre/ChangeLog
+ dh_compress -p $(RESOURCE_PKG)
+ dh_strip -p $(RESOURCE_PKG)
+ dh_installdeb -p $(RESOURCE_PKG)
+ dh_fixperms -p $(RESOURCE_PKG)
+ dh_gencontrol -p $(RESOURCE_PKG)
+ dh_md5sums -p $(RESOURCE_PKG)
+ dh_builddeb -p $(RESOURCE_PKG)
+
binary-$(IOKIT_PKG): build-stamp
dh_testdir
dh_testroot
dh_md5sums -p $(SOURCE_PKG)
dh_builddeb -p $(SOURCE_PKG)
+binary-$(DKMS_PKG): build-stamp
+ dh_testdir
+ dh_testroot
+ # Create /usr/src/lustre-client-modules-<version>
+ dh_installdirs -p $(DKMS_PKG) usr/src/lustre-client-modules-$(UPVERSION)
+ # Copy the source
+ 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 configuration file in place
+ sed -e 's/[@]UPVERSION[@]/$(UPVERSION)/' debian/dkms.conf.in > debian/$(DKMS_PKG)/usr/src/lustre-client-modules-$(UPVERSION)/dkms.conf
+ dh_install -p $(DKMS_PKG)
+ dh_installchangelogs -p $(DKMS_PKG) lustre/ChangeLog
+ dh_installdocs -p $(DKMS_PKG)
+ 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:
--enable-quota \
--with-kmp-moddir=updates \
$${EXTRAFLAGS} \
- $(IB_OPTIONS)
+ $(EXTRA_OPTIONS)
kdist_configure: kdist_config
$(MAKE) $(PMAKEARGS)
$(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
# Remove stuff that doesn't belong (no module-only target)
- cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr/bin usr/sbin usr/lib usr/share usr/include/lustre sbin etc
+ cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr/bin usr/sbin usr/lib usr/share usr/include/lustre lib/systemd sbin etc
dh_installdocs -p$(PKGNAME)
dh_installchangelogs -p$(PKGNAME)
dh_installmodules -p $(PKGNAME)
dpatch deapply-all -v
-$(MAKE) distclean
rm -rf debian/substvars debian/*.bak debian/*~ *~ *-stamp
- ls -d debian/lustre-*-modules-* | grep -v _KVERS_ | xargs rm -f || true
+ ls -d debian/lustre-*-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; \