summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2012-01-10 08:32:08 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-17 14:53:24 +0000
commit432c6cff0fd57e1f5e22f11615b4e6ccfec014cc (patch)
tree1ebf01ed4d1fb88e9e8ade3b8298782be9ceae13
parentc86797abdfc6db4b22710cca7924396c16eb6fc0 (diff)
downloadpoky-432c6cff0fd57e1f5e22f11615b4e6ccfec014cc.tar.gz
alsa-state: move state files to localstatedir
alsactl creates the state files in /var/lib/alsa by default so switch alsa-state to use files in that location. Further, update the alsa-state init script to have the location of the state files sed'ed into the script at do_install time (so as to remove hard coding of directory paths). (From OE-Core rev: 896924c72e7b37c18819229e8160c34cdf4465c8) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-bsp/alsa-state/alsa-state.bb8
-rwxr-xr-xmeta/recipes-bsp/alsa-state/alsa-state/alsa-state6
2 files changed, 8 insertions, 6 deletions
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
index ecfa97530f..bc17b25b3e 100644
--- a/meta/recipes-bsp/alsa-state/alsa-state.bb
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -26,11 +26,13 @@ INITSCRIPT_NAME = "alsa-state"
26INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ." 26INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
27 27
28do_install() { 28do_install() {
29 sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state
29 install -d ${D}${sysconfdir}/init.d 30 install -d ${D}${sysconfdir}/init.d
30 install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d 31 install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
31 32
33 install -d ${D}/${localstatedir}/lib/alsa
32 install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir} 34 install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
33 install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir} 35 install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
34} 36}
35 37
36PACKAGES += "alsa-states" 38PACKAGES += "alsa-states"
@@ -40,14 +42,14 @@ RRECOMMENDS_alsa-state = "alsa-states"
40FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf" 42FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
41CONFFILES_${PN} = "${sysconfdir}/asound.conf" 43CONFFILES_${PN} = "${sysconfdir}/asound.conf"
42 44
43FILES_alsa-states = "${sysconfdir}/*.state" 45FILES_alsa-states = "${localstatedir}/lib/alsa/*.state"
44 46
45pkg_postinst_${PN}() { 47pkg_postinst_${PN}() {
46 if test -z "$D" 48 if test -z "$D"
47 then 49 then
48 if test -x /usr/sbin/alsactl 50 if test -x /usr/sbin/alsactl
49 then 51 then
50 /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore 52 /usr/sbin/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
51 fi 53 fi
52 # INITSCRIPT_PARAMS changed, so remove the old and 54 # INITSCRIPT_PARAMS changed, so remove the old and
53 # install the new setting. 55 # install the new setting.
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
index 84cdf03750..9850791497 100755
--- a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
+++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state
@@ -9,9 +9,9 @@
9 9
10asound_restore(){ 10asound_restore(){
11 echo "ALSA: Restoring mixer settings..." 11 echo "ALSA: Restoring mixer settings..."
12 if test -x /usr/sbin/alsactl -a -e /etc/asound.state 12 if test -x /usr/sbin/alsactl -a -e #STATEDIR#/asound.state
13 then 13 then
14 /usr/sbin/alsactl -f /etc/asound.state restore & 14 /usr/sbin/alsactl -f #STATEDIR#/asound.state restore &
15 fi 15 fi
16} 16}
17 17
@@ -19,7 +19,7 @@ asound_store(){
19 echo "ALSA: Storing mixer settings..." 19 echo "ALSA: Storing mixer settings..."
20 if test -x /usr/sbin/alsactl 20 if test -x /usr/sbin/alsactl
21 then 21 then
22 /usr/sbin/alsactl -f /etc/asound.state store 22 /usr/sbin/alsactl -f #STATEDIR#/asound.state store
23 fi 23 fi
24} 24}
25 25