New version, new tarball. A subtle issue pointed out by a user, inxi is limited to

26 drives, and fails to handle the linux > 26 options:

https://rwmj.wordpress.com/2011/01/09/how-are-linux-drives-named-beyond-drive-26-devsdz/

That article explains the failing well.

Note that because I have neither user data sets or > 26 hdd systems available, I cannot
verify that my fix works. It may work, that's all I can say.
This commit is contained in:
Harald Hope 2015-11-09 19:03:46 -08:00
parent 0ae4059a1e
commit d512e6b9ad
2 changed files with 26 additions and 6 deletions

12
inxi
View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### Version: 2.2.28 #### Version: 2.2.29
#### Date: 2015-08-20 #### Date: 2015-11-09
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -6083,7 +6083,7 @@ get_hdd_data_basic()
# note that linux 3.2.45-grsec-9th types kernels have this type of partition name: /dev/xvdc (no number, letter) # note that linux 3.2.45-grsec-9th types kernels have this type of partition name: /dev/xvdc (no number, letter)
# note: btrfs does not seem to use partition integers, just the primary /dev/sdx identifier # note: btrfs does not seem to use partition integers, just the primary /dev/sdx identifier
# df can also show /dev/disk/(by-label|by-uuid etc) # df can also show /dev/disk/(by-label|by-uuid etc)
/^\/dev\/(disk\/|mapper\/|[hsv]d[a-z][0-9]*|dm[-]?[0-9]+|ada[0-9]+p[0-9]+.*|(ad|sd|wd)[0-9]+[a-z]|md[0-9]+|[aw]d[0-9]+s.*|xvd[a-z])|^ROOT/ { /^\/dev\/(disk\/|mapper\/|[hsv]d[a-z]+[0-9]*|dm[-]?[0-9]+|ada[0-9]+p[0-9]+.*|(ad|sd|wd)[0-9]+[a-z]|md[0-9]+|[aw]d[0-9]+s.*|xvd[a-z]+)|^ROOT/ {
# this handles the case where the first item is too long # this handles the case where the first item is too long
# and makes df wrap output to next line, so here we advance # and makes df wrap output to next line, so here we advance
# it to the next line for that single case. Using df -P should # it to the next line for that single case. Using df -P should
@ -6142,7 +6142,7 @@ get_hdd_data_basic()
if [[ $B_PARTITIONS_FILE == 'true' ]];then if [[ $B_PARTITIONS_FILE == 'true' ]];then
A_HDD_DATA=( $( A_HDD_DATA=( $(
gawk -v hddUsed=$hdd_used ' gawk -v hddUsed=$hdd_used '
/[hsv]d[a-z]$/ { /[hsv]d[a-z]+$/ {
driveSize = $(NF - 1)*1024/1000**3 driveSize = $(NF - 1)*1024/1000**3
gsub(/,/, " ", driveSize) gsub(/,/, " ", driveSize)
gsub(/^ +| +$/, "", driveSize) gsub(/^ +| +$/, "", driveSize)
@ -6154,7 +6154,7 @@ get_hdd_data_basic()
# } # }
# special case from this data: 8 0 156290904 sda # special case from this data: 8 0 156290904 sda
# note: vm has 252/253/254 known starter, grsec has 202 # note: vm has 252/253/254 known starter, grsec has 202
$1 ~ /^(3|8|22|33|202|252|253|254)$/ && $NF ~ /[hsv]d[a-z]$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) { $1 ~ /^(3|8|22|33|202|252|253|254)$/ && $NF ~ /[hsv]d[a-z]+$/ && ( $2 % 16 == 0 || $2 % 16 == 8 ) {
size += $3 size += $3
} }
END { END {
@ -8096,7 +8096,7 @@ get_partition_data_advanced()
# if this works, great, otherwise, just set this to null values # if this works, great, otherwise, just set this to null values
partTemp="'$( readlink /dev/root 2>/dev/null )'" partTemp="'$( readlink /dev/root 2>/dev/null )'"
if ( partTemp != "" ) { if ( partTemp != "" ) {
if ( partTemp ~ /[hsv]d[a-z][0-9]{1,2}/ ) { if ( partTemp ~ /[hsv]d[a-z]+[0-9]{1,2}/ ) {
partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, partTemp ) partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, partTemp )
} }
else if ( partTemp ~ /by-uuid/ ) { else if ( partTemp ~ /by-uuid/ ) {

View file

@ -1,3 +1,23 @@
=====================================================================================
Version: 2.2.29
Patch Version: 00
Script Date: 2015-11-09
-----------------------------------
Changes:
-----------------------------------
New version, new tarball. A subtle issue pointed out by a user, inxi is limited to
26 drives, and fails to handle the linux > 26 options:
https://rwmj.wordpress.com/2011/01/09/how-are-linux-drives-named-beyond-drive-26-devsdz/
That article explains the failing well.
Note that because I have neither user data sets or > 26 hdd systems available, I cannot
verify that my fix works. It may work, that's all I can say.
-----------------------------------
-- Harald Hope - Mon, 09 Nov 2015 19:00:08 -0800
===================================================================================== =====================================================================================
Version: 2.2.28 Version: 2.2.28
Patch Version: 00 Patch Version: 00