Whamcloud - gitweb
LU-9897 utils: make liblnetconfig a hard requirment 04/30204/3
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 22 Nov 2017 02:43:14 +0000 (21:43 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 1 Dec 2017 05:16:51 +0000 (05:16 +0000)
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 <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/30204
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Sonia Sharma <sonia.sharma@intel.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
config/lustre-build.m4
debian/lustre-dev.install
lnet/autoconf/lustre-lnet.m4
lnet/utils/Makefile.am
lnet/utils/lst.c
lustre.spec.in
lustre/conf/Makefile.am
lustre/scripts/Makefile.am
lustre/scripts/lnet.in
lustre/scripts/systemd/Makefile.am
lustre/scripts/systemd/lnet.service.in

index 1779ca4..b41ce46 100644 (file)
@@ -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
index 851d6af..bce2c9d 100644 (file)
@@ -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
index 561833a..be38840 100644 (file)
@@ -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
 
 #
index 091f9da..14b93fa 100644 (file)
 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
index c47fd5d..4d83d26 100644 (file)
@@ -51,9 +51,7 @@
 #include <linux/lnet/lnetctl.h>
 #include <linux/lnet/lnetst.h>
 #include <linux/lnet/nidstr.h>
-#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;
 
index 65e9ad4..7c94d70 100644 (file)
@@ -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
index 562a352..db2bf47 100644 (file)
@@ -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
index 25b9995..a4ed9f7 100644 (file)
@@ -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 $@
index afd7519..215b550 100644 (file)
@@ -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"
index cfda573..340f6f1 100644 (file)
@@ -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' $< > $@
index c5bc875..eb35753 100644 (file)
@@ -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]