diff options
author | Mike Frysinger <vapier@gentoo.org> | 2003-03-07 20:29:12 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2003-03-07 20:29:12 +0000 |
commit | 149066e4836e12c9e5fc4624a067f9c2458297df (patch) | |
tree | 2566dcd036f47ec8cb2534a1923d775978a0b922 /media-sound/emu10k1 | |
parent | fixed ChangeLog (diff) | |
download | historical-149066e4836e12c9e5fc4624a067f9c2458297df.tar.gz historical-149066e4836e12c9e5fc4624a067f9c2458297df.tar.bz2 historical-149066e4836e12c9e5fc4624a067f9c2458297df.zip |
additional check
Diffstat (limited to 'media-sound/emu10k1')
-rw-r--r-- | media-sound/emu10k1/files/emu10k1-script | 23 |
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 |