aboutsummaryrefslogtreecommitdiff
path: root/package/dhcp/dhcp.mk
diff options
context:
space:
mode:
authorGravatar Nathaniel Roach <nroach44@gmail.com>2014-12-01 22:18:16 +0800
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-12-07 21:55:08 +0100
commitbc1ab9015e16cae8235f330bfad9195a4e2d3eb9 (patch)
treec0f3a02034c2ac4734ba7580136e5ea95f126b03 /package/dhcp/dhcp.mk
parent5be88854d009dbed95097f7965994b7eb6c95955 (diff)
downloadbuildroot-bc1ab9015e16cae8235f330bfad9195a4e2d3eb9.tar.gz
buildroot-bc1ab9015e16cae8235f330bfad9195a4e2d3eb9.tar.bz2
package/dhcp: Only install the relevant unit file
Previous to this patch, if BR2_PACKAGE_DHCP_CLIENT was selected, dhcpd.service was installed to the target on systemd systems. On the resultant system, this would mean that systemctl would show an error starting dhcpd.service, as the requisite files do not exist. This does not cause issue on sysvinit systems as the init scripts silently error when the files aren't found. Fix this by adding a conditional check to the install define. Signed-off-by: Nathaniel Roach <nroach44@gmail.com> Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/dhcp/dhcp.mk')
-rw-r--r--package/dhcp/dhcp.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/package/dhcp/dhcp.mk b/package/dhcp/dhcp.mk
index 1eb6b32549..2aa690f05c 100644
--- a/package/dhcp/dhcp.mk
+++ b/package/dhcp/dhcp.mk
@@ -75,6 +75,7 @@ define DHCP_INSTALL_INIT_SYSV
$(TARGET_DIR)/etc/init.d/S80dhcp-relay
endef
+ifeq ($(BR2_PACKAGE_DHCP_SERVER),y)
define DHCP_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/dhcp/dhcpd.service \
$(TARGET_DIR)/lib/systemd/system/dhcpd.service
@@ -89,6 +90,7 @@ define DHCP_INSTALL_INIT_SYSTEMD
echo "f /var/lib/dhcp/dhcpd.leases - - - - -" >> \
$(TARGET_DIR)/usr/lib/tmpfiles.d/dhcpd.conf
endef
+endif
define DHCP_INSTALL_TARGET_CMDS
$(DHCP_INSTALL_RELAY)