summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/alsa-state/alsa-state.bb
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-bsp/alsa-state/alsa-state.bb
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-bsp/alsa-state/alsa-state.bb')
-rw-r--r--meta/recipes-bsp/alsa-state/alsa-state.bb58
1 files changed, 58 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..5ab1b13a52
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -0,0 +1,58 @@
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 = "r4"
14
15SRC_URI = "\
16 file://asound.conf \
17 file://asound.state \
18 file://alsa-state-init \
19"
20
21inherit update-rc.d
22
23INITSCRIPT_NAME = "alsa-state"
24INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
25
26do_install() {
27 sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init
28 install -d ${D}${sysconfdir}/init.d
29 install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
30
31 install -d ${D}/${localstatedir}/lib/alsa
32 install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
33 install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
34}
35
36PACKAGES += "alsa-states"
37
38RRECOMMENDS_alsa-state = "alsa-states"
39
40RDEPENDS_${PN} = "alsa-utils-alsactl"
41FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
42CONFFILES_${PN} = "${sysconfdir}/asound.conf"
43
44FILES_alsa-states = "${localstatedir}/lib/alsa/*.state"
45
46pkg_postinst_${PN}() {
47 if test -z "$D"
48 then
49 if test -x ${sbindir}/alsactl
50 then
51 ${sbindir}/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
52 fi
53 # INITSCRIPT_PARAMS changed, so remove the old and
54 # install the new setting.
55 update-rc.d -f ${INITSCRIPT_NAME} remove
56 update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
57 fi
58}