From c90ed16e7b61513583b17099a54976ab36a74a90 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 5 Feb 2010 23:21:37 +0000 Subject: [PATCH] (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. --- inxi | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 44ac1cc..95d8dcc 100755 --- a/inxi +++ b/inxi @@ -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 - prefix='snd_' # sound modules start with snd_ + 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'