aboutsummaryrefslogtreecommitdiffstats
path: root/meta-n450
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 /meta-n450
parentd1ba49be3052aada2ca8fe8f12787b4fce8a6383 (diff)
downloadmeta-intel-d9ac50894e55b780aaab43b96536e0ce678ff8f7.tar.gz
meta-intel-d9ac50894e55b780aaab43b96536e0ce678ff8f7.tar.bz2
meta-intel-d9ac50894e55b780aaab43b96536e0ce678ff8f7.zip
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>
Diffstat (limited to 'meta-n450')
-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"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
-PR = "r3"
+PR = "r4"
inherit update-rc.d
@@ -16,8 +16,15 @@ INITSCRIPT_NAME = "n450-audio"
INITSCRIPT_PARAMS = "defaults 90"
do_install() {
- install -d ${D}${sysconfdir} \
- ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir} \
+ ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/n450-audio ${D}${sysconfdir}/init.d
+ cat ${WORKDIR}/${INITSCRIPT_NAME} | \
+ sed -e 's,/etc,${sysconfdir},g' \
+ -e 's,/usr/sbin,${sbindir},g' \
+ -e 's,/var,${localstatedir},g' \
+ -e 's,/usr/bin,${bindir},g' \
+ -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+ chmod 755 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
}
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 @@
#!/bin/sh
+### BEGIN INIT INFO
+# Provides: n450 mixer setup
+# Required-Start: $syslog
+# Required-Stop: $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Initialize the n450 audio mixer
+# Description: Unmute FRONT and set volume to ~70%.
+### END INIT INFO
+# Author: Darren Hart <dvhart@linux.intel.com>
+# Based on /etc/init.d/skeleton
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Audio mixer settings"
+NAME=n450-audio
AMIXER=`which amixer`
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if amixer is not installed
+[ -x "$AMIXER" ] || exit 0
+
+do_start() {
+ # Enable the "Front" simple controls (black phones jack)
+ $AMIXER sset Front 30 on > /dev/null
+}
+
+case "$1" in
+start)
+ echo "$NAME: setting default mixer settings."
+ do_start
+ ;;
+stop)
+ ;;
+*)
+ echo "Usage: $SCRIPTNAME {start|stop}" >&2
+ exit 3
+ ;;
+esac
-if [ ! -e "$AMIXER" ]; then
- if [ -e /usr/bin/amixer ]; then
- AMIXER=/usr/bin/amixer
- else
- echo "amixer not found, unable to set default audio settings."
- exit 1
- fi
-fi
-
-# Enable the "Front" simple controls (black phones jack)
-$AMIXER sset Front 30 on
+exit 0