package/network-manager: Enable service under systemd
authorNathaniel Roach <nroach44@gmail.com>
Tue, 2 Dec 2014 08:53:39 +0000 (16:53 +0800)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 7 Dec 2014 22:14:55 +0000 (23:14 +0100)
Previously NetworkManager had to be enabled and started on the
first boot manually or by a script.

Add install define with the commands to setup the required
service files for automatic start.

Signed-off-by: Nathaniel Roach <nroach44@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/network-manager/network-manager.mk

index 9770cae94a6b706f2a0e42767e63a6cf5864e237..3f6512c299837c82f7b9d6e1402f25e7cf2b0adb 100644 (file)
@@ -72,4 +72,17 @@ define NETWORK_MANAGER_INSTALL_INIT_SYSV
        $(INSTALL) -m 0755 -D package/network-manager/S45network-manager $(TARGET_DIR)/etc/init.d/S45network-manager
 endef
 
+define NETWORK_MANAGER_INSTALL_INIT_SYSTEMD
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+
+       ln -sf /usr/lib/systemd/system/NetworkManager.service \
+               $(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
+
+       ln -sf /usr/lib/systemd/system/NetworkManager.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/NetworkManager.service
+
+       ln -sf /usr/lib/systemd/system/NetworkManager-dispatcher.service \
+               $(TARGET_DIR)/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
+endef
+
 $(eval $(autotools-package))