From 3213f8d1ed9bf7293543dcf981ce7601bc9ae366 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 21 Apr 2011 01:16:09 +0000 Subject: [PATCH] added support for virtual disks, like /dev/vda3 for partitions / disks --- inxi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inxi b/inxi index ad16370..34d4bb3 100755 --- a/inxi +++ b/inxi @@ -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/ ) {