mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 16:55:42 +01:00
alsactl: revert back old systemd static units with the /etc/alsa/state-daemon.conf switch
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
611249ae26
commit
8b34bf25c0
6 changed files with 64 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -26,6 +26,8 @@ ABOUT-NLS
|
|||
alsactl/alsactl
|
||||
alsactl/alsactl_init.7
|
||||
alsactl/alsa-state.service
|
||||
alsactl/alsa-restore.service
|
||||
alsactl/alsa-store.service
|
||||
alsaconf/alsaconf
|
||||
alsamixer/alsamixer
|
||||
amidi/amidi
|
||||
|
|
|
@ -1,2 +1,8 @@
|
|||
ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS=="card*", \
|
||||
RUN+="@sbindir@/alsactl nrestore $attr{number}"
|
||||
ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", GOTO="alsa_restore_go"
|
||||
GOTO="alsa_restore_end"
|
||||
|
||||
LABEL="alsa_restore_go"
|
||||
TEST!="/etc/alsa/state-daemon.conf", RUN+="@sbindir@/alsactl restore $attr{number}"
|
||||
TEST=="/etc/alsa/state-daemon.conf", RUN+="@sbindir@/alsactl nrestore $attr{number}"
|
||||
|
||||
LABEL="alsa_restore_end"
|
||||
|
|
|
@ -17,15 +17,18 @@ dist_udevrules_DATA = \
|
|||
if HAVE_SYSTEMD
|
||||
|
||||
systemdsystemunit_DATA = \
|
||||
alsa-state.service
|
||||
alsa-state.service \
|
||||
alsa-restore.service \
|
||||
alsa-store.service
|
||||
|
||||
install-data-hook:
|
||||
$(MKDIR_P) -m 0755 \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/basic.target.wants \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants
|
||||
( cd $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants && \
|
||||
rm -f alsa-restore.service && \
|
||||
$(LN_S) ../alsa-restore.service alsa-restore.service )
|
||||
rm -f alsa-state.service alsa-restore.service && \
|
||||
$(LN_S) ../alsa-state.service alsa-state.service && \
|
||||
$(LN_S) ../alsa-restore.service alsa-restore.service)
|
||||
( cd $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants && \
|
||||
rm -f alsa-store.service && \
|
||||
$(LN_S) ../alsa-store.service alsa-store.service )
|
||||
|
@ -38,15 +41,25 @@ edit = \
|
|||
alsa-state.service: alsa-state.service.in
|
||||
$(edit)
|
||||
|
||||
alsa-restore.service: alsa-restore.service.in
|
||||
$(edit)
|
||||
|
||||
alsa-store.service: alsa-store.service.in
|
||||
$(edit)
|
||||
|
||||
90-alsa-restore.rules: 90-alsa-restore.rules.in
|
||||
$(edit)
|
||||
|
||||
EXTRA_DIST += \
|
||||
alsa-state.service.in \
|
||||
alsa-restore.service.in \
|
||||
alsa-store.service.in \
|
||||
90-alsa-restore.rules.in
|
||||
|
||||
CLEANFILES = \
|
||||
alsa-state.service \
|
||||
alsa-restore.service \
|
||||
alsa-store.service \
|
||||
90-alsa-restore.rules
|
||||
|
||||
%.7: %.xml
|
||||
|
|
17
alsactl/alsa-restore.service.in
Normal file
17
alsactl/alsa-restore.service.in
Normal file
|
@ -0,0 +1,17 @@
|
|||
#
|
||||
# Note that two different ALSA card state management schemes exist and they
|
||||
# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Restore Sound Card State
|
||||
ConditionPathExists=!/etc/alsa/state-daemon.conf
|
||||
DefaultDependencies=no
|
||||
After=alsa-state.service
|
||||
Before=shutdown.target
|
||||
Conflicts=shutdown.target
|
||||
|
||||
[Service]
|
||||
Type=oneshop
|
||||
ExecStart=-@sbindir@/alsactl restore
|
||||
StandardOutput=syslog
|
|
@ -1,5 +1,11 @@
|
|||
#
|
||||
# Note that two different ALSA card state management schemes exist and they
|
||||
# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Manage Sound Card State (restore and store)
|
||||
ConditionPathExists=/etc/alsa/state-daemon.conf
|
||||
DefaultDependencies=no
|
||||
After=sysinit.target
|
||||
Before=shutdown.target
|
||||
|
|
15
alsactl/alsa-store.service.in
Normal file
15
alsactl/alsa-store.service.in
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
# Note that two different ALSA card state management schemes exist and they
|
||||
# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Store Sound Card State
|
||||
ConditionPathExists=!/etc/alsa/state-daemon.conf
|
||||
DefaultDependencies=no
|
||||
Before=shutdown.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=@sbindir@/alsactl store
|
||||
StandardOutput=syslog
|
Loading…
Reference in a new issue