From 5a16bc264c32237e38a844d55e7a1820a31b8440 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Fri, 28 Nov 2014 15:59:59 +0100 Subject: [PATCH] build-sys: configure the list of system users, files and directories Choose which system users defined in sysusers.d/systemd.conf and files or directories in tmpfiles.d/systemd.conf, should be provided depending on comile-time configuration. --- Makefile.am | 4 ++++ configure.ac | 2 ++ sysusers.d/.gitignore | 1 + sysusers.d/{systemd.conf => systemd.conf.m4} | 8 ++++++++ tmpfiles.d/.gitignore | 3 ++- tmpfiles.d/{systemd.conf => systemd.conf.m4} | 2 ++ 6 files changed, 19 insertions(+), 1 deletion(-) rename sysusers.d/{systemd.conf => systemd.conf.m4} (77%) rename tmpfiles.d/{systemd.conf => systemd.conf.m4} (96%) diff --git a/Makefile.am b/Makefile.am index cd81a7775..38d320fc3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5856,6 +5856,10 @@ src/%: src/%.m4 $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ +sysusers.d/%: sysusers.d/%.m4 + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ + tmpfiles.d/%: tmpfiles.d/%.m4 $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ diff --git a/configure.ac b/configure.ac index 928ac2e99..356a3c3d6 100644 --- a/configure.ac +++ b/configure.ac @@ -984,6 +984,7 @@ have_timesyncd=no AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon])) if test "x$enable_timesyncd" != "xno"; then have_timesyncd=yes + M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD" fi AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"]) @@ -1073,6 +1074,7 @@ AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]) AS_IF([test "x$enable_networkd" != "xno"], [ AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled]) have_networkd=yes + M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD" ]) AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"]) diff --git a/sysusers.d/.gitignore b/sysusers.d/.gitignore index f7957a988..bb3aaaf82 100644 --- a/sysusers.d/.gitignore +++ b/sysusers.d/.gitignore @@ -1 +1,2 @@ /basic.conf +/systemd.conf diff --git a/sysusers.d/systemd.conf b/sysusers.d/systemd.conf.m4 similarity index 77% rename from sysusers.d/systemd.conf rename to sysusers.d/systemd.conf.m4 index 95437b854..23175de1f 100644 --- a/sysusers.d/systemd.conf +++ b/sysusers.d/systemd.conf.m4 @@ -6,7 +6,15 @@ # (at your option) any later version. g systemd-journal - - +m4_ifdef(`ENABLE_KDBUS', u systemd-bus-proxy - "systemd Bus Proxy" +)m4_dnl +m4_ifdef(`ENABLE_NETWORKD', u systemd-network - "systemd Network Management" +)m4_dnl +m4_ifdef(`ENABLE_RESOLVED', u systemd-resolve - "systemd Resolver" +)m4_dnl +m4_ifdef(`ENABLE_TIMESYNCD', u systemd-timesync - "systemd Time Synchronization" +)m4_dnl diff --git a/tmpfiles.d/.gitignore b/tmpfiles.d/.gitignore index eb323154f..4f0ecaa9c 100644 --- a/tmpfiles.d/.gitignore +++ b/tmpfiles.d/.gitignore @@ -1 +1,2 @@ -etc.conf +/etc.conf +/systemd.conf diff --git a/tmpfiles.d/systemd.conf b/tmpfiles.d/systemd.conf.m4 similarity index 96% rename from tmpfiles.d/systemd.conf rename to tmpfiles.d/systemd.conf.m4 index 9ca5ad2bc..ad05f4333 100644 --- a/tmpfiles.d/systemd.conf +++ b/tmpfiles.d/systemd.conf.m4 @@ -16,9 +16,11 @@ d /run/systemd/sessions 0755 root root - d /run/systemd/users 0755 root root - d /run/systemd/machines 0755 root root - d /run/systemd/shutdown 0755 root root - +m4_ifdef(`ENABLE_NETWORKD', d /run/systemd/netif 0755 systemd-network systemd-network - d /run/systemd/netif/links 0755 systemd-network systemd-network - d /run/systemd/netif/leases 0755 systemd-network systemd-network - +)m4_dnl d /run/log 0755 root root - -- 2.30.2