1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00
freebsd-ports/audio/emu10kx/pkg-install
Vsevolod Stakhov 8b0303d490 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
2005-09-16 11:41:55 +00:00

47 lines
1.2 KiB
Bash

#!/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
#============================================================