aboutsummaryrefslogtreecommitdiffstats
path: root/audio/emu10kx/pkg-install
diff options
context:
space:
mode:
authorvsevolod <vsevolod@FreeBSD.org>2005-09-16 19:41:55 +0800
committervsevolod <vsevolod@FreeBSD.org>2005-09-16 19:41:55 +0800
commitc511f79e86455e848333b0db3646c976f21ad821 (patch)
tree35e930e91c0bed3fcefa0ec601065f2bc837fa90 /audio/emu10kx/pkg-install
parent431a4e39f9a09fad8f6d966173f492e0ee628f68 (diff)
downloadfreebsd-ports-gnome-c511f79e86455e848333b0db3646c976f21ad821.tar.gz
freebsd-ports-gnome-c511f79e86455e848333b0db3646c976f21ad821.tar.zst
freebsd-ports-gnome-c511f79e86455e848333b0db3646c976f21ad821.zip
Add emu10kx driver for SBlive, Audigy and Audigy2 based cards.
This driver is alternative to snd_emu10k1 and support complex mixer settings, analog/digital switch, S/PDIF passthrough PR: 84653 Submitted by: michaels@sdf.lonestar.org
Diffstat (limited to 'audio/emu10kx/pkg-install')
-rw-r--r--audio/emu10kx/pkg-install46
1 files changed, 46 insertions, 0 deletions
diff --git a/audio/emu10kx/pkg-install b/audio/emu10kx/pkg-install
new file mode 100644
index 000000000000..1eb82b4a0108
--- /dev/null
+++ b/audio/emu10kx/pkg-install
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+[ "$2" != "POST-INSTALL" ] && exit 0
+
+#============================================================
+# POST-INSTALL
+#============================================================
+DRIVERNAME=snd_emu10kx
+
+# Ask user about installing driver
+echo -n "Do you want to install $DRIVERNAME driver and load it on boot time? [y/n]: "
+read RES
+echo
+
+if [ x"$RES" = x"y" ] ; then
+
+# Unload the driver
+kldstat -n $DRIVERNAME > /dev/null 2>&1; RESULT=$?
+if [ ${RESULT} -eq 0 ]; then
+ kldunload -n $DRIVERNAME > /dev/null 2>&1; RESULT=$?
+ if [ ${RESULT} -ne 0 ]; then
+ echo "ERROR: Failed to unload the $DRIVERNAME module!"
+ echo "ERROR: Is $DRIVERNAME.ko in use?"
+ exit 1;
+ fi
+fi
+
+# Load the driver
+kldload $DRIVERNAME > /dev/null 2>&1 ; RESULT=$?
+if [ ${RESULT} -ne 0 ]; then
+ echo "ERROR: Failed to load the $DRIVERNAME module!"
+ exit 1;
+fi
+
+# Have the driver load at boot
+grep ${DRIVERNAME}_load /boot/loader.conf > /dev/null 2>&1; RESULT=$?
+if [ ${RESULT} -eq 0 ]; then
+ # Present.
+ sed -e "s/${DRIVERNAME}_load.*/${DRIVERNAME}_load=\"YES\"/g" -i.orig /boot/loader.conf
+else
+ # Not present.
+ echo "${DRIVERNAME}_load=\"YES\"" >> /boot/loader.conf
+fi
+
+fi
+#============================================================