(Change version)

Found another issue, for snd modules, we have to use array item 3, kernel modules loaded, not driver

driver for sound modules is a name, not a module name, and also the reported modules need further processing, - to _ and tolower in case.
This commit is contained in:
inxi-svn 2010-02-05 23:21:37 +00:00
parent c0d50a4a26
commit c90ed16e7b

15
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.3.11
#### version: 1.3.12
#### Date: February 5 2010
########################################################################
#### SPECIAL THANKS
@ -4030,7 +4030,11 @@ print_audio_data()
# port_data=" ${C1}at port${C2} ${a_audio_working[2]}"
# fi
# this should only trigger if the $FILE_ASOUND_DEVICE data is used, not lspci -nn
if [[ -n ${a_audio_working[1]} && $B_EXTRA_DATA == 'true' ]];then
if [[ -n ${a_audio_working[3]} && $B_EXTRA_DATA == 'true' ]];then
# note that for some reason, the module name is not the same as the module
# loaded to kernel name for audio drivers, and you'll need to change the -
module_version=$( print_module_version "${a_audio_working[3]}" 'audio' )
elif [[ -n ${a_audio_working[1]} && $B_EXTRA_DATA == 'true' ]];then
module_version=$( print_module_version "${a_audio_working[1]}" 'audio' )
fi
if [[ -n ${a_audio_working[1]} ]];then
@ -4060,7 +4064,9 @@ print_audio_data()
module_version=''
pci_bus_id=''
if [[ -n ${a_audio_working[3]} && $B_EXTRA_DATA == 'true' ]];then
module_version=$( print_module_version "${a_audio_working[3]}" )
module_version=$( print_module_version "${a_audio_working[3]}" 'audio' )
elif [[ -n ${a_audio_working[1]} && $B_EXTRA_DATA == 'true' ]];then
module_version=$( print_module_version "${a_audio_working[1]}" 'audio' )
fi
# we're testing for the presence of the 2nd array item here, which is the driver name
if [[ -n ${a_audio_working[1]} ]];then
@ -4427,8 +4433,11 @@ print_module_version()
# note that sound driver data tends to have upper case, but modules are lower
if [[ $2 == 'audio' ]];then
if [[ -z $( grep -E '^snd' <<< $modules ) ]];then
prefix='snd_' # sound modules start with snd_
fi
modules=$( tr '[A-Z]' '[a-z]' <<< $modules )
modules=$( tr '-' '_' <<< $modules )
# special intel processing, generally no version info though
if [[ $modules == 'hda intel' ]];then
modules='hda_intel'