summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/alsa-state/alsa-state.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/alsa-state/alsa-state.bb')
-rw-r--r--meta/recipes-bsp/alsa-state/alsa-state.bb57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
new file mode 100644
index 0000000000..ecfa97530f
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -0,0 +1,57 @@
1# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
2# License: MIT (see http://www.opensource.org/licenses/mit-license.php
3# for a copy of the license)
4#
5# Filename: alsa-state.bb
6
7SUMMARY = "Alsa scenario files to enable alsa state restoration."
8DESCRIPTION = "Alsa Scenario Files - an init script and state files to restore \
9sound state at system boot and save it at system shut down."
10LICENSE = "MIT"
11LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
12PV = "0.2.0"
13PR = "r0"
14
15SRC_URI = "\
16 file://asound.conf \
17 file://asound.state \
18 file://alsa-state \
19"
20
21RDEPENDS = "alsa-utils-alsactl"
22
23inherit update-rc.d
24
25INITSCRIPT_NAME = "alsa-state"
26INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
27
28do_install() {
29 install -d ${D}${sysconfdir}/init.d
30 install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
31
32 install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
33 install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
34}
35
36PACKAGES += "alsa-states"
37
38RRECOMMENDS_alsa-state = "alsa-states"
39
40FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
41CONFFILES_${PN} = "${sysconfdir}/asound.conf"
42
43FILES_alsa-states = "${sysconfdir}/*.state"
44
45pkg_postinst_${PN}() {
46 if test -z "$D"
47 then
48 if test -x /usr/sbin/alsactl
49 then
50 /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
51 fi
52 # INITSCRIPT_PARAMS changed, so remove the old and
53 # install the new setting.
54 update-rc.d -f ${INITSCRIPT_NAME} remove
55 update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
56 fi
57}