diff mbox series

[v3,2/2] Add Kconfig option for new systemd files

Message ID 20191012183928.27004-3-adrian.freihofer@siemens.com
State Changes Requested
Headers show
Series systemd generic startup | expand

Commit Message

Freihofer, Adrian Oct. 12, 2019, 6:39 p.m. UTC
This adds an option for the new systemd service files installation
to menuconfig.

The default configuration for the new SYSTEMD_SYSTEM_UNITDIR setting
is an empty string. This allows a distro buildsystem to provide the
path for systemd system unitdir as an environment variable. An empty
string implies to not install the default systemd configuration files.
The default behavior of make install does not change.
---
 Kconfig        | 12 ++++++++++++
 Makefile.flags |  3 +++
 2 files changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/Kconfig b/Kconfig
index 70907c9..882ee1e 100644
--- a/Kconfig
+++ b/Kconfig
@@ -105,6 +105,18 @@  config SYSTEMD
 	  Enable support for systemd's start-up completion
 	  notification and socket-based activation features.
 
+config SYSTEMD_SYSTEM_UNITDIR
+	string "installation path for systemd unit files"
+	depends on SYSTEMD
+	default ""
+	help
+	  Defines the path where systemd service and socket files get
+	  installed to. By default (empty string) the systemd files
+	  are installed to the path provided by the SYSTEMD_SYSTEM_UNITDIR
+	  environment variable or are not installed if this variable is
+	  undefined. To install a set of service files without defining
+	  environment variables, you may set this to /lib/systemd/system.
+
 config SCRIPTS
 	bool "enable pre and postinstall scripts"
 	default y
diff --git a/Makefile.flags b/Makefile.flags
index b880d32..0edd48c 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -180,6 +180,9 @@  endif
 
 ifeq ($(CONFIG_SYSTEMD),y)
 LDLIBS += systemd
+ifneq ($(CONFIG_SYSTEMD_SYSTEM_UNITDIR),)
+export SYSTEMD_SYSTEM_UNITDIR=$(CONFIG_SYSTEMD_SYSTEM_UNITDIR)
+endif
 endif
 
 ifeq ($(CONFIG_BOOTLOADER_EBG),y)