added support for virtual disks, like /dev/vda3 for partitions / disks

This commit is contained in:
inxi-svn 2011-04-21 01:16:09 +00:00
parent 6b592e3287
commit 3213f8d1ed

12
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 1.4.23
#### Date: January 11 2011
#### version: 1.4.24
#### Date: April 20 2011
########################################################################
#### SPECIAL THANKS
########################################################################
@ -2632,7 +2632,7 @@ get_hdd_data_basic()
hdd_used=$( echo "$hdd_data" | gawk '
# also handles odd dm-1 type, from lvm
/^\/dev\/(mapper\/|[hs]d[a-z][0-9]+|dm[-]?[0-9]+)/ {
/^\/dev\/(mapper\/|[hsv]d[a-z][0-9]+|dm[-]?[0-9]+)/ {
# this handles the case where the first item is too long
# and makes df wrap output to next line, so here we advance
# it to the next line for that single case
@ -2671,7 +2671,7 @@ get_hdd_data_basic()
if [[ $B_PARTITIONS_FILE == 'true' ]];then
A_HDD_DATA=( $(
gawk -v hddused="$hdd_used" '
/[hs]d[a-z]$/ {
/[hsv]d[a-z]$/ {
driveSize = $(NF - 1)*1024/1000**3
gsub(/,/, " ", driveSize)
gsub(/^ +| +$/, "", driveSize)
@ -2682,7 +2682,7 @@ get_hdd_data_basic()
# size += $3
# }
# special case from this data: 8 0 156290904 sda
$1 ~ /^(3|22|33|8)$/ && $NF ~ /[hs]d[a-z]$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
$1 ~ /^(3|22|33|8)$/ && $NF ~ /[hsv]d[a-z]$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
size += $3
}
@ -3270,7 +3270,7 @@ get_partition_data_advanced()
# if this works, great, otherwise, just set this to null values
partTemp="'$( readlink /dev/root 2>/dev/null )'"
if ( partTemp != "" ) {
if ( partTemp ~ /[hs]d[a-z][0-9]{1,2}/ ) {
if ( partTemp ~ /[hsv]d[a-z][0-9]{1,2}/ ) {
partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, partTemp )
}
else if ( partTemp ~ /by-uuid/ ) {