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:
Jaroslav Kysela 2013-04-10 10:23:16 +02:00
parent 611249ae26
commit 8b34bf25c0
6 changed files with 64 additions and 5 deletions

2
.gitignore vendored
View file

@ -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

View file

@ -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"

View file

@ -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

View 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

View file

@ -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

View 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