From 95287378fabf0ce77d7e9e49d37ef31bf8ad2686 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Sat, 27 Jan 2024 00:57:35 +0700 Subject: [PATCH] LU-16967 build: Separate lnet LND deb packaging Enable separate packaging of lnet lnd kernel modules into separate packages with build profile multiple-lnds: lustre-lnet-module-socklnd for socklnd.ko lustre-lnet-module-gnilnd for kgnilnd.ko, profile gnilnd lustre-lnet-module-kfilnd for kkfilnd.ko, profile kfilnd lustre-lnet-module-o2iblnd for o2iblnd.ko, profile ext_o2ib lustre-lnet-module-in-kernel-o2iblnd for ko2iblnd.ko, profile int_o2ib Test-Parameters: trivial HPE-bug-id: LUS-11711 Signed-off-by: Shaun Tancheff Change-Id: I3a5ca03fa410238f66083289db0899c8b4bfab5c Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52397 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexey Lyashkov Reviewed-by: Petros Koutoupis Reviewed-by: Frank Sehr Reviewed-by: Oleg Drokin --- .gitignore | 2 + autoMakefile.am | 36 +++++--- debian/control | 121 --------------------------- debian/control-lnet-gnilnd.in | 11 +++ debian/control-lnet-in-kernel-o2iblnd.in | 13 +++ debian/control-lnet-kfilnd.in | 11 +++ debian/control-lnet-o2iblnd.in | 13 +++ debian/control-lnet-socklnd.in | 11 +++ debian/control.main | 8 +- debian/repackage-multiple-lnds.sh | 100 ++++++++++++++++++++++ debian/rules | 30 ++++++- lnet/klnds/in-kernel-o2iblnd/autoMakefile.am | 19 ++++- 12 files changed, 234 insertions(+), 141 deletions(-) delete mode 100644 debian/control create mode 100644 debian/control-lnet-gnilnd.in create mode 100644 debian/control-lnet-in-kernel-o2iblnd.in create mode 100644 debian/control-lnet-kfilnd.in create mode 100644 debian/control-lnet-o2iblnd.in create mode 100644 debian/control-lnet-socklnd.in create mode 100755 debian/repackage-multiple-lnds.sh diff --git a/.gitignore b/.gitignore index 5423df6..f9b5b91 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,5 @@ doxygen.* /lnet/klnds/in-kernel-o2iblnd/o2iblnd*.c /lnet/klnds/in-kernel-o2iblnd/o2iblnd*.h /lnet/klnds/o2iblnd/Module.symvers +/debian/changelog +/debian/control diff --git a/autoMakefile.am b/autoMakefile.am index 557e00c..064ec0a0 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -327,9 +327,21 @@ debs: undef.h debs_common echo "SPL: $${SPL_SRC}"; \ echo "ZFS: $${ZFS_SRC}"; \ fi; \ - if test "x@ENABLEO2IB@" != "xno"; then \ - export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} o2ib"; \ - export O2IB_SRC="@O2IBPATH@"; \ + if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \ + export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} multiple-lnds"; \ + fi; \ + if test "x@ENABLE_GNI@" = "xyes"; then \ + export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gnilnd"; \ + fi; \ + if test "x@KFILND@" = "xkfilnd"; then \ + export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} kfilnd"; \ + fi; \ + if test "x@DPKG_EXT_O2IB@" != "x"; then \ + export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} ext_o2ib"; \ + export O2IB_SRC="@EXT_O2IBPATH@"; \ + fi ; \ + if test "x@DPKG_INT_O2IB@" != "x"; then \ + export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} int_o2ib"; \ fi; \ if test "x@CONFIG_CACHE_FILE@" != "x"; then \ export CONFIG_CACHE_FILE="@CONFIG_CACHE_FILE@"; \ @@ -337,7 +349,6 @@ debs: undef.h debs_common if test "x@ENABLE_GSS@" = "xyes"; then \ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gss"; \ debiantmp=$$(mktemp -t -d debbuild-$$USER-XXXXXXXX) ; \ - cp debian/control $$debiantmp/control.bkp ; \ cp debian/control.main $$debiantmp/control.main.bkp ; \ cp debian/control.modules.in $$debiantmp/control.modules.in.bkp ; \ sed -i "s+^\(Build-Depends: .*\)$$+\1, libkrb5-dev, libssl-dev+" debian/control.main ; \ @@ -434,11 +445,6 @@ debs: undef.h debs_common elif test "x@ENABLE_BACKOFF@" = "xno"; then \ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nobackoff"; \ fi; \ - if test "x@ENABLE_GNI@" = "xyes"; then \ - export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} gni"; \ - elif test "x@ENABLE_GNI@" = "xno"; then \ - export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} nogni"; \ - fi; \ if test "x@ENABLE_EFENCE@" = "xyes"; then \ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} efence"; \ elif test "x@ENABLE_EFENCE@" = "xno"; then \ @@ -459,20 +465,20 @@ debs: undef.h debs_common export IB_OPTIONS="--with-o2ib=yes"; \ fi; \ fi; \ + cp -v debian/control.main debian/control ; \ sed "s/_KVERS_/$(LINUXRELEASE)/g" debian/lustre-tests.install.in \ > debian/lustre-tests.install; \ tmpprofiles=`tr ' ' ',' <<< $$DEB_BUILD_PROFILES`; \ dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \ rc=$${PIPESTATUS[0]}; \ - cp $$debiantmp/control.bkp debian/control || true && \ cp $$debiantmp/control.main.bkp debian/control.main || true && \ cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \ [ $${rc} -gt 1 ] && exit $${rc}; \ exit 0; \ }; \ - cp $$debiantmp/control.bkp debian/control || true && \ cp $$debiantmp/control.main.bkp debian/control.main || true && \ cp $$debiantmp/control.modules.in.bkp debian/control.modules.in || true && \ + cp -v debian/control.main debian/control || true ; \ export KPKG_DEST_DIR="$$(pwd)/.." && \ version=$$(sed -ne '1s/^lustre (\(.*\)).*$$/\1/p' debian/changelog) && \ rm -rf debian/tmp/modules-deb && \ @@ -497,10 +503,15 @@ debs: undef.h debs_common if test "x@ENABLE_SERVER@" = "xyes"; then \ DEB_SERVER_PKG="../lustre-resource-agents_$${VER}_*.deb"; \ fi; \ + MULTILNDPKGS= ; \ + if test "x@ENABLE_MULTIPLE_LNDS@" != "xno"; then \ + debian/repackage-multiple-lnds.sh $${KVERS} $${VER} ../lustre-*-modules-$${KVERS}_$${VER}_*.deb ; \ + MULTILNDPKGS="../lustre-lnet-module-*-$${KVERS}_$${VER}_*.deb"; \ + fi; \ mkdir -p debs && \ mv ../lustre-dev_$${VER}_*.deb ../lustre-source_$${VER}_all.deb \ ../lustre-iokit_$${VER}_*.deb ../lustre-tests_$${VER}_*.deb \ - ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} \ + ../lustre-*-utils_$${VER}_*.deb $${DEB_SERVER_PKG} $${MULTILNDPKGS} \ ../lustre_$${VER}.dsc ../lustre_$${VER}_*.changes \ ../lustre_$${VER}.tar.gz ../lustre-*-modules-$${KVERS}_$${VER}_*.deb \ ../lustre-*-dbgsym_$${VER}_*.ddeb ../lustre_$${VER}_*.buildinfo \ @@ -523,6 +534,7 @@ dkms-debs: undef.h debs_common echo "Kernel Source: $${KERNEL_SRC}"; \ echo "Kernel Object: $${KERNEL_OBJ}"; \ export BUILD_DKMS="true" && \ + cp -v debian/control.main debian/control ; \ dpkg-buildpackage -us -uc -I.git -I\*.out[0-9]\* -I\*.swp -P$$tmpprofiles || { \ rc=$${PIPESTATUS[0]}; \ [ $${rc} -gt 1 ] && exit $${rc}; \ diff --git a/debian/control b/debian/control deleted file mode 100644 index 7d0ba65..0000000 --- a/debian/control +++ /dev/null @@ -1,121 +0,0 @@ -Source: lustre -Section: admin -Priority: optional -Maintainer: Lustre Developers -Uploaders: Lustre Developers -Standards-Version: 3.8.3 -Build-Depends: module-assistant, libreadline-dev, debhelper (>= 11), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libnl-genl-3-dev, libselinux-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers-amd64 | linux-headers-arm64, rsync, libssl-dev, libpython3-dev, swig, libmount-dev, ed -Homepage: https://wiki.whamcloud.com/ -Vcs-Git: git://git.whamcloud.com/fs/lustre-release.git - -Package: lustre-source -Section: admin -Architecture: all -Priority: optional -Depends: module-assistant, bzip2, debhelper (>= 11), libtool, libyaml-dev, libnl-genl-3-dev, libselinux-dev, mpi-default-dev, dpatch, pkg-config -Description: source for Lustre filesystem client kernel modules - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from - https://wiki.whamcloud.com/ - . - This package contains the module source. The client kernel modules - can be built for kernels 3.10+ with the use of module-assistant - or make-kpkg. - -Package: lustre-client-utils -Section: utils -Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 -Priority: optional -Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, zlib1g, libnl-genl-3-200, libmount1, libkeyutils1 -Recommends: perl -Suggests: bash-completion -Description: Userspace utilities for the Lustre filesystem (client) - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from - https://wiki.whamcloud.com/ - . - This package provides a number of userspace utilities for accessing a - remote Lustre filesystems from a client. If you need to serve local - storage from this node to other clients, use lustre-server-utils instead. - -Package: lustre-server-utils -Section: utils -Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 -Priority: optional -Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-0-2, libselinux1, zlib1g, libnl-genl-3-200, libmount1, libkeyutils1 -Recommends: perl, python3 -Suggests: bash-completion -Provides: lustre-server-utils, lustre-client-utils (= ${binary:Version}) -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 Whamcloud and available from - https://wiki.whamcloud.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 filesystem hosted on remote - servers, the lustre-client-utils package may be used instead. - -Package: lustre-resource-agents -Section: ha -Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 -Priority: optional -Depends: lustre-server-utils (= ${binary:Version}), resource-agents -Description: HA Resuable Cluster Resource Scripts for Lustre - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from - https://wiki.whamcloud.com/ - . - This package provides a set of scripts to operate Lustre - resources in a High Availablity environment for both Pacemaker - and rgmanager on a server. - -Package: lustre-iokit -Section: utils -Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 -Priority: optional -Depends: lustre-client-utils (= ${binary:Version}), perl, sg3-utils -Description: Collection of benchmark tools for the Lustre filesystem - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from - https://wiki.whamcloud.com/ - . - This package provides a collection of benchmark tools for Lustre clients. - -Package: lustre-tests -Section: utils -Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 -Priority: optional -Depends: lustre-iokit (= ${binary:Version}), lustre-dev (= ${binary:Version}), attr, rsync, quota, perl, lsof, mpi-default-bin, uidmap, selinux-utils, python3 -Description: Test suite for the Lustre filesystem - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from - https://wiki.whamcloud.com/ - . - This package provides regression test scripts for the Lustre filesystem. - -Package: lustre-dev -Section: libdevel -Priority: optional -Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 -Depends: lustre-client-utils (= ${binary:Version}) -Description: Development files for the Lustre filesystem - Lustre is a scalable, secure, robust, highly-available cluster file system. - This release is maintained by Whamcloud and available from - https://wiki.whamcloud.com/ - . - This package provides development libraries for the Lustre filesystem. - -Package: lustre-client-modules-dkms -Section: admin -Architecture: i386 armhf powerpc ppc64el amd64 ia64 arm64 -Priority: optional -Depends: autoconf, automake, bison, build-essential, dkms, flex, libaio-dev, libkeyutils-dev, libkrb5-dev, libtool, libselinux-dev, libssl-dev, libyaml-dev, linux-base, linux-image (>= 3.10) | linux-image-generic (>= 3.10) | linux-image-amd64 (>= 3.10) | linux-image-arm64 (>= 3.10), linux-headers-generic | linux-headers-amd64, module-assistant, pkg-config, python3-distutils | python3-distutils-extra, python3-dev, libnl-genl-3-dev, zlib1g-dev, libmount1, libmount-dev, libkeyutils1, libkeyutils-dev -Provides: lustre-client-modules -Description: Lustre Linux kernel module (DKMS) - This package contains the loadable kernel modules for the patchless client - for the Lustre cluster filesystem. - . - These modules are compiled using DKMS. diff --git a/debian/control-lnet-gnilnd.in b/debian/control-lnet-gnilnd.in new file mode 100644 index 0000000..418e24c --- /dev/null +++ b/debian/control-lnet-gnilnd.in @@ -0,0 +1,11 @@ +Package: lustre-lnet-module-gnilnd-_KVERS_ +Source: lustre +Version: _VERS_ +Architecture: _ARCH_ +Maintainer: Lustre Developers +Recommends: linux-image, lustre-client-modules|lustre-server-modules +Provides: lustre-lnet-module-gnilnd +Description: Linux kernel lnet module for gni (kernel _KVERS_) + This package contains the loadable kernel modules for LNet on gni. + These modules are compiled for the _KVERS_ linux kernel. + diff --git a/debian/control-lnet-in-kernel-o2iblnd.in b/debian/control-lnet-in-kernel-o2iblnd.in new file mode 100644 index 0000000..e727570 --- /dev/null +++ b/debian/control-lnet-in-kernel-o2iblnd.in @@ -0,0 +1,13 @@ +Package: lustre-lnet-module-in-kernel-o2iblnd-_KVERS_ +Source: lustre +Version: _VERS_ +Architecture: _ARCH_ +Maintainer: Lustre Developers +Recommends: linux-image, lustre-client-modules|lustre-server-modules +Provides: lustre-lnet-module-in-kernel-o2iblnd +Conflicts: lustre-lnet-module-o2iblnd-_KVERS_ +Replaces: lustre-lnet-module-o2iblnd-_KVERS_ +Description: Linux kernel lnet module for o2ib (kernel _KVERS_) + This package contains the loadable kernel module for LNet on infiniband + using the in-kernel provided driver. + These modules are compiled for the _KVERS_ linux kernel. diff --git a/debian/control-lnet-kfilnd.in b/debian/control-lnet-kfilnd.in new file mode 100644 index 0000000..c79c671 --- /dev/null +++ b/debian/control-lnet-kfilnd.in @@ -0,0 +1,11 @@ +Package: lustre-lnet-module-kfilnd-_KVERS_ +Source: lustre +Version: _VERS_ +Architecture: _ARCH_ +Maintainer: Lustre Developers +Recommends: linux-image, lustre-client-modules|lustre-server-modules +Provides: lustre-lnet-module-kfilnd +Description: Linux kernel lnet module for kfi (kernel _KVERS_) + This package contains the loadable kernel modules for LNet on slingshot. + These modules are compiled for the _KVERS_ linux kernel. + diff --git a/debian/control-lnet-o2iblnd.in b/debian/control-lnet-o2iblnd.in new file mode 100644 index 0000000..e6bd58b --- /dev/null +++ b/debian/control-lnet-o2iblnd.in @@ -0,0 +1,13 @@ +Package: lustre-lnet-module-o2iblnd-_KVERS_ +Source: lustre +Version: _VERS_ +Architecture: _ARCH_ +Maintainer: Lustre Developers +Recommends: linux-image, lustre-client-modules|lustre-server-modules +Provides: lustre-lnet-module-o2iblnd +Conflicts: lustre-lnet-module-in-kernel-o2iblnd-_KVERS_ +Replaces: lustre-lnet-module-in-kernel-o2iblnd-_KVERS_ +Description: Linux kernel lnet module for o2ib (MOFED/OPA) (kernel _KVERS_) + This package contains the loadable kernel module for LNet on infiniband + using an externally supplied kernel driver. + These modules are compiled for the _KVERS_ linux kernel. diff --git a/debian/control-lnet-socklnd.in b/debian/control-lnet-socklnd.in new file mode 100644 index 0000000..9900301 --- /dev/null +++ b/debian/control-lnet-socklnd.in @@ -0,0 +1,11 @@ +Package: lustre-lnet-module-socklnd-_KVERS_ +Source: lustre +Version: _VERS_ +Architecture: _ARCH_ +Maintainer: Lustre Developers +Recommends: linux-image, lustre-client-modules|lustre-server-modules +Provides: lustre-lnet-module-socklnd +Description: Linux kernel lnet module for sockets (kernel _KVERS_) + This package contains the loadable kernel modules for LNet on tcp/ip. + These modules are compiled for the _KVERS_ linux kernel. + diff --git a/debian/control.main b/debian/control.main index 2972bd3..112f12b 100644 --- a/debian/control.main +++ b/debian/control.main @@ -19,7 +19,7 @@ Description: source for Lustre filesystem client kernel modules https://wiki.whamcloud.com/ . This package contains the module source. The client kernel modules - can be built for kernels 2.6.32+ with the use of module-assistant + can be built for kernels 3.10+ with the use of module-assistant or make-kpkg. Package: lustre-client-utils @@ -70,7 +70,7 @@ Description: HA Resuable Cluster Resource Scripts for Lustre . This package provides a set of scripts to operate Lustre resources in a High Availablity environment for both Pacemaker - and rgmanager. + and rgmanager on a server. Package: lustre-iokit Section: utils @@ -82,7 +82,7 @@ Description: Collection of benchmark tools for the Lustre filesystem This release is maintained by Whamcloud and available from https://wiki.whamcloud.com/ . - This package provides a collection of benchmark tools + This package provides a collection of benchmark tools for Lustre clients. Package: lustre-tests Section: utils @@ -94,7 +94,7 @@ Description: Test suite for the Lustre filesystem This release is maintained by Whamcloud and available from https://wiki.whamcloud.com/ . - This package provides a number of test utilities for the Lustre filesystem. + This package provides regression test scripts for the Lustre filesystem. Package: lustre-dev Section: libdevel diff --git a/debian/repackage-multiple-lnds.sh b/debian/repackage-multiple-lnds.sh new file mode 100755 index 0000000..c9f3697 --- /dev/null +++ b/debian/repackage-multiple-lnds.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# Repackage LNDs into multiple packages: +KVERS=$1 +VER=$2 +LMDEB=$(ls $3) + +origin=$(dirname $(realpath $LMDEB)) +modpkg=$(basename -s .deb $LMDEB) +arch=$(echo $modpkg | cut -d_ -f3) +kfipkg="lustre-lnet-module-kfilnd-${KVERS}_${VER}_${arch}" +gnipkg="lustre-lnet-module-gnilnd-${KVERS}_${VER}_${arch}" +sockpkg="lustre-lnet-module-socklnd-${KVERS}_${VER}_${arch}" +o2ibpkg="lustre-lnet-module-o2iblnd-${KVERS}_${VER}_${arch}" +in_kernel_o2ibpkg="lustre-lnet-module-in-kernel-o2iblnd-${KVERS}_${VER}_${arch}" + +VERBOSE='' + +# expand the modules package: +cd debian/tmp/re-pkg/${modpkg} +ar x ../../../../$LMDEB +cd DEBIAN; tar xf ../control.tar*; cd .. +tar xf data.tar* +mv debian-binary DEBIAN +rm data.tar* control.tar* +modpath=$(dirname $(find . -name ksocklnd.ko)) +cd .. + +# NOTE: pwd is debian/tmp/re-pkg + +if [[ "x${VERBOSE}" = "x-v" ]] ; then + echo "repackage-multiple-lnds" + echo " DEB: '${LMDEB}'" + echo " KVERS: '${KVERS}'" + echo " VER: '${VER}" + echo " arch: '${arch}" + echo " origin: '${origin}'" + echo " modpath: '${modpath}'" +fi + +for pkg in ${modpkg} ${kfipkg} ${gnipkg} ${sockpkg} ${o2ibpkg} ${in_kernel_o2ibpkg} +do + mkdir -p ${pkg}/DEBIAN + mkdir -p ${pkg}/${modpath} +done + +# Migate individual lnds to new packages +if [[ -f ${modpkg}/${modpath}/kkfilnd.ko ]] ; then + [[ x${VERBOSE} = 'x-v' ]] && echo "Repackage kkfilnd.ko" + mv ${modpkg}/${modpath}/kkfilnd.ko ${kfipkg}/${modpath}/ + cp ${modpkg}/DEBIAN/* ${kfipkg}/DEBIAN + grep kkfilnd.ko ${modpkg}/DEBIAN/md5sums > ${kfipkg}/DEBIAN/md5sums + sed -e "s:_KVERS_:${KVERS}:g" -e "s:_VERS_:${VER}:g" -e "s:_ARCH_:${arch}:g" \ + ../../control-lnet-kfilnd.in > ${kfipkg}/DEBIAN/control + dpkg-deb --build ${kfipkg} + cp ${VERBOSE} ${kfipkg}.deb ${origin} +fi +if [[ -f ${modpkg}/${modpath}/kgnilnd.ko ]] ; then + [[ x${VERBOSE} = 'x-v' ]] && echo "Repackage kgnilnd.ko" + mv ${modpkg}/${modpath}/kgnilnd.ko ${gnipkg}/${modpath}/ + cp ${modpkg}/DEBIAN/* ${gnipkg}/DEBIAN + grep kgnilnd.ko ${modpkg}/DEBIAN/md5sums > ${gnipkg}/DEBIAN/md5sums + sed -e "s:_KVERS_:${KVERS}:g" -e "s:_VERS_:${VER}:g" -e "s:_ARCH_:${arch}:g" \ + ../../control-lnet-gnilnd.in > ${gnipkg}/DEBIAN/control + dpkg-deb --build ${gnipkg} + cp ${VERBOSE} ${gnipkg}.deb ${origin} +fi +if [[ -f ${modpkg}/${modpath}/ksocklnd.ko ]] ; then + [[ x${VERBOSE} = 'x-v' ]] && echo "Repackage ksocklnd.ko" + mv ${modpkg}/${modpath}/ksocklnd.ko ${sockpkg}/${modpath}/ + cp ${modpkg}/DEBIAN/* ${sockpkg}/DEBIAN + grep ksocklnd.ko ${modpkg}/DEBIAN/md5sums > ${sockpkg}/DEBIAN/md5sums + sed -e "s:_KVERS_:${KVERS}:g" -e "s:_VERS_:${VER}:g" -e "s:_ARCH_:${arch}:g" \ + ../../control-lnet-socklnd.in > ${sockpkg}/DEBIAN/control + dpkg-deb --build ${sockpkg} + cp ${VERBOSE} ${sockpkg}.deb ${origin} +fi +if [[ -f ${modpkg}/${modpath}/ko2iblnd.ko ]] ; then + [[ x${VERBOSE} = 'x-v' ]] && echo "Repackage ko2iblnd.ko" + mv ${modpkg}/${modpath}/ko2iblnd.ko ${o2ibpkg}/${modpath}/ + cp ${modpkg}/DEBIAN/* ${o2ibpkg}/DEBIAN + grep ko2iblnd.ko ${modpkg}/DEBIAN/md5sums > ${o2ibpkg}/DEBIAN/md5sums + sed -e "s:_KVERS_:${KVERS}:g" -e "s:_VERS_:${VER}:g" -e "s:_ARCH_:${arch}:g" \ + ../../control-lnet-o2iblnd.in > ${o2ibpkg}/DEBIAN/control + dpkg-deb --build ${o2ibpkg} + cp ${VERBOSE} ${o2ibpkg}.deb ${origin} +fi +if [[ -f ${modpkg}/${modpath}/in-kernel-ko2iblnd.ko ]] ; then + [[ x${VERBOSE} = 'x-v' ]] && echo "Repackage in-kernel-ko2iblnd.ko as ko2iblnd.ko" + mv ${modpkg}/${modpath}/in-kernel-ko2iblnd.ko ${in_kernel_o2ibpkg}/${modpath}/ko2iblnd.ko + cp ${modpkg}/DEBIAN/* ${in_kernel_o2ibpkg}/DEBIAN + grep in-kernel-ko2iblnd.ko ${modpkg}/DEBIAN/md5sums > ${in_kernel_o2ibpkg}/DEBIAN/md5sums + sed -e "s:_KVERS_:${KVERS}:g" -e "s:_VERS_:${VER}:g" -e "s:_ARCH_:${arch}:g" \ + ../../control-lnet-in-kernel-o2iblnd.in > ${in_kernel_o2ibpkg}/DEBIAN/control + dpkg-deb --build ${in_kernel_o2ibpkg} + cp ${VERBOSE} ${in_kernel_o2ibpkg}.deb ${origin} +fi + +# Rebuilding lustre-[client|server]-modules without lnet lnd drivers +dpkg-deb --build ${modpkg} +cp ${VERBOSE} ${modpkg}.deb ${origin} diff --git a/debian/rules b/debian/rules index 35e775f..a5c8b9b 100755 --- a/debian/rules +++ b/debian/rules @@ -191,8 +191,21 @@ 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 \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "multiple-lnds"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --enable-multiple-lnds"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "ext_o2ib"; then \ export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \ + elif echo "$${DEB_BUILD_PROFILES}" | grep -q "int_o2ib"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=yes"; \ + else \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=no"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "gnilnd"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gni"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "kfilnd"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-kfi=/usr/src/kfabric"; \ fi; \ options="gss crypto pinger checksum flock lru-resize"; \ options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \ @@ -492,8 +505,21 @@ kdist_config: prep-deb-files patch-stamp export EXTRAFLAGS="$${EXTRAFLAGS} \ --disable-ldiskfs --disable-quilt"; \ fi; \ - if echo "$${DEB_BUILD_PROFILES}" | grep -q "o2ib"; then \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "multiple-lnds"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --enable-multiple-lnds"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "ext_o2ib"; then \ export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=$${O2IB_SRC}"; \ + elif echo "$${DEB_BUILD_PROFILES}" | grep -q "int_o2ib"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=yes"; \ + else \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-o2ib=no"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "gnilnd"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --enable-gni"; \ + fi; \ + if echo "$${DEB_BUILD_PROFILES}" | grep -q "kfilnd"; then \ + export EXTRAFLAGS="$${EXTRAFLAGS} --with-kfi=/usr/src/kfabric"; \ fi; \ options="gss crypto pinger checksum flock lru-resize"; \ options="$${options} mindf fail-alloc invariants lu_ref pgstate-track"; \ diff --git a/lnet/klnds/in-kernel-o2iblnd/autoMakefile.am b/lnet/klnds/in-kernel-o2iblnd/autoMakefile.am index e4f8075..ceda0b8 100644 --- a/lnet/klnds/in-kernel-o2iblnd/autoMakefile.am +++ b/lnet/klnds/in-kernel-o2iblnd/autoMakefile.am @@ -33,11 +33,16 @@ if MODULES if BUILT_IN_KO2IBLND modulenet_DATA = in-kernel-ko2iblnd$(KMODEXT) in-kernel-ko2iblnd$(KMODEXT): sources + if EXTERNAL_KO2IBLND else +ko2iblnd$(KMODEXT): in-kernel-ko2iblnd$(KMODEXT) + cp -vf in-kernel-ko2iblnd$(KMODEXT) ko2iblnd$(KMODEXT) + install-exec-hook: (cd "$(DESTDIR)$(modulenetdir)"; \ - $(LN_S) in-kernel-ko2iblnd$(KMODEXT) ko2iblnd$(KMODEXT)) + $(LN_S) -f in-kernel-ko2iblnd$(KMODEXT) ko2iblnd$(KMODEXT)) + uninstall-hook: (cd "$(DESTDIR)$(modulenetdir)"; rm -f ko2iblnd$(KMODEXT)) endif @@ -47,9 +52,19 @@ endif MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ EXTRA_DIST = $(in-kernel-ko2iblnd-objs:%.o=%.c) o2iblnd-idl.h o2iblnd.h +if MODULES +if BUILT_IN_KO2IBLND +if EXTERNAL_KO2IBLND +# in-kernel and mofed all-local: $(in-kernel-ko2iblnd_headers) $(in-kernel-ko2iblnd_sources) +else +# in-kernel-only +all-local: $(in-kernel-ko2iblnd_headers) $(in-kernel-ko2iblnd_sources) ko2iblnd$(KMODEXT) +endif +endif +endif CLEANFILES = $(in-kernel-ko2iblnd_headers) $(in-kernel-ko2iblnd_sources) clean-local: - rm -rf $(in-kernel-ko2iblnd_headers) $(in-kernel-ko2iblnd_sources) + rm -rf $(in-kernel-ko2iblnd_headers) $(in-kernel-ko2iblnd_sources) ko2iblnd$(KMODEXT) -- 1.8.3.1