inxi audio driver extraction algo
This looks like it can patch the ugly driver extractor that inxi audio is using now
:: Code :: lspci -nnv | gawk '{IGNORECASE = 1}; /multimedia|audio/, /^$/ {if ( $0 ~ /kernel driver/)driver = $0;if ( $0 ~ /kernel module/)module = $0} END { print "driver: " driver " module: " module}'
driver: Kernel driver in use: Intel ICH module: Kernel modules: snd-intel8x0 and then some gensub fine tuning: :: Code :: lspci -nnv | gawk '{IGNORECASE = 1}; /multimedia|audio/, /^$/ {if ( $0 ~ /kernel driver/)driver = gensub( /(.*): (.*)/,"\\2","g",$0);if ( $0 ~ /kernel module/)module = gensub(/(.*): (.*)/,"\\2","g",$0)} END { print "driver: " driver " module: " module}'
# this gives us: driver: Intel ICH module: snd-intel8x0 and to translate this to human readable: :: Code :: lspci -nnv | gawk '{
IGNORECASE = 1} /multimedia|audio/, /^$/ { if ( $0 ~ /kernel driver/){ driver = gensub( /(.*): (.*)/,"\\2","g",$0) } if ( $0 ~ /kernel module/){ module = gensub(/(.*): (.*)/,"\\2","g",$0) } } END { print "driver: " driver " module: " module }' driver: Intel ICH module: snd-intel8x0 Back to top |
All times are GMT - 8 Hours |