summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-03-07 20:29:12 +0000
committerMike Frysinger <vapier@gentoo.org>2003-03-07 20:29:12 +0000
commitae7ed9c0ff3697249157d5b0f7e92f32fb6bfc93 (patch)
treedfb4d2fd8c421c728364194bab2fac3c79fc8085 /media-sound/emu10k1
parentfixed ChangeLog (diff)
downloadgentoo-2-ae7ed9c0ff3697249157d5b0f7e92f32fb6bfc93.tar.gz
gentoo-2-ae7ed9c0ff3697249157d5b0f7e92f32fb6bfc93.tar.bz2
gentoo-2-ae7ed9c0ff3697249157d5b0f7e92f32fb6bfc93.zip
additional check
Diffstat (limited to 'media-sound/emu10k1')
-rw-r--r--media-sound/emu10k1/files/emu10k1-script23
1 files changed, 17 insertions, 6 deletions
diff --git a/media-sound/emu10k1/files/emu10k1-script b/media-sound/emu10k1/files/emu10k1-script
index 1ee3aae66c5a..ace8538529fd 100644
--- a/media-sound/emu10k1/files/emu10k1-script
+++ b/media-sound/emu10k1/files/emu10k1-script
@@ -3,24 +3,35 @@
source /sbin/functions.sh
source /etc/emu10k1.conf
-# setup regex strings to match
+# setup regex strings to match
AUDIGY_PCI_TAG="multimedia audio controller: creative labs.*audigy"
EMU10K1_PCI_TAG="multimedia audio controller: creative labs.*emu10k1"
-# first try to detect via lspci (sys-apps/pciutils)
+# first, lets try to read the driver information in /proc/driver/
+proc="`ls /proc/driver/emu10k1/*/info | awk '{print $1}'`"
+if [ -z "${CARD_TYPE}" ] && [ -e ${proc} ] ; then
+ if [ -n "$(egrep -i '^card type.*audigy.*' ${proc})" ] ; then
+ CARD_TYPE="audigy"
+ elif [ -n "$(egrep -i '^card type.*emu10k1.*' ${proc})" ] ; then
+ CARD_TYPE="emu"
+ fi
+fi
+
+# if that didnt work, try to detect via lspci (sys-apps/pciutils)
if [ -z "${CARD_TYPE}" ] && [ -x /sbin/lspci ] ; then
- if [ -n "$(lspci | egrep -i '${AUDIGY_PCI_TAG}')" ] ; then
+echo 1
+ if [ -n "$(lspci | egrep -i "${AUDIGY_PCI_TAG}")" ] ; then
CARD_TYPE="audigy"
- elif [ -n "$(lspci | egrep -i '${EMU10K1_PCI_TAG}')" ] ; then
+ elif [ -n "$(lspci | egrep -i "${EMU10K1_PCI_TAG}")" ] ; then
CARD_TYPE="emu"
fi
fi
# if that didnt work, lets try via the kernel's /proc/pci interface
if [ -z "${CARD_TYPE}" ] && [ -e /proc/pci ] ; then
- if [ -n "$(egrep -i '${AUDIGY_PCI_TAG}' /proc/pci)" ] ; then
+ if [ -n "$(egrep -i "${AUDIGY_PCI_TAG}" /proc/pci)" ] ; then
CARD_TYPE="audigy"
- elif [ -n "$(egrep -i '${EMU10K1_PCI_TAG}' /proc/pci)" ] ; then
+ elif [ -n "$(egrep -i "${EMU10K1_PCI_TAG}" /proc/pci)" ] ; then
CARD_TYPE="emu"
fi
fi