summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-07 11:42:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-11 23:18:15 +0100
commit04c73333e4b539de96f096ca2954b2313175edc4 (patch)
treef738c1de5aa43bc1ea7d5e5d7c8fb8c61482a8ba /meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
parent9f6c4edf40963d1f3fb9f7e2d2b7a866aa1afe57 (diff)
downloadopenembedded-core-04c73333e4b539de96f096ca2954b2313175edc4.tar.gz
openembedded-core-04c73333e4b539de96f096ca2954b2313175edc4.tar.bz2
openembedded-core-04c73333e4b539de96f096ca2954b2313175edc4.zip
alsa-state: Rename init script
Having a SRC_URI called ${PN} is asking for trouble. When extending FILESPATH, alsa-state can be treated as a directory and copied over the contents of ${WORKDIR} which is invariably not what the user wants. Avoid this by renaming the SRC_URI to something else and only call it alsa-state at install time. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init')
-rwxr-xr-xmeta/recipes-bsp/alsa-state/alsa-state/alsa-state-init29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
new file mode 100755
index 0000000000..9850791497
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
@@ -0,0 +1,29 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: alsa-state
+# Date: 20070308 (YMD)
+
+
+asound_restore(){
+ echo "ALSA: Restoring mixer settings..."
+ if test -x /usr/sbin/alsactl -a -e #STATEDIR#/asound.state
+ then
+ /usr/sbin/alsactl -f #STATEDIR#/asound.state restore &
+ fi
+}
+
+asound_store(){
+ echo "ALSA: Storing mixer settings..."
+ if test -x /usr/sbin/alsactl
+ then
+ /usr/sbin/alsactl -f #STATEDIR#/asound.state store
+ fi
+}
+
+case "$1" in
+start) asound_restore ;;
+stop) asound_store ;;
+esac