diff --git a/autoMakefile.am b/autoMakefile.am index 0054f72..b6f4a83 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -188,12 +188,28 @@ debs: undef.h if [ "$$lversion" != "$$cversion" ]; then \ echo -e "1i\nlustre ($$lversion-1) unstable; urgency=low\n\n * Automated changelog entry update\n\n -- Brian J. Murrell $$(date -R)\n\n.\nwq" | ed debian/changelog; \ fi; \ - rm -rf debs + rm -rf debs; \ + if test "x@ENABLE_SERVER@" = "xyes"; then \ + DEB_BUILD_PROFILES="server"; \ + else \ + DEB_BUILD_PROFILES="client"; \ + fi; \ + if test "x@ENABLE_LDISKFS@" = "xyes"; then \ + export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ldiskfs"; \ + fi; \ + if test "x@ENABLE_ZFS@" = "xyes"; then \ + export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} zfs"; \ + fi; \ + export KERNEL_CFG="$(LINUX_CONFIG)"; \ + export KERNEL_SRC="$(LINUX)"; \ + echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}"; \ + echo "Kernel Source: $${KERNEL_SRC}"; \ + echo "Kernel Config: $${KERNEL_CFG}"; \ dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp || { \ rc=$${PIPESTATUS[0]}; \ [ $${rc} -gt 1 ] && exit $${rc}; \ exit 0; \ - } + }; \ export KPKG_DEST_DIR="$$(pwd)/.." && \ version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \ rm -rf debian/tmp/modules-deb && \ @@ -224,9 +240,10 @@ debs: undef.h mkdir -p debs && \ mv ../linux-patch-lustre_$${VER}_all.deb ../lustre-dev_$${VER}_*.deb \ ../lustre-source_$${VER}_all.deb ../lustre-tests_$${VER}_*.deb \ - ../lustre-utils_$${VER}_*.deb ../lustre_$${VER}.dsc \ + ../lustre-*-utils_$${VER}_*.deb ../lustre_$${VER}.dsc \ ../lustre_$${VER}_*.changes ../lustre_$${VER}.tar.gz \ - ../lustre-client-modules-$${KVERS}_$${VER}_*.deb debs/ + ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \ + debs/ if USES_DPKG EXTRA_DIST += debian/* diff --git a/config/lustre-build-ldiskfs.m4 b/config/lustre-build-ldiskfs.m4 index ef86634..5710fd5 100644 --- a/config/lustre-build-ldiskfs.m4 +++ b/config/lustre-build-ldiskfs.m4 @@ -244,6 +244,7 @@ AS_IF([test x$enable_ldiskfs != xno],[ # set is available for the detected kernel. For now, we just always # set it to "yes". AS_IF([test x$enable_ldiskfs = xmaybe], [enable_ldiskfs=yes]) + AC_SUBST(ENABLE_LDISKFS, yes) LDISKFS_LINUX_SERIES LDISKFS_AC_PATCH_PROGRAM @@ -260,6 +261,8 @@ AS_IF([test x$enable_ldiskfs != xno],[ AC_DEFINE(CONFIG_LDISKFS_FS_ENCRYPTION, 1, [enable encryption for ldiskfs]) AC_SUBST(LDISKFS_SUBDIR, ldiskfs) AC_DEFINE(HAVE_LDISKFS_OSD, 1, Enable ldiskfs osd) +], [ + AC_SUBST(ENABLE_LDISKFS, no) ]) AC_MSG_CHECKING([whether to build ldiskfs]) diff --git a/config/lustre-build-zfs.m4 b/config/lustre-build-zfs.m4 index 49170d2..788ab2b 100644 --- a/config/lustre-build-zfs.m4 +++ b/config/lustre-build-zfs.m4 @@ -613,6 +613,11 @@ your distribution. [Have dmu_read_by_dnode() in ZFS]) ]) ]) - + + AS_IF([test "x$enable_zfs" = xyes], [ + AC_SUBST(ENABLE_ZFS, yes) + ], [ + AC_SUBST(ENABLE_ZFS, no) + ]) AM_CONDITIONAL(ZFS_ENABLED, [test "x$enable_zfs" = xyes]) ]) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 5be86b1..d52e589 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -440,8 +440,12 @@ AS_IF([test x$enable_ldiskfs = xno -a x$enable_zfs = xno], [ AC_MSG_CHECKING([whether to build Lustre server support]) AC_MSG_RESULT([$enable_server]) -AS_IF([test x$enable_server = xyes], - [AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server])]) +AS_IF([test x$enable_server = xyes], [ + AC_DEFINE(HAVE_SERVER_SUPPORT, 1, [support server]) + AC_SUBST(ENABLE_SERVER, yes) +], [ + AC_SUBST(ENABLE_SERVER, no) +]) ]) # LB_CONFIG_SERVERS # diff --git a/debian/control b/debian/control index 4a0799d..831880d 100644 --- a/debian/control +++ b/debian/control @@ -42,18 +42,37 @@ Description: source for Lustre filesystem client kernel modules can be built for kernels 2.6.32+ with the use of module-assistant or make-kpkg. -Package: lustre-utils +Package: lustre-client-utils Section: utils Architecture: i386 powerpc ppc64el amd64 ia64 Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Userspace utilities for the Lustre filesystem +Description: Userspace utilities for the Lustre filesystem (client) Lustre is a scalable, secure, robust, highly-available cluster file system. This release is maintained by Intel Corporation and available from https://wiki.hpdd.intel.com/ . This package provides a number of userspace utilities for - maintaining Lustre filesystems. + accessing Lustre filesystems from a client. If you need server utils, + use lustre-server-utils instead. + +Package: lustre-server-utils +Section: utils +Architecture: i386 powerpc ppc64el amd64 ia64 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Provides: lustre-server-utils, lustre-client-utils +Conflicts: lustre-client-utils +Replaces: lustre-client-utils +Description: Userspace utilities for the Lustre filesystem (server) + Lustre is a scalable, secure, robust, highly-available cluster file system. + This release is maintained by Intel Corporation and available from + https://wiki.hpdd.intel.com/ + . + This package provides a number of userspace utilities for + accessing and maintaining Lustre filesystems from a server. + If you only need to access the LFS cluster, install lustre-client-utils + instead. Package: lustre-tests Section: utils diff --git a/debian/control.main b/debian/control.main index 4a0799d..831880d 100644 --- a/debian/control.main +++ b/debian/control.main @@ -42,18 +42,37 @@ Description: source for Lustre filesystem client kernel modules can be built for kernels 2.6.32+ with the use of module-assistant or make-kpkg. -Package: lustre-utils +Package: lustre-client-utils Section: utils Architecture: i386 powerpc ppc64el amd64 ia64 Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Userspace utilities for the Lustre filesystem +Description: Userspace utilities for the Lustre filesystem (client) Lustre is a scalable, secure, robust, highly-available cluster file system. This release is maintained by Intel Corporation and available from https://wiki.hpdd.intel.com/ . This package provides a number of userspace utilities for - maintaining Lustre filesystems. + accessing Lustre filesystems from a client. If you need server utils, + use lustre-server-utils instead. + +Package: lustre-server-utils +Section: utils +Architecture: i386 powerpc ppc64el amd64 ia64 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends} +Provides: lustre-server-utils, lustre-client-utils +Conflicts: lustre-client-utils +Replaces: lustre-client-utils +Description: Userspace utilities for the Lustre filesystem (server) + Lustre is a scalable, secure, robust, highly-available cluster file system. + This release is maintained by Intel Corporation and available from + https://wiki.hpdd.intel.com/ + . + This package provides a number of userspace utilities for + accessing and maintaining Lustre filesystems from a server. + If you only need to access the LFS cluster, install lustre-client-utils + instead. Package: lustre-tests Section: utils diff --git a/debian/control.modules.in b/debian/control.modules.in index 84a7012..c403013 100644 --- a/debian/control.modules.in +++ b/debian/control.modules.in @@ -4,10 +4,11 @@ Priority: optional Maintainer: Brian J. Murrell Uploaders: Brian J. Murrell Standards-Version: 3.7.2 -Build-Depends: debhelper (>= 5.0.0), bzip2 +Build-Depends: debhelper (>= 7.0.0), bzip2 Package: lustre-client-modules-_KVERS_ Architecture: any +Build-Profiles: Recommends: linux-image, lustre-utils Provides: lustre-client-modules Description: Lustre Linux kernel module (kernel _KVERS_) @@ -16,5 +17,22 @@ Description: Lustre Linux kernel module (kernel _KVERS_) . These modules are compiled for the _KVERS_ linux kernel. - - +Package: lustre-server-modules-_KVERS_ +Architecture: any +Build-Profiles: +Recommends: linux-image, lustre-utils +Provides: lustre-server-modules, lustre-client-modules +Conflicts: lustre-client-modules +Replaces: lustre-client-modules +Description: Lustre Server Linux kernel module (kernel _KVERS_) + This package contains the loadable kernel modules for the + ldiskfs filesystem as used by the Lustre cluster filesystem servers. + . + Do note, that you will only need this, when you're running the + node as a Lustre server. The package might also contain the ldiskfs + module for use as a backing file system, in case it was enabled. + In that case, you should also run a lustre-patched Kernel + to achieve optimum performance. If you plan to run this with ZFS + enabled, no kernel patches are needed at all. + . + These modules are compiled for the _KVERS_ linux kernel. \ No newline at end of file diff --git a/debian/lustre-client-utils.docs b/debian/lustre-client-utils.docs new file mode 120000 index 0000000..e41e9de --- /dev/null +++ b/debian/lustre-client-utils.docs @@ -0,0 +1 @@ +lustre-utils.docs \ No newline at end of file diff --git a/debian/lustre-client-utils.examples b/debian/lustre-client-utils.examples new file mode 120000 index 0000000..4a4b3ff --- /dev/null +++ b/debian/lustre-client-utils.examples @@ -0,0 +1 @@ +lustre-utils.examples \ No newline at end of file diff --git a/debian/lustre-client-utils.install b/debian/lustre-client-utils.install new file mode 120000 index 0000000..472efe7 --- /dev/null +++ b/debian/lustre-client-utils.install @@ -0,0 +1 @@ +lustre-utils.install \ No newline at end of file diff --git a/debian/lustre-client-utils.manpages b/debian/lustre-client-utils.manpages new file mode 120000 index 0000000..7d460f6 --- /dev/null +++ b/debian/lustre-client-utils.manpages @@ -0,0 +1 @@ +lustre-utils.manpages \ No newline at end of file diff --git a/debian/lustre-server-modules.install b/debian/lustre-server-modules.install new file mode 100644 index 0000000..ce66ef7 --- /dev/null +++ b/debian/lustre-server-modules.install @@ -0,0 +1 @@ +debian/tmp/lib / diff --git a/debian/lustre-server-utils.docs b/debian/lustre-server-utils.docs new file mode 120000 index 0000000..e41e9de --- /dev/null +++ b/debian/lustre-server-utils.docs @@ -0,0 +1 @@ +lustre-utils.docs \ No newline at end of file diff --git a/debian/lustre-server-utils.examples b/debian/lustre-server-utils.examples new file mode 120000 index 0000000..4a4b3ff --- /dev/null +++ b/debian/lustre-server-utils.examples @@ -0,0 +1 @@ +lustre-utils.examples \ No newline at end of file diff --git a/debian/lustre-server-utils.install b/debian/lustre-server-utils.install new file mode 120000 index 0000000..472efe7 --- /dev/null +++ b/debian/lustre-server-utils.install @@ -0,0 +1 @@ +lustre-utils.install \ No newline at end of file diff --git a/debian/lustre-server-utils.manpages b/debian/lustre-server-utils.manpages new file mode 120000 index 0000000..7d460f6 --- /dev/null +++ b/debian/lustre-server-utils.manpages @@ -0,0 +1 @@ +lustre-utils.manpages \ No newline at end of file diff --git a/debian/rules b/debian/rules index 21fe689..4a2c87e 100755 --- a/debian/rules +++ b/debian/rules @@ -13,6 +13,7 @@ DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) 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 @@ -32,7 +33,11 @@ endif export DH_COMPAT=7 # Module-assistant stuff -PACKAGE=lustre-client-modules +ifneq (,$(findstring server,$(DEB_BUILD_PROFILES))) + PACKAGE=lustre-server-modules +else + PACKAGE=lustre-client-modules +endif MA_DIR ?= /usr/share/modass -include $(MA_DIR)/include/generic.make -include $(MA_DIR)/include/common-rules.make @@ -56,13 +61,22 @@ KSRC?=$(LINUX_OBJ) KSRC_TREE?=$(LINUX) IB_OPTIONS?="" -# Packages +# Packages provided for both client and server builds PATCH_PKG=linux-patch-lustre -UTILS_PKG=lustre-utils TESTS_PKG=lustre-tests DEV_PKG=lustre-dev SOURCE_PKG=lustre-source -MODS_PKG=lustre-client-modules +SOURCE_PKG=lustre-source + +# Packages that are only built for server OR client builds +# The difference is that server build contain more modules & utils +ifneq (,$(findstring server,$(DEB_BUILD_PROFILES))) + UTILS_PKG=lustre-server-utils + MODS_PKG=lustre-server-modules +else + UTILS_PKG=lustre-client-utils + MODS_PKG=lustre-client-modules +endif #Build dir #BUILDDIR=debian/build @@ -105,6 +119,10 @@ autogen-stamp: patch-stamp fi; \ touch $@ +# Normal targets are usually built without modules, except if the user also +# needs LDISKFS, in which case mkfs.lustre and the ldiskfs modules need to +# be built. No such special needs for ZFS, though. +# Note: KERNEL_SRC and KERNEL_CFG need to be set from the outside configure: configure-stamp configure-stamp: autogen-stamp debian/control.main debian/control.modules.in dh_testdir @@ -115,13 +133,30 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in cp build/Makefile $(BUILDDIR)/build/; \ cp lustre/contrib/mpich-*.patch $(BUILDDIR)/lustre/contrib/; \ fi + echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}" + if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \ + export EXTRAFLAGS="--enable-server"; \ + else \ + export EXTRAFLAGS="--disable-server"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "ldiskfs"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} \ + --with-linux=$${KERNEL_SRC} \ + --with-linux-config=$${KERNEL_CFG} \ + --enable-ldiskfs \ + --enable-quilt"; \ + else \ + export EXTRAFLAGS="$${EXTRAFLAGS} --disable-modules"; \ + fi; \ + echo "Final value of EXTRAFLAGS: $${EXTRAFLAGS}"; \ ( cd $(BUILDDIR) && \ - $(SRCDIR)/configure --disable-dependency-tracking \ - --disable-modules \ - --disable-snmp \ - --disable-client \ - --enable-quota \ - --disable-server ) + $(SRCDIR)/configure --disable-dependency-tracking \ + --with-linux=$${KERNEL_SRC} \ + --with-linux-config=$${KERNEL_CFG} \ + --disable-snmp \ + --enable-quota \ + $${EXTRAFLAGS} \ + ); \ touch $@ build-arch build-indep: build @@ -131,7 +166,7 @@ build-stamp: patch-stamp configure-stamp dh_testdir $(MAKE) -C $(BUILDDIR) $(PMAKEARGS) $(MAKE) -C $(BUILDDIR) DESTDIR=$(TOP_DIR)/debian/tmp install - # jump our lustre-client-modules into the control file if not using m-a + # jump our lustre-[client|server]-modules into the control file if not using m-a if ! $(USE_MA); then \ (cat debian/control.main; sed -e '1,/^$$/d' -e "s/_KVERS_/$(KVER)/g" < debian/control.modules.in) > debian/control; \ for file in debian/*_KVERS_*; do \ @@ -272,6 +307,7 @@ binary-$(SOURCE_PKG): build-stamp # if only we could use m-a for this, but this stupid "compliant.list" # thing fouls that up binary-kern-mods: + # Build client or server modules mkdir -p debian/m-a_root/usr_src/modules ln -s ../../../../ debian/m-a_root/usr_src/modules/lustre m-a -t -u debian/m-a_root/ -d -v -k $(KSRC) build lustre @@ -280,7 +316,7 @@ binary-kern-mods: # an alternative (to module-assistant) method of building the kernel modules binary-$(MODS_PKG): build-stamp if ! $(USE_MA); then \ - cp debian/lustre-client-modules.install debian/lustre-client-modules-$(KVER).install ; \ + cp debian/$(MODS_PKG).install debian/$(MODS_PKG)-$(KVER).install ; \ dh_testdir; \ dh_testroot; \ dh_installdirs -p $(MODS_PKG)-$(KVER); \ @@ -297,6 +333,7 @@ binary-$(MODS_PKG): build-stamp dh_builddeb -p $(MODS_PKG)-$(KVER); \ fi + ### ### For module-assistant ### @@ -334,20 +371,44 @@ kdist_config: prep-deb-files patch-stamp #-$(MAKE) -C $(KSRC) prepare scripts # touch files to same date, to avoid auto* find . -type f -print0 | xargs -0 touch -r COPYING \; + # Determine flags that are different between server/client module builds + echo "Enabled Build Profiles: $${DEB_BUILD_PROFILES}" # Doesn't seem possible to only build modules... + export MOD_CONF_FLAGS=""; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \ + export MOD_CONF_FLAGS="$${MOD_CONF_FLAGS} --enable-server" ; \ + else \ + export MOD_CONF_FLAGS="$${MOD_CONF_FLAGS} --disable-server" ; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "ldiskfs"; then \ + export MOD_CONF_FLAGS="$${MOD_CONF_FLAGS} \ + --enable-ldiskfs --enable-quilt \ + --enable-utils \ + " ; \ + else \ + export MOD_CONF_FLAGS="$${MOD_CONF_FLAGS} \ + --disable-ldiskfs --disable-quilt \ + --disable-utils \ + " ; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "zfs"; then \ + export MOD_CONF_FLAGS="$${MOD_CONF_FLAGS} --enable-zfs" ; \ + else \ + export MOD_CONF_FLAGS="$${MOD_CONF_FLAGS} --disable-zfs" ; \ + fi; \ + echo "Final value of MOD_CONF_FLAGS: $${MOD_CONF_FLAGS}"; \ ./configure --with-linux=$(KSRC_TREE) \ - --with-linux-obj=$(KSRC) \ - --disable-server \ - --disable-quilt \ - --disable-dependency-tracking \ - --disable-doc \ - --disable-utils \ - --disable-iokit \ - --disable-snmp \ - --disable-tests \ - --enable-quota \ - --with-kmp-moddir=updates \ - $(IB_OPTIONS) + --with-linux-obj=$(KSRC) \ + --disable-dependency-tracking \ + --disable-doc \ + --disable-iokit \ + --disable-snmp \ + --disable-tests \ + --enable-quota \ + --with-kmp-moddir=updates \ + $${MOD_CONF_FLAGS} \ + $(IB_OPTIONS) + kdist_configure: kdist_config @@ -378,7 +439,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-*-modules-* | grep -v _KVERS_ | 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; \