summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-03-12 00:15:41 -0800
committerDarren Hart <dvhart@linux.intel.com>2011-03-12 00:46:56 -0800
commitd9ac50894e55b780aaab43b96536e0ce678ff8f7 (patch)
tree84e8979d6c56d940b64a132e660135772f6eaeef
parentd1ba49be3052aada2ca8fe8f12787b4fce8a6383 (diff)
downloadmeta-intel-d9ac50894e55b780aaab43b96536e0ce678ff8f7.tar.gz
n450: replace n450-audio with a proper init script
Rewrite n450-audio based on /etc/init.d/skeleton. Update the install to rewrite all the system paths. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r--meta-n450/recipes-bsp/n450-audio/n450-audio.bb13
-rw-r--r--meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio49
2 files changed, 48 insertions, 14 deletions
diff --git a/meta-n450/recipes-bsp/n450-audio/n450-audio.bb b/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
index 20e3a9ad..90ec267b 100644
--- a/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
+++ b/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
@@ -4,7 +4,7 @@ SECTION = "base"
4LICENSE = "MIT" 4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" 5LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
6 6
7PR = "r3" 7PR = "r4"
8 8
9inherit update-rc.d 9inherit update-rc.d
10 10
@@ -16,8 +16,15 @@ INITSCRIPT_NAME = "n450-audio"
16INITSCRIPT_PARAMS = "defaults 90" 16INITSCRIPT_PARAMS = "defaults 90"
17 17
18do_install() { 18do_install() {
19 install -d ${D}${sysconfdir} \ 19 install -d ${D}${sysconfdir} \
20 ${D}${sysconfdir}/init.d 20 ${D}${sysconfdir}/init.d
21 install -m 0755 ${WORKDIR}/n450-audio ${D}${sysconfdir}/init.d 21 install -m 0755 ${WORKDIR}/n450-audio ${D}${sysconfdir}/init.d
22 cat ${WORKDIR}/${INITSCRIPT_NAME} | \
23 sed -e 's,/etc,${sysconfdir},g' \
24 -e 's,/usr/sbin,${sbindir},g' \
25 -e 's,/var,${localstatedir},g' \
26 -e 's,/usr/bin,${bindir},g' \
27 -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
28 chmod 755 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
22} 29}
23 30
diff --git a/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio b/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
index ad1b0bd4..c5a0044b 100644
--- a/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
+++ b/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
@@ -1,15 +1,42 @@
1#!/bin/sh 1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: n450 mixer setup
4# Required-Start: $syslog
5# Required-Stop: $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Initialize the n450 audio mixer
9# Description: Unmute FRONT and set volume to ~70%.
10### END INIT INFO
2 11
12# Author: Darren Hart <dvhart@linux.intel.com>
13# Based on /etc/init.d/skeleton
14
15PATH=/sbin:/usr/sbin:/bin:/usr/bin
16DESC="Audio mixer settings"
17NAME=n450-audio
3AMIXER=`which amixer` 18AMIXER=`which amixer`
19SCRIPTNAME=/etc/init.d/$NAME
20
21# Exit if amixer is not installed
22[ -x "$AMIXER" ] || exit 0
23
24do_start() {
25 # Enable the "Front" simple controls (black phones jack)
26 $AMIXER sset Front 30 on > /dev/null
27}
28
29case "$1" in
30start)
31 echo "$NAME: setting default mixer settings."
32 do_start
33 ;;
34stop)
35 ;;
36*)
37 echo "Usage: $SCRIPTNAME {start|stop}" >&2
38 exit 3
39 ;;
40esac
4 41
5if [ ! -e "$AMIXER" ]; then 42exit 0
6 if [ -e /usr/bin/amixer ]; then
7 AMIXER=/usr/bin/amixer
8 else
9 echo "amixer not found, unable to set default audio settings."
10 exit 1
11 fi
12fi
13
14# Enable the "Front" simple controls (black phones jack)
15$AMIXER sset Front 30 on