[Buildroot] [PATCH v3 13/13] package/alsa-utils: add a WantedBy section to the unit

Jérémy Rosen jeremy.rosen at smile.fr
Sat Dec 7 18:00:49 UTC 2019


This allows the user to enable/disable manually the unit.
It is enabled by default

Signed-off-by: Jérémy Rosen <jeremy.rosen at smile.fr>
---
 package/alsa-utils/alsa-utils.mk | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/package/alsa-utils/alsa-utils.mk b/package/alsa-utils/alsa-utils.mk
index 47f07bf7a2..d06af231bf 100644
--- a/package/alsa-utils/alsa-utils.mk
+++ b/package/alsa-utils/alsa-utils.mk
@@ -90,11 +90,10 @@ define ALSA_UTILS_INSTALL_INIT_SYSTEMD
 		$(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
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d;\
+	printf '[Install]\nWantedBy=multi-user.target\n' > $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d/buildroot-enable.conf;\
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d;\
+	printf '[Install]\nWantedBy=multi-user.target\n' > $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d/buildroot-enable.conf;
 endef
 endif
 
-- 
2.24.0



More information about the buildroot mailing list