From: James Simmons Date: Wed, 22 Nov 2017 02:43:14 +0000 (-0500) Subject: LU-9897 utils: make liblnetconfig a hard requirment X-Git-Tag: 2.10.56~10 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ccafcc7116411c7d276c5b8523b0effb4c4dd796;p=fs%2Flustre-release.git LU-9897 utils: make liblnetconfig a hard requirment With the recent changes to LNet lnetctl is now really a hard requirment. This patch makes lustre require libyaml libraries in order to build. In turn liblnetconfig and lnetctl are now always built. Test-Parameters: trivial Change-Id: I26ff9397f3d5ba11da5ab4e76658ffd8c27ed035 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/30204 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Sonia Sharma Reviewed-by: Olaf Weber Reviewed-by: Oleg Drokin --- diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 1779ca4..b41ce46 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -507,9 +507,6 @@ fi if test x$enable_iokit != xyes ; then RPMBINARGS="$RPMBINARGS --without lustre_iokit" fi -if test x$USE_DLC = xyes ; then - RPMBINARGS="$RPMBINARGS --with lnet_dlc" -fi if test x$enable_snmp != xyes ; then RPMBINARGS="$RPMBINARGS --without snmp" fi diff --git a/debian/lustre-dev.install b/debian/lustre-dev.install index 851d6af..bce2c9d 100644 --- a/debian/lustre-dev.install +++ b/debian/lustre-dev.install @@ -1,3 +1,3 @@ debian/tmp/usr/include/lustre/* usr/include/lustre -debian/tmp/usr/lib/*.so usr/lib +debian/tmp/usr/lib/*.so* usr/lib debian/tmp/usr/lib/*.a usr/lib diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 561833a..be38840 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -101,33 +101,15 @@ AS_IF([test "x$enable_backoff" = xyes], [ # # LN_CONFIG_DLC # -# Configure dlc if enabled +# Configure dlc # -# if libyaml is set (IE libyaml installed) and enable_dlc = yes then build -# dlc other wise (IE if libyaml is not set or enable_dlc = no) then don't -# build dlc. +# fail to build if libyaml is not installed # AC_DEFUN([LN_CONFIG_DLC], [ - AC_CHECK_LIB([yaml], [yaml_parser_initialize],[ - LIBYAML="libyaml"],[ - LIBYAML=""],[-lm]) - AC_MSG_CHECKING([whether to enable dlc]) - AC_ARG_ENABLE([dlc], - AC_HELP_STRING([--disable-dlc], - [disable building dlc]), - [], [enable_dlc="yes"]) - USE_DLC="" - AS_IF([test "x$enable_dlc" = xyes], - [AS_IF([test "x$LIBYAML" = xlibyaml], [ - USE_DLC="yes" - AC_MSG_RESULT([yes]) - ], [ - AC_MSG_RESULT([no (libyaml not present)]) - ]) - ], [ - AC_MSG_RESULT([no]) - ]) - AC_SUBST(USE_DLC) + AC_CHECK_LIB([yaml], [yaml_parser_initialize], + [LIBYAML="libyaml"], + [AC_MSG_ERROR([YAML development libraries not not installed])], + [-lm]) ]) # @@ -835,7 +817,6 @@ LN_CONFIG_DLC AC_DEFUN([LN_CONDITIONALS], [ AM_CONDITIONAL(BUILD_O2IBLND, test x$O2IBLND = "xo2iblnd") AM_CONDITIONAL(BUILD_GNILND, test x$GNILND = "xgnilnd") -AM_CONDITIONAL(BUILD_DLC, test x$USE_DLC = "xyes") ]) # LN_CONDITIONALS # diff --git a/lnet/utils/Makefile.am b/lnet/utils/Makefile.am index 091f9da..14b93fa 100644 --- a/lnet/utils/Makefile.am +++ b/lnet/utils/Makefile.am @@ -35,27 +35,19 @@ AM_CFLAGS := -fPIC -D_GNU_SOURCE AM_LDFLAGS := -L. -if BUILD_DLC SUBDIRS = lnetconfig -endif # BUILD_DLC LIBCFS= $(top_builddir)/libcfs/libcfs/libcfs.a if UTILS -sbin_PROGRAMS = routerstat lst - -if BUILD_DLC -sbin_PROGRAMS += lnetctl -endif # BUILD_DLC +sbin_PROGRAMS = routerstat lst lnetctl routerstat_SOURCES = routerstat.c routerstat_LDADD = $(LIBCFS) lst_SOURCES = lst.c lst_LDADD = $(LIBCFS) $(LIBREADLINE) $(LIBEFENCE) -if BUILD_DLC lst_LDADD += $(top_builddir)/lnet/utils/lnetconfig/liblnetconfig.la -endif if TESTS sbin_PROGRAMS += wirecheck diff --git a/lnet/utils/lst.c b/lnet/utils/lst.c index c47fd5d..4d83d26 100644 --- a/lnet/utils/lst.c +++ b/lnet/utils/lst.c @@ -51,9 +51,7 @@ #include #include #include -#ifdef USE_DLC #include "lnetconfig/liblnetconfig.h" -#endif struct lst_sid LST_INVALID_SID = { .ses_nid = LNET_NID_ANY, .ses_stamp = -1 }; static struct lst_sid session_id; @@ -3333,11 +3331,8 @@ main(int argc, char **argv) rc = lst_initialize(); if (rc < 0) goto errorout; -#ifdef USE_DLC + rc = lustre_lnet_config_lib_init(); -#else - rc = register_ioc_dev(LNET_DEV_ID, LNET_DEV_PATH); -#endif if (rc < 0) goto errorout; diff --git a/lustre.spec.in b/lustre.spec.in index 65e9ad4..7c94d70 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -8,7 +8,6 @@ %bcond_without lustre_utils %bcond_without lustre_iokit %bcond_without lustre_modules -%bcond_with lnet_dlc %bcond_with snmp %bcond_without manpages %bcond_without shared @@ -309,7 +308,6 @@ fi %{!?with_ldiskfs:--disable-ldiskfs} \ %{!?with_servers:--disable-server} \ %{!?with_zfs:--without-zfs} \ - %{!?with_lnet_dlc:--disable-dlc} \ %{!?with_snmp:--disable-snmp} \ %{!?with_manpages:--disable-manpages} \ %{!?with_systemd:--with-systemdsystemunitdir=no} \ @@ -386,7 +384,6 @@ install -m 0755 contrib/scripts/pacemaker/* $RPM_BUILD_ROOT%{_prefix}/lib/ocf/re # fc18 needs 'x' permission for library files find $RPM_BUILD_ROOT -name \*.so -type f -exec chmod +x {} \; -%if %{with lnet_dlc} rm -f $RPM_BUILD_ROOT%{_libdir}/liblnetconfig.la %if %{with static} echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files @@ -395,7 +392,6 @@ echo '%attr(-, root, root) %{_libdir}/liblnetconfig.a' >>lustre.files echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so' >>lustre.files echo '%attr(-, root, root) %{_libdir}/liblnetconfig.so.*' >>lustre.files %endif -%endif %if %{with ldiskfs} echo '%{_libdir}/libiam.a' >>lustre.files @@ -463,9 +459,7 @@ echo '%{_sbindir}/wiretest' >>lustre-tests.files %endif %{_sysconfdir}/udev/rules.d/99-lustre.rules %config(noreplace) %{_sysconfdir}/ldev.conf -%if %{with lnet_dlc} %config(noreplace) %{_sysconfdir}/lnet.conf -%endif %config(noreplace) %{_sysconfdir}/modprobe.d/ko2iblnd.conf %if %{with lustre_utils} %config(noreplace) %{_sysconfdir}/lnet_routes.conf diff --git a/lustre/conf/Makefile.am b/lustre/conf/Makefile.am index 562a352..db2bf47 100644 --- a/lustre/conf/Makefile.am +++ b/lustre/conf/Makefile.am @@ -55,9 +55,7 @@ sysconfig_DATA = lustre lsvcgss endif endif -if BUILD_DLC sysconf_DATA += lnet.conf -endif modprobedir = $(sysconfdir)/modprobe.d modprobe_DATA = ko2iblnd.conf diff --git a/lustre/scripts/Makefile.am b/lustre/scripts/Makefile.am index 25b9995..a4ed9f7 100644 --- a/lustre/scripts/Makefile.am +++ b/lustre/scripts/Makefile.am @@ -83,15 +83,6 @@ EXTRA_DIST = license-status lustre_rmmod ldev lc_mon lhbadm \ CLEANFILES = $(genscripts) $(genscripts): %: %.in -if BUILD_DLC sed -e 's,@sysconfdir\@,$(sysconfdir),g' \ - -e 's,@scriptlibdir\@,$(scriptlibdir),g' \ - -e 's,@BUILD_DLC_TRUE\@,,g' \ - -e 's,@BUILD_DLC_FALSE\@,\#,g' $< > $@ -else - sed -e 's,@sysconfdir\@,$(sysconfdir),g' \ - -e 's,@scriptlibdir\@,$(scriptlibdir),g' \ - -e 's,@BUILD_DLC_TRUE\@,\#,g' \ - -e 's,@BUILD_DLC_FALSE\@,,g' $< > $@ -endif + -e 's,@scriptlibdir\@,$(scriptlibdir),g' $< > $@ chmod +x $@ diff --git a/lustre/scripts/lnet.in b/lustre/scripts/lnet.in index afd7519..215b550 100644 --- a/lustre/scripts/lnet.in +++ b/lustre/scripts/lnet.in @@ -101,17 +101,14 @@ case "$1" in run_preexec_check "start" touch /var/lock/subsys/lnet modprobe lnet || exit 1 - @BUILD_DLC_TRUE@lnetctl lnet configure || exit 1 - @BUILD_DLC_TRUE@lnetctl import < "@sysconfdir@/lnet.conf" - @BUILD_DLC_FALSE@lctl network up || exit 1 - @BUILD_DLC_FALSE@lustre_routes_config "@sysconfdir@/lnet_routes.conf" + lnetctl lnet configure || exit 1 + lnetctl import < "@sysconfdir@/lnet.conf" run_postexec_check "start" ;; stop) run_preexec_check "stop" lustre_rmmod ptlrpc || exit 1 - @BUILD_DLC_TRUE@lnetctl lnet unconfigure || exit 1 - @BUILD_DLC_FALSE@lctl network down || exit 1 + lnetctl lnet unconfigure || exit 1 lustre_rmmod libcfs ldiskfs || exit 1 rm -f /var/lock/subsys/lnet run_postexec_check "stop" diff --git a/lustre/scripts/systemd/Makefile.am b/lustre/scripts/systemd/Makefile.am index cfda573..340f6f1 100644 --- a/lustre/scripts/systemd/Makefile.am +++ b/lustre/scripts/systemd/Makefile.am @@ -10,14 +10,5 @@ EXTRA_DIST = $(addsuffix .in,$(genunitfiles)) CLEANFILES = $(genunitfiles) $(genunitfiles): %: %.in -if BUILD_DLC sed -e 's,@sbindir\@,$(sbindir),g' \ - -e 's,@sysconfdir\@,$(sysconfdir),g' \ - -e 's,@BUILD_DLC_TRUE\@,,g' \ - -e 's,@BUILD_DLC_FALSE\@,\#,g' $< > $@ -else - sed -e 's,@sbindir\@,$(sbindir),g' \ - -e 's,@sysconfdir\@,$(sysconfdir),g' \ - -e 's,@BUILD_DLC_TRUE\@,\#,g' \ - -e 's,@BUILD_DLC_FALSE\@,,g' $< > $@ -endif + -e 's,@sysconfdir\@,$(sysconfdir),g' $< > $@ diff --git a/lustre/scripts/systemd/lnet.service.in b/lustre/scripts/systemd/lnet.service.in index c5bc875..eb35753 100644 --- a/lustre/scripts/systemd/lnet.service.in +++ b/lustre/scripts/systemd/lnet.service.in @@ -10,13 +10,10 @@ ConditionPathExists=!/proc/sys/lnet/ Type=oneshot RemainAfterExit=true ExecStart=@sbindir@/modprobe lnet -@BUILD_DLC_FALSE@ExecStart=@sbindir@/lctl network up -@BUILD_DLC_FALSE@ExecStart=@sbindir@/lustre_routes_config @sysconfdir@/lnet_routes.conf -@BUILD_DLC_TRUE@ExecStart=@sbindir@/lnetctl lnet configure -@BUILD_DLC_TRUE@ExecStart=@sbindir@/lnetctl import @sysconfdir@/lnet.conf +ExecStart=@sbindir@/lnetctl lnet configure +ExecStart=@sbindir@/lnetctl import @sysconfdir@/lnet.conf ExecStop=@sbindir@/lustre_rmmod ptlrpc -@BUILD_DLC_FALSE@ExecStop=@sbindir@/lctl network down -@BUILD_DLC_TRUE@ExecStop=@sbindir@/lnetctl lnet unconfigure +ExecStop=@sbindir@/lnetctl lnet unconfigure ExecStop=@sbindir@/lustre_rmmod libcfs ldiskfs [Install]