systemd: install timesync service if selected
authorEric Le Bihan <eric.le.bihan.dev@free.fr>
Fri, 18 Jul 2014 13:02:01 +0000 (15:02 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 18 Jul 2014 19:28:11 +0000 (21:28 +0200)
If support for systemd-timesyncd is selected, install the associated
service.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/systemd/systemd.mk

index 2564d78a5bb2ee85bfedc13ccff42b4a6e09953c..e781b3055627d61957767a25f4ac0d9a6146a2e6 100644 (file)
@@ -112,6 +112,11 @@ endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
 SYSTEMD_CONF_OPT += --enable-timesyncd
+define SYSTEMD_INSTALL_SERVICE_TIMESYNC
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
+       ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
+               $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
+endef
 else
 SYSTEMD_CONF_OPT += --disable-timesyncd
 endif
@@ -167,6 +172,7 @@ endef
 define SYSTEMD_INSTALL_INIT_SYSTEMD
        $(SYSTEMD_INSTALL_SERVICE_TTY)
        $(SYSTEMD_INSTALL_SERVICE_NETWORK)
+       $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
 endef
 
 $(eval $(autotools-package))