alsa-state: enable HDMI audio by default
[openembedded.git] / recipes / alsa / alsa-state.bb
blob4eee7e308fa0e239de4684c1cb4eeda68bf4a6b4
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)
5 # Filename: alsa-state.bb
7 DESCRIPTION = "Alsa Scenario Files"
8 LICENSE = "MIT"
9 PV = "0.2.0"
10 PR = "r23"
12 SRC_URI = "\
13 file://asound.conf \
14 file://asound.state \
15 file://alsa-state \
18 SRC_URI_append_a780 = "file://gsmhandset.state \
19 file://gsmheadset.state \
20 file://stereoout.state"
22 inherit update-rc.d
24 INITSCRIPT_NAME = "alsa-state"
25 INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
27 do_install() {
28 install -d ${D}${sysconfdir}/init.d
29 install -m 0755 ${WORKDIR}/alsa-state ${D}${sysconfdir}/init.d
31 install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
32 install -m 0644 ${WORKDIR}/*.state ${D}${sysconfdir}
35 PACKAGES += "alsa-states"
37 RRECOMMENDS_alsa-state = "alsa-states"
38 RRECOMMENDS_${PN}_append_shr_om-gta01 = "virtual/alsa-scenarios"
39 RRECOMMENDS_${PN}_append_shr_om-gta02 = "virtual/alsa-scenarios"
41 FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
42 CONFFILES_${PN} = "${sysconfdir}/asound.conf"
44 FILES_alsa-states = "${sysconfdir}/*.state"
46 PACKAGE_ARCH = "all"
47 PACKAGE_ARCH_alsa-states = "${MACHINE_ARCH}"
49 pkg_postinst_${PN}() {
50 if test -z "$D"
51 then
52 if test -x /usr/sbin/alsactl
53 then
54 /usr/sbin/alsactl -f ${sysconfdir}/asound.state restore
56 # INITSCRIPT_PARAMS changed, so remove the old and
57 # install the new setting.
58 update-rc.d -f ${INITSCRIPT_NAME} remove
59 update-rc.d ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}