X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=debian%2Frules;h=262ea47c2fab20e7832b7ef3b1969f29cd016556;hb=26f26e726753d81c7aeb1d1391d903ed9786c235;hp=237904aedbabb03c2d1798ec71f024fc96f9b52c;hpb=8f221cf65b644d798493da489674abd2e2b7f23f;p=fs%2Flustre-release.git diff --git a/debian/rules b/debian/rules index 237904a..262ea47 100755 --- a/debian/rules +++ b/debian/rules @@ -17,6 +17,15 @@ DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) # 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 @@ -47,19 +56,19 @@ TOP_DIR:=$(shell pwd) # 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 KVER?=$(LINUXRELEASE) # KVERS, KSRC are the kernel version and source to use when building lustre -# Will be the default when building lustre-utils, etc but whatever module-assistant +# Will be the default when building lustre-{server,client}-utils, etc but whatever module-assistant # supplied when building modules 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 @@ -72,9 +81,15 @@ SOURCE_PKG=lustre-source 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 @@ -127,7 +142,7 @@ autogen-stamp: patch-stamp # modules, whereas the modules build omits the utilities, to create two # neatly separated debian files. # -# Note: KERNEL_SRC, KERNEL_CFG, ZFS_SRC and SPL_SRC need to be set from the +# Note: KERNEL_SRC, KERNEL_OBJ, ZFS_SRC and SPL_SRC need to be set from the # outside. This is done by "make debs". As such, invoking "debuild" or such # direct debian build tools will lead to a client-only build. configure: configure-stamp @@ -143,8 +158,22 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}" if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \ export EXTRAFLAGS="--enable-server"; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \ + cp debian/lustre-server-utils.install.in \ + debian/lustre-server-utils.install; \ + else \ + sed /systemd/d debian/lustre-server-utils.install.in \ + > debian/lustre-server-utils.install; \ + fi; \ else \ - export EXTRAFLAGS="--disable-server --disable-modules"; \ + export EXTRAFLAGS="--disable-server"; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \ + cp debian/lustre-client-utils.install.in \ + debian/lustre-client-utils.install; \ + else \ + sed /systemd/d debian/lustre-client-utils.install.in \ + > debian/lustre-client-utils.install; \ + fi; \ fi; \ if echo "$${DEB_BUILD_PROFILES}" | grep -q "zfs"; then \ export EXTRAFLAGS="$${EXTRAFLAGS} --with-zfs=$${ZFS_SRC} --with-spl=$${SPL_SRC}"; \ @@ -157,14 +186,28 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in else \ export EXTRAFLAGS="$${EXTRAFLAGS} --disable-ldiskfs"; \ fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "o2ib"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -qw "gss"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gss"; \ + elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nogss"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --disable-gss"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -qw "crypto"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --enable-crypto"; \ + elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nocrypto"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --disable-crypto"; \ + fi; \ echo "Final value of EXTRAFLAGS: $${EXTRAFLAGS}"; \ ( cd $(BUILDDIR) && \ $(SRCDIR)/configure --disable-dependency-tracking \ --with-linux=$${KERNEL_SRC} \ - --with-linux-config=$${KERNEL_CFG} \ + --with-linux-obj=$${KERNEL_OBJ} \ --disable-snmp \ --enable-quota \ $${EXTRAFLAGS} \ + $(EXTRA_OPTIONS) \ ); \ touch $@ @@ -191,9 +234,10 @@ build-stamp: patch-stamp configure-stamp # 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 @@ -208,6 +252,7 @@ binary-$(UTILS_PKG): build-stamp debian/$(UTILS_PKG)/usr/bin/*-survey \ debian/$(UTILS_PKG)/usr/bin/mcreate \ debian/$(UTILS_PKG)/usr/bin/munlink \ + debian/$(UTILS_PKG)/usr/bin/statx \ debian/$(UTILS_PKG)/usr/sbin/wirecheck \ debian/$(UTILS_PKG)/usr/sbin/wiretest dh_makeshlibs -p $(UTILS_PKG) @@ -221,6 +266,24 @@ binary-$(UTILS_PKG): build-stamp 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 @@ -303,6 +366,31 @@ 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 /usr/src/lustre-client-modules- + 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: @@ -390,6 +478,14 @@ kdist_config: prep-deb-files patch-stamp export EXTRAFLAGS="$${EXTRAFLAGS} \ --disable-ldiskfs --disable-quilt"; \ fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "o2ib"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -qw "crypto"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --enable-crypto"; \ + elif echo "$${DEB_BUILD_PROFILES}" | grep -qw "nocrypto"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --disable-crypto"; \ + fi; \ echo "Final value of EXTRAFLAGS: $${EXTRAFLAGS}"; \ ./configure --with-linux=$(KSRC_TREE) \ --with-linux-obj=$(KSRC) \ @@ -399,9 +495,9 @@ kdist_config: prep-deb-files patch-stamp --disable-snmp \ --disable-tests \ --enable-quota \ - --with-kmp-moddir=updates \ + --with-kmp-moddir=updates/kernel \ $${EXTRAFLAGS} \ - $(IB_OPTIONS) + $(EXTRA_OPTIONS) kdist_configure: kdist_config @@ -433,7 +529,7 @@ clean: 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; \