Blob Blame History Raw
diff -Nrup hwloc-1.11.2.orig/config/hwloc_internal.m4 hwloc-1.11.2/config/hwloc_internal.m4
--- hwloc-1.11.2.orig/config/hwloc_internal.m4	2015-06-02 05:12:40.000000000 -0400
+++ hwloc-1.11.2/config/hwloc_internal.m4	2016-06-06 13:45:07.591491542 -0400
@@ -307,6 +307,8 @@ EOF
     LIBS="$hwloc_old_LIBS"
     unset hwloc_old_LIBS
 
+    AC_PATH_TOOL(RMPATH, rm)
+
     _HWLOC_CHECK_DIFF_U
     _HWLOC_CHECK_DIFF_W
 
@@ -394,7 +396,8 @@ int foo(void) {
         hwloc_config_prefix[utils/hwloc/test-hwloc-distrib.sh]
         hwloc_config_prefix[utils/hwloc/test-hwloc-info.sh]
         hwloc_config_prefix[utils/hwloc/test-fake-plugin.sh]
-        hwloc_config_prefix[utils/lstopo/test-hwloc-ls.sh])
+        hwloc_config_prefix[utils/lstopo/test-hwloc-ls.sh]
+        hwloc_config_prefix[contrib/systemd/Makefile])
 
     AC_CONFIG_COMMANDS([chmoding-scripts], [chmod +x ]hwloc_config_prefix[tests/linux/test-topology.sh ]hwloc_config_prefix[tests/xml/test-topology.sh ]hwloc_config_prefix[tests/linux/gather/test-gather-topology.sh ]hwloc_config_prefix[tests/wrapper.sh ]hwloc_config_prefix[utils/hwloc/hwloc-assembler-remote ]hwloc_config_prefix[utils/hwloc/hwloc-compress-dir ]hwloc_config_prefix[utils/hwloc/hwloc-gather-topology ]hwloc_config_prefix[utils/hwloc/test-hwloc-annotate.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-assembler.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-calc.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-compress-dir.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-diffpatch.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-distances.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-distrib.sh ]hwloc_config_prefix[utils/hwloc/test-hwloc-info.sh ]hwloc_config_prefix[utils/hwloc/test-fake-plugin.sh ]hwloc_config_prefix[utils/lstopo/test-hwloc-ls.sh])
 
diff -Nrup hwloc-1.11.2.orig/contrib/systemd/hwloc-dump-hwdata.service.in hwloc-1.11.2/contrib/systemd/hwloc-dump-hwdata.service.in
--- hwloc-1.11.2.orig/contrib/systemd/hwloc-dump-hwdata.service.in	1969-12-31 19:00:00.000000000 -0500
+++ hwloc-1.11.2/contrib/systemd/hwloc-dump-hwdata.service.in	2016-06-06 13:45:07.593491515 -0400
@@ -0,0 +1,22 @@
+#
+# Copyright © 2015-2016 Intel, Inc.  All rights reserved.
+# Copyright © 2016 Inria.  All rights reserved.
+# See COPYING in top-level directory.
+#
+# #RUNSTATEDIR#/hwloc was specified at configure time.
+# It may be changed by passing configure options such as --runstatedir,
+# --localstatedir or --prefix.
+# It may also be manually changed before installing this file in systemd directories.
+#
+
+[Unit]
+Description=Dump hardware topology and locality information to #RUNSTATEDIR#/hwloc
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=#SBINDIR#/hwloc-dump-hwdata -o #RUNSTATEDIR#/hwloc
+ExecStop=#RMPATH# -rf #RUNSTATEDIR#/hwloc
+
+[Install]
+WantedBy=multi-user.target
diff -Nrup hwloc-1.11.2.orig/contrib/systemd/Makefile.am hwloc-1.11.2/contrib/systemd/Makefile.am
--- hwloc-1.11.2.orig/contrib/systemd/Makefile.am	1969-12-31 19:00:00.000000000 -0500
+++ hwloc-1.11.2/contrib/systemd/Makefile.am	2016-06-06 13:45:07.592491525 -0400
@@ -0,0 +1,22 @@
+# Copyright © 2016 Inria.  All rights reserved.
+# See COPYING in top-level directory.
+
+# We can't use autoconf because we don't want $sbindir to be replaced with ${exec_prefix}/sbin
+# Also don't install since , let the packagers do it.
+
+EXTRA_DIST = hwloc-dump-hwdata.service.in
+
+if HWLOC_HAVE_LINUX
+nodist_pkgdata_DATA = hwloc-dump-hwdata.service
+# depend on Makefile in case we rerun configure with different directory arguments
+hwloc-dump-hwdata.service: hwloc-dump-hwdata.service.in Makefile
+	@echo Creating $@...
+	@ $(SED) \
+	  -e 's@#SBINDIR#@'$(sbindir)'@g' \
+	  -e 's@#RUNSTATEDIR#@'$(HWLOC_runstatedir)'@g' \
+	  -e 's@#RMPATH#@'$(RMPATH)'@g' \
+	  > $@ < $<
+
+distclean-local:
+	rm -f hwloc-dump-hwdata.service
+endif
diff -Nrup hwloc-1.11.2.orig/Makefile.am hwloc-1.11.2/Makefile.am
--- hwloc-1.11.2.orig/Makefile.am	2015-06-02 05:12:40.000000000 -0400
+++ hwloc-1.11.2/Makefile.am	2016-06-06 13:45:07.588491592 -0400
@@ -1,4 +1,4 @@
-# Copyright © 2009-2015 Inria.  All rights reserved.
+# Copyright © 2009-2016 Inria.  All rights reserved.
 # Copyright © 2009      Université Bordeaux
 # Copyright © 2009-2014 Cisco Systems, Inc.  All rights reserved.
 # See COPYING in top-level directory.
@@ -9,7 +9,7 @@ ACLOCAL_AMFLAGS = -I ./config
 
 SUBDIRS = src include
 if HWLOC_BUILD_STANDALONE
-SUBDIRS += tests utils
+SUBDIRS += tests utils contrib/systemd
 # We need doc/ if HWLOC_BUILD_DOXYGEN, or during make install if HWLOC_INSTALL_DOXYGEN.
 # There's no INSTALL_SUBDIRS, so always enter doc/ and check HWLOC_BUILD/INSTALL_DOXYGEN there
 SUBDIRS += doc
diff -Nrup hwloc-1.11.2.orig/NEWS hwloc-1.11.2/NEWS
--- hwloc-1.11.2.orig/NEWS	2015-12-17 05:05:59.000000000 -0500
+++ hwloc-1.11.2/NEWS	2016-06-06 13:45:54.947068832 -0400
@@ -57,6 +57,9 @@ Version 1.11.2
 * Debug messages may be disabled at runtime by passing HWLOC_DEBUG_VERBOSE=0
   in the environment when --enable-debug was passed to configure.
 * Add a FAQ entry "What are these Group objects in my topology?".
+* Add systemd service template contrib/systemd/hwloc-dump-hwdata.service
+  for launching hwloc-dump-hwdata at boot on Linux.
+  Thanks to Grzegorz Andrejczuk.
 
 
 Version 1.11.1