mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 14:06:31 +01:00
alsactl: Move asound.state location to /var/lib/alsa
.... and add configure switch for it. /etc might be on a read-only partition which is not suitable for dynamic data such as the mixer settings. Hence move the location of asound.state to /var/lib. This is based on a patch from Ubuntu/Debian which hardcoded the pah in /var/lib. Signed-off-by: Lennart Poettering <mznyfn@0pointer.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
de7c3eff0e
commit
81f015f5ab
6 changed files with 18 additions and 5 deletions
|
@ -38,5 +38,8 @@ dist-hook:
|
|||
$(TAR) --create --verbose --file=- $(distdir) | bzip2 -c -9 > $(distdir).tar.bz2 ; \
|
||||
fi
|
||||
|
||||
install-data-hook:
|
||||
$(MKDIR_P) -m 0755 $(DESTDIR)$(ASOUND_STATE_DIR)
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
|
||||
|
|
|
@ -956,8 +956,9 @@ If you have a big amplifier, lower your volumes or say no.
|
|||
aplay -N $TESTSOUND
|
||||
fi
|
||||
fi
|
||||
if [ ! -r /etc/asound.state ]; then
|
||||
xecho "Saving the mixer setup used for this in /etc/asound.state."
|
||||
mkdir -p -m 0755 @ASOUND_STATE_DIR@
|
||||
if [ ! -r @ASOUND_STATE_DIR@/asound.state ]; then
|
||||
xecho "Saving the mixer setup used for this in @ASOUND_STATE_DIR@/asound.state."
|
||||
$sbindir/alsactl store
|
||||
fi
|
||||
clear
|
||||
|
|
|
@ -8,6 +8,7 @@ endif
|
|||
EXTRA_DIST=alsactl.1 alsactl_init.xml
|
||||
|
||||
alsactl_SOURCES=alsactl.c state.c utils.c init_parse.c
|
||||
alsactl_CFLAGS=$(AM_CFLAGS) -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\"
|
||||
noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c
|
||||
|
||||
udevrulesdir=/lib/udev/rules.d
|
||||
|
|
|
@ -43,7 +43,7 @@ Print alsactl version number.
|
|||
|
||||
.TP
|
||||
\fI\-f, \-\-file\fP
|
||||
Select the configuration file to use. The default is /etc/asound.state.
|
||||
Select the configuration file to use. The default is /var/lib/alsa/asound.state.
|
||||
|
||||
.TP
|
||||
\fI\-F, \-\-force\fP
|
||||
|
@ -90,7 +90,7 @@ The configuration file for init. By default, PREFIX/share/alsa/init/00main
|
|||
is used.
|
||||
|
||||
.SH FILES
|
||||
\fI/etc/asound.state\fP (or whatever file you specify with the
|
||||
\fI/var/lib/alsa/asound.state\fP (or whatever file you specify with the
|
||||
\fB\-f\fP flag) is used to store current settings for your
|
||||
soundcards. The settings include all the usual soundcard mixer
|
||||
settings. More importantly, alsactl is
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include <alsa/asoundlib.h>
|
||||
#include "alsactl.h"
|
||||
|
||||
#define SYS_ASOUNDRC "/etc/asound.state"
|
||||
#ifndef SYS_ASOUNDRC
|
||||
#define SYS_ASOUNDRC "/var/lib/alsa/asound.state"
|
||||
#endif
|
||||
|
||||
int debugflag = 0;
|
||||
int force_restore = 1;
|
||||
|
|
|
@ -289,6 +289,12 @@ if test "x$with_systemdsystemunitdir" != xno; then
|
|||
fi
|
||||
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
|
||||
AC_ARG_WITH(ASOUND_STATE_DIR,
|
||||
AS_HELP_STRING([--with-asound-state-dir=DIR], [Directory to place asound.state file in]),
|
||||
[ASOUND_STATE_DIR="$withval"],
|
||||
[ASOUND_STATE_DIR="/var/lib/alsa"])
|
||||
AC_SUBST(ASOUND_STATE_DIR)
|
||||
|
||||
AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \
|
||||
alsamixer/Makefile amidi/Makefile amixer/Makefile \
|
||||
m4/Makefile po/Makefile.in \
|
||||
|
|
Loading…
Reference in a new issue