diff options
author | Vlad Glagolev | 2008-10-29 21:15:32 +0300 |
---|---|---|
committer | Vlad Glagolev | 2008-10-29 21:15:32 +0300 |
commit | aab473e5afc16107c9a6cc5513bd86d99141985d (patch) | |
tree | da36d1036577e13b9c7b65409d2f33f793d4523e /audio-drivers/alsa-utils | |
parent | 0f56489bf39e077f99422846fb314a64a9583326 (diff) |
alsa-utils: added utils-related init script
Diffstat (limited to 'audio-drivers/alsa-utils')
-rwxr-xr-x | audio-drivers/alsa-utils/DETAILS | 2 | ||||
-rw-r--r-- | audio-drivers/alsa-utils/HISTORY | 3 | ||||
-rwxr-xr-x | audio-drivers/alsa-utils/PREPARE | 8 | ||||
-rwxr-xr-x | audio-drivers/alsa-utils/init.d/alsa-state | 43 |
4 files changed, 51 insertions, 5 deletions
diff --git a/audio-drivers/alsa-utils/DETAILS b/audio-drivers/alsa-utils/DETAILS index 692a358405..9644bbd8d6 100755 --- a/audio-drivers/alsa-utils/DETAILS +++ b/audio-drivers/alsa-utils/DETAILS @@ -1,6 +1,6 @@ SPELL=alsa-utils if [[ $ALSA_UTILS_GIT == y ]]; then - if [[ $ALSA_UTILS_GIT_AUTOUPDATE == y ]]; then + if [[ $ALSA_UTILS_GIT_AUTOUPDATE == y ]]; then VERSION=$(date +%Y%m%d) else VERSION=git diff --git a/audio-drivers/alsa-utils/HISTORY b/audio-drivers/alsa-utils/HISTORY index 79c4cdd8e5..d71c04be88 100644 --- a/audio-drivers/alsa-utils/HISTORY +++ b/audio-drivers/alsa-utils/HISTORY @@ -1,3 +1,6 @@ +2008-10-29 Vlad Glagolev <stealth@sourcemage.org> + * init.d/alsa-state: added, utils-related init stuff + 2008-10-13 Pol Vinogradov <vin.public@gmail.com> * DETAILS: updated to 1.0.18rc3 * DEPENDS: needs xmlto for manual pages diff --git a/audio-drivers/alsa-utils/PREPARE b/audio-drivers/alsa-utils/PREPARE index 6c3930bbef..25a1d0265d 100755 --- a/audio-drivers/alsa-utils/PREPARE +++ b/audio-drivers/alsa-utils/PREPARE @@ -1,6 +1,6 @@ -config_query ALSA_UTILS_GIT "Build latest version from development tree?" n && +config_query ALSA_UTILS_GIT "Build latest version from development tree?" n && -if [[ $ALSA_UTILS_GIT == y ]]; then - config_query ALSA_UTILS_GIT_AUTOUPDATE \ - "Automatically update on every system update?" n +if [[ $ALSA_UTILS_GIT == y ]]; then + config_query ALSA_UTILS_GIT_AUTOUPDATE \ + "Automatically update on every system update?" n fi diff --git a/audio-drivers/alsa-utils/init.d/alsa-state b/audio-drivers/alsa-utils/init.d/alsa-state new file mode 100755 index 0000000000..8e4757bdbf --- /dev/null +++ b/audio-drivers/alsa-utils/init.d/alsa-state @@ -0,0 +1,43 @@ +#!/bin/bash + +. /etc/sysconfig/alsa + +PROGRAM=/bin/false +RUNLEVEL=3 +NEEDS="+remote_fs" + +declare -r ASOUNDCFG=/etc/asound.state + +. /etc/init.d/smgl_init + +start() { + [[ "$START_ALSA" == no ]] && exit 0 + + # + # restore driver settings + # + if [[ -d /proc/asound ]]; then + if ! [[ -r "$ASOUNDCFG" ]]; then + echo "No mixer config in $ASOUNDCFG, you have to unmute your card!" + else + echo "Restoring settings..." + sleep 5 + /usr/sbin/alsactl -F -f $ASOUNDCFG restore + evaluate_retval + fi + fi +} + +stop() { + # + # store driver settings + # + echo "Saving settings..." + /usr/sbin/alsactl -f $ASOUNDCFG store + evaluate_retval + + # + # mute master to avoid clicks at unload + # + /usr/bin/amixer set Master mute >/dev/null 2>&1 +} |