From: Shaun Tancheff Date: Sun, 17 Sep 2023 16:48:47 +0000 (-0500) Subject: LU-16967 build: Separate lnet LND rpm packaging X-Git-Tag: 2.15.60~60 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=67cd54d05d0ced81cd7c2c40e58b1707e89bc4fa;p=fs%2Flustre-release.git LU-16967 build: Separate lnet LND rpm packaging Enable separate packaging of lnet lnd kernel modules into separate packages. Use --with multiple_lnds to enable separate packages for lnet lnds: [always builds]: kmod-lustre-lnet-socklnd for socklnd.ko --with o2ib: for kmod-lustre-lnet-in-kernel-o2iblnd ko2iblnd.ko -> in-kernel-ko2iblnd.ko --with mofed: kmod-lustre-lnet-o2iblnd for ko2iblnd.ko --with kfi: kmod-lustre-lnet-gnilnd for kgnilnd.ko --with gni: kmod-lustre-lnet-kfilnd for kkfilnd.ko Test-Parameters: trivial HPE-bug-id: LUS-11711 Signed-off-by: Shaun Tancheff Change-Id: If2dace7ced96be2a2194f66362e9419b017c625f Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51692 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 9cca76d..df3b81c 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -530,6 +530,31 @@ elif test x$enable_crypto = xno ; then RPMBINARGS="$RPMBINARGS --without crypto" AC_SUBST(ENABLE_CRYPTO, no) fi +if test x$enable_multiple_lnds = xyes ; then + RPMBINARGS="$RPMBINARGS --with multiple_lnds" +else + RPMBINARGS="$RPMBINARGS --without multiple_lnds" +fi +if test x$EXTERNAL_KO2IBLND = xyes ; then + RPMBINARGS="$RPMBINARGS --with mofed" +else + RPMBINARGS="$RPMBINARGS --without mofed" +fi +if test x$BUILT_IN_KO2IBLND = xyes ; then + RPMBINARGS="$RPMBINARGS --with o2ib" +else + RPMBINARGS="$RPMBINARGS --without o2ib" +fi +if test x$KFILND = xkfilnd ; then + RPMBINARGS="$RPMBINARGS --with kfi" +else + RPMBINARGS="$RPMBINARGS --without kfi" +fi +if test x$ENABLE_GNI = xyes ; then + RPMBINARGS="$RPMBINARGS --with gni" +else + RPMBINARGS="$RPMBINARGS --without gni" +fi if test x$enable_iokit != xyes ; then RPMBINARGS="$RPMBINARGS --without lustre_iokit" fi diff --git a/lustre.spec.in b/lustre.spec.in index f64b530..a08add8 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -21,10 +21,18 @@ %bcond_without manpages %bcond_without shared %bcond_without static -%bcond_with systemd -%bcond_with mofed +%bcond_with systemd %bcond_without mpi %bcond_with kabi +%bcond_with multiple_lnds +%bcond_with mofed +%bcond_without o2ib +%bcond_with kfi +%bcond_with gni + +%if %{with multiple_lnds} +%global enable_multi_lnds 1 +%endif # LUTF Turn off brp-python-precompile script as we don't want the python files # to be compiled on installation @@ -209,6 +217,16 @@ Source7: kmp-lustre-tests.preamble Source8: kmp-lustre-tests.files Source9: find-provides Source10: find-provides.ksyms +Source11: kmp-lnet-socklnd.preamble +Source12: kmp-lnet-socklnd.files +Source13: kmp-lnet-o2iblnd.preamble +Source14: kmp-lnet-o2iblnd.files +Source15: kmp-lnet-gnilnd.preamble +Source16: kmp-lnet-gnilnd.files +Source17: kmp-lnet-kfilnd.preamble +Source18: kmp-lnet-kfilnd.files +Source19: kmp-lnet-in-kernel-o2iblnd.preamble +Source20: kmp-lnet-in-kernel-o2iblnd.files URL: https://wiki.whamcloud.com/ BuildRoot: %{_tmppath}/lustre-%{version}-root %if %{with lustre_modules} @@ -440,6 +458,35 @@ to be used by the Lustre testing framework. %endif %endif +%if %{with multiple_lnds} +# begin multiple_lnds +%kernel_module_package -n %{name}-lnet-socklnd -p %SOURCE11 -f %SOURCE12 %{_flavor} +%if %{with o2ib} +## re-write post/preun generated by kmodtool [ls -s and rm -f] +%define inkernmod %{modules_fs_path}/%{lustre_name}/net/in-kernel-ko2iblnd.ko +%define inkernsym %{modules_fs_path}/%{lustre_name}/net/ko2iblnd.ko +%define ofed_module_package %{expand:%( +TMPFILE=`mktemp` +cat < $TMPFILE +%kernel_module_package -n %{name}-lnet-in-kernel-o2iblnd -p %SOURCE19 -f %SOURCE20 %{_flavor} +EOF +sed -i -e '/^%%post.*/a ln -sf %{inkernmod} %{inkernsym}' -e '/^%%preun.*/a rm -f %{inkernsym}' $TMPFILE +echo $TMPFILE +)} +%{expand:%(cat '%{ofed_module_package}')} +%endif +%if %{with mofed} +%kernel_module_package -n %{name}-lnet-o2iblnd -p %SOURCE13 -f %SOURCE14 %{_flavor} +%endif +%if %{with gni} +%kernel_module_package -n %{name}-lnet-gnilnd -p %SOURCE15 -f %SOURCE16 %{_flavor} +%endif +%if %{with kfi} +%kernel_module_package -n %{name}-lnet-kfilnd -p %SOURCE17 -f %SOURCE18 %{_flavor} +%endif +# end multiple_lnds +%endif + %if %{with lustre_iokit} %package -n lustre-iokit Summary: Collection of benchmark tools for a cluster with the Lustre file system @@ -560,6 +607,7 @@ fi # mpi %endif +WITH_O2IB="" %if %{with mofed} o2ib_path=$(find /usr/src/ofa_kernel/ -type d -name ofed_scripts | xargs dirname) if [ -z "$o2ib_path" ]; then @@ -570,6 +618,11 @@ fi echo "ERROR: multiple OFED versions installed" exit 1 fi + WITH_O2IB="--with-o2ib=${o2ib_path}" +%else +%if %{without o2ib} + WITH_O2IB="--with-o2ib=no" +%endif %endif %eval_configure $CONFIGURE_ARGS \ @@ -587,7 +640,10 @@ fi %{!?with_manpages:--disable-manpages} \ %{!?with_systemd:--with-systemdsystemunitdir=no} \ %{?with_systemd:--with-systemdsystemunitdir=%{_unitdir}} \ - %{?with_mofed:--with-o2ib=$o2ib_path} \ + %{?with_multiple_lnds:--enable-multiple-lnds} \ + %{?with_kfi:--with-kfi=/usr/src/cray-kfabric/default} \ + %{?with_gni:--enable-gni} \ + ${WITH_O2IB} \ --with-linux=%{kdir} \ --with-linux-obj=%{kobjdir} \ --with-kmp-moddir=%{kmoddir}/%{name} diff --git a/rpm/kmp-lnet-gnilnd.files b/rpm/kmp-lnet-gnilnd.files new file mode 100644 index 0000000..4832bca --- /dev/null +++ b/rpm/kmp-lnet-gnilnd.files @@ -0,0 +1,3 @@ +%defattr(-,root,root) +%dir %{modules_fs_path}/%{lustre_name}/net +%{modules_fs_path}/%{lustre_name}/net/kgnilnd.ko diff --git a/rpm/kmp-lnet-gnilnd.preamble b/rpm/kmp-lnet-gnilnd.preamble new file mode 100644 index 0000000..1350b09 --- /dev/null +++ b/rpm/kmp-lnet-gnilnd.preamble @@ -0,0 +1,7 @@ +Summary: Lustre LNet gnilnd +License: GPL-2.0-only +%if 0%{?suse_version} > 1 +Requires: kernel-%1 +%endif +Provides: %{name}-lnet-gnilnd = %{version} +Obsoletes: %{name}-lnet-gnilnd < %{version} diff --git a/rpm/kmp-lnet-in-kernel-o2iblnd.files b/rpm/kmp-lnet-in-kernel-o2iblnd.files new file mode 100644 index 0000000..a170b77 --- /dev/null +++ b/rpm/kmp-lnet-in-kernel-o2iblnd.files @@ -0,0 +1,3 @@ +%defattr(-,root,root) +%dir %{modules_fs_path}/%{lustre_name}/net +%{modules_fs_path}/%{lustre_name}/net/in-kernel-ko2iblnd.ko diff --git a/rpm/kmp-lnet-in-kernel-o2iblnd.preamble b/rpm/kmp-lnet-in-kernel-o2iblnd.preamble new file mode 100644 index 0000000..d1a9472 --- /dev/null +++ b/rpm/kmp-lnet-in-kernel-o2iblnd.preamble @@ -0,0 +1,10 @@ +Summary: Lustre LNet o2iblnd for in-kernel OFED +License: GPL-2.0-only +%if 0%{?suse_version} > 1 +Requires: kernel-%1 +%endif +Provides: %{name}-lnet-in-kernel-o2iblnd = %{version} +Obsoletes: %{name}-lnet-in-kernel-o2iblnd < %{version} +# Common package name +Provides: %{name}-lnet-o2iblnd = %{version} +Obsoletes: %{name}-lnet-o2iblnd < %{version} diff --git a/rpm/kmp-lnet-kfilnd.files b/rpm/kmp-lnet-kfilnd.files new file mode 100644 index 0000000..1744dc7 --- /dev/null +++ b/rpm/kmp-lnet-kfilnd.files @@ -0,0 +1,3 @@ +%defattr(-,root,root) +%dir %{modules_fs_path}/%{lustre_name}/net +%{modules_fs_path}/%{lustre_name}/net/kkfilnd.ko diff --git a/rpm/kmp-lnet-kfilnd.preamble b/rpm/kmp-lnet-kfilnd.preamble new file mode 100644 index 0000000..bbeb5ee --- /dev/null +++ b/rpm/kmp-lnet-kfilnd.preamble @@ -0,0 +1,7 @@ +Summary: Lustre LNet kfilnd +License: GPL-2.0-only +%if 0%{?suse_version} > 1 +Requires: kernel-%1 +%endif +Provides: %{name}-lnet-kfilnd = %{version} +Obsoletes: %{name}-lnet-kfilnd < %{version} diff --git a/rpm/kmp-lnet-o2iblnd.files b/rpm/kmp-lnet-o2iblnd.files new file mode 100644 index 0000000..2fea7e4 --- /dev/null +++ b/rpm/kmp-lnet-o2iblnd.files @@ -0,0 +1,3 @@ +%defattr(-,root,root) +%dir %{modules_fs_path}/%{lustre_name}/net +%{modules_fs_path}/%{lustre_name}/net/ko2iblnd.ko diff --git a/rpm/kmp-lnet-o2iblnd.preamble b/rpm/kmp-lnet-o2iblnd.preamble new file mode 100644 index 0000000..a5b5b3d --- /dev/null +++ b/rpm/kmp-lnet-o2iblnd.preamble @@ -0,0 +1,8 @@ +Summary: Lustre LNet o2iblnd for 3rd party OFED +License: GPL-2.0-only +%if 0%{?suse_version} > 1 +Requires: kernel-%1 +%endif +Provides: %{name}-lnet-o2iblnd = %{version} +Obsoletes: %{name}-lnet-o2iblnd < %{version} +Conflicts: %{name}-lnet-in-kernel-o2iblnd diff --git a/rpm/kmp-lnet-socklnd.files b/rpm/kmp-lnet-socklnd.files new file mode 100644 index 0000000..97f7248 --- /dev/null +++ b/rpm/kmp-lnet-socklnd.files @@ -0,0 +1,3 @@ +%defattr(-,root,root) +%dir %{modules_fs_path}/%{lustre_name}/net +%{modules_fs_path}/%{lustre_name}/net/ksocklnd.ko diff --git a/rpm/kmp-lnet-socklnd.preamble b/rpm/kmp-lnet-socklnd.preamble new file mode 100644 index 0000000..cfccb75 --- /dev/null +++ b/rpm/kmp-lnet-socklnd.preamble @@ -0,0 +1,7 @@ +Summary: Lustre LNet socklnd +License: GPL-2.0-only +%if 0%{?suse_version} > 1 +Requires: kernel-%1 +%endif +Provides: %{name}-lnet-socklnd = %{version} +Obsoletes: %{name}-lnet-socklnd < %{version} diff --git a/rpm/kmp-lustre.files b/rpm/kmp-lustre.files index 3ded0c4..18ea8cc 100644 --- a/rpm/kmp-lustre.files +++ b/rpm/kmp-lustre.files @@ -1,7 +1,16 @@ %defattr(-,root,root) %dir %{modules_fs_path} %dir %{modules_fs_path}/%{lustre_name} +%if 0%{?enable_multi_lnds} > 0 +%dir %{modules_fs_path}/%{lustre_name}/fs +%dir %{modules_fs_path}/%{lustre_name}/net +%{modules_fs_path}/%{lustre_name}/fs/* +%{modules_fs_path}/%{lustre_name}/net/libcfs.ko +%{modules_fs_path}/%{lustre_name}/net/lnet.ko +%{modules_fs_path}/%{lustre_name}/net/lnet_selftest.ko +%else %{modules_fs_path}/%{lustre_name}/* +%endif %doc COPYING %doc ChangeLog-lustre %doc ChangeLog-lnet