package/alsa-utils: install systemd service files
authorPeter Seiderer <ps.report@gmx.net>
Tue, 30 Oct 2018 22:41:39 +0000 (23:41 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 1 Nov 2018 13:49:23 +0000 (14:49 +0100)
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/alsa-utils/alsa-utils.mk

index e9a45c675f9416df440460366890b0bd7330b7d8..0c65082a1489b8f87fe9ec839f1a556fa03ed3a1 100644 (file)
@@ -82,4 +82,18 @@ define ALSA_UTILS_INSTALL_TARGET_CMDS
        fi
 endef
 
+ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSACTL),y)
+define ALSA_UTILS_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 0644 $(@D)/alsactl/alsa-restore.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service
+       $(INSTALL) -D -m 0644 $(@D)/alsactl/alsa-state.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/sound.target.wants
+       ln -sf ../../../../lib/systemd/system/alsa-restore.service \
+               $(TARGET_DIR)/etc/systemd/system/sound.target.wants/alsa-restore.service
+       ln -sf ../../../../lib/systemd/system/alsa-state.service \
+               $(TARGET_DIR)/etc/systemd/system/sound.target.wants/alsa-state.service
+endef
+endif
+
 $(eval $(autotools-package))