mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
New version, new tarball. Fixed bad assumption, DMI type 0 is not always before other
types, in at least one case, it is last, so can't use that as trigger to start loop. Now using: Table at .. which is always at start of dmi output. Also, changed size output per module to be in MB GB TB instead of all mB, since modules are sold by GB or MB, the data should show that as well. Also shortens output.
This commit is contained in:
parent
579ba364f7
commit
a19125c8c7
36
inxi
36
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### Version: 2.1.97
|
#### Version: 2.1.98
|
||||||
#### Date: 2014-08-16
|
#### Date: 2014-08-17
|
||||||
#### Patch Number: 00
|
#### Patch Number: 00
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -8154,7 +8154,6 @@ get_ram_data()
|
||||||
aArrayData[0,"deviceCount16"]=0
|
aArrayData[0,"deviceCount16"]=0
|
||||||
aArrayData[0,"deviceCountFound"]=0
|
aArrayData[0,"deviceCountFound"]=0
|
||||||
aArrayData[0,"moduleVoltage5"]=""
|
aArrayData[0,"moduleVoltage5"]=""
|
||||||
|
|
||||||
moduleVoltage=""
|
moduleVoltage=""
|
||||||
numberOfDevices=""
|
numberOfDevices=""
|
||||||
primaryType=""
|
primaryType=""
|
||||||
|
@ -8163,7 +8162,6 @@ get_ram_data()
|
||||||
i=0
|
i=0
|
||||||
j=0
|
j=0
|
||||||
k=0
|
k=0
|
||||||
|
|
||||||
bDebugger1="false"
|
bDebugger1="false"
|
||||||
dDebugger2="false"
|
dDebugger2="false"
|
||||||
bType5="false"
|
bType5="false"
|
||||||
|
@ -8188,7 +8186,7 @@ get_ram_data()
|
||||||
}
|
}
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
/^Handle .* DMI[[:space:]]+type[[:space:]]+[0](,|[[:space:]])/ {
|
/^Table[[:space:]]+at[[:space:]]/ {
|
||||||
bType5="false"
|
bType5="false"
|
||||||
# we need to start count here because for testing > 1 array, and we want always to have
|
# we need to start count here because for testing > 1 array, and we want always to have
|
||||||
# the actual module data assigned to the right primary array, even when it is out of
|
# the actual module data assigned to the right primary array, even when it is out of
|
||||||
|
@ -8305,8 +8303,14 @@ get_ram_data()
|
||||||
aArrayData[k,"usedCapacity"]=workingSize + aArrayData[k,"usedCapacity"]
|
aArrayData[k,"usedCapacity"]=workingSize + aArrayData[k,"usedCapacity"]
|
||||||
}
|
}
|
||||||
# print aArrayData[k,"derivedModuleSize"] " dm:" k ":mm " aMaxModuleSize[k] " uc:" aArrayData[k,"usedCapacity"]
|
# print aArrayData[k,"derivedModuleSize"] " dm:" k ":mm " aMaxModuleSize[k] " uc:" aArrayData[k,"usedCapacity"]
|
||||||
|
# we want any non real size data to be preserved
|
||||||
|
if ( $2 ~ /^[0-9]+[[:space:]]*[MTPG]B/ ) {
|
||||||
|
deviceSize=workingSize
|
||||||
|
}
|
||||||
|
else {
|
||||||
deviceSize=$2
|
deviceSize=$2
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( $1 == "Locator") {
|
if ( $1 == "Locator") {
|
||||||
# sub(/.*_/,"",$2)
|
# sub(/.*_/,"",$2)
|
||||||
#sub(/RAM slot #|^DIMM/, "Slot",$2)
|
#sub(/RAM slot #|^DIMM/, "Slot",$2)
|
||||||
|
@ -8570,7 +8574,27 @@ get_ram_data()
|
||||||
# print device rows next
|
# print device rows next
|
||||||
for ( j=0;j<=100;j++ ) {
|
for ( j=0;j<=100;j++ ) {
|
||||||
if (aMemory[m,j,0] != "" ) {
|
if (aMemory[m,j,0] != "" ) {
|
||||||
print aMemory[m,j,0] "," aMemory[m,j,1] "," aMemory[m,j,2] "," aMemory[m,j,3] "," aMemory[m,j,4] "," aMemory[m,j,5] "," aMemory[m,j,6] "," aMemory[m,j,7] "," aMemory[m,j,8] "," aMemory[m,j,9] "," aMemory[m,j,10] "," aMemory[m,j,11] "," aMemory[m,j,12] "," aMemory[m,j,13] "," aMemory[m,j,14] "," aMemory[m,j,15] "," aMemory[m,j,16] "," aMemory[m,j,17]
|
unit=""
|
||||||
|
workingSize=aMemory[m,j,2]
|
||||||
|
if ( workingSize ~ /^[0-9]+$/ ) {
|
||||||
|
workingSize=int(workingSize)
|
||||||
|
if ( workingSize < 1024 ) {
|
||||||
|
workingSize = workingSize
|
||||||
|
unit=" MB"
|
||||||
|
}
|
||||||
|
else if ( workingSize < 1024000 ) {
|
||||||
|
workingSize = workingSize / 1024
|
||||||
|
unit=" GB"
|
||||||
|
}
|
||||||
|
else if ( workingSize < 1024000000 ) {
|
||||||
|
workingSize = workingSize / 1024000
|
||||||
|
unit=" TB"
|
||||||
|
}
|
||||||
|
# we only want a max 2 decimal places, this trick gives 0 to 2
|
||||||
|
workingSize=gensub(/([0-9]+\.[0-9][0-9]).*/,"\\1",1,workingSize)
|
||||||
|
workingSize = workingSize unit
|
||||||
|
}
|
||||||
|
print aMemory[m,j,0] "," aMemory[m,j,1] "," workingSize "," aMemory[m,j,3] "," aMemory[m,j,4] "," aMemory[m,j,5] "," aMemory[m,j,6] "," aMemory[m,j,7] "," aMemory[m,j,8] "," aMemory[m,j,9] "," aMemory[m,j,10] "," aMemory[m,j,11] "," aMemory[m,j,12] "," aMemory[m,j,13] "," aMemory[m,j,14] "," aMemory[m,j,15] "," aMemory[m,j,16] "," aMemory[m,j,17]
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
break
|
break
|
||||||
|
|
|
@ -1,3 +1,21 @@
|
||||||
|
=====================================================================================
|
||||||
|
Version: 2.1.98
|
||||||
|
Patch Version: 00
|
||||||
|
Script Date: 2014-08-17
|
||||||
|
-----------------------------------
|
||||||
|
Changes:
|
||||||
|
-----------------------------------
|
||||||
|
New version, new tarball. Fixed bad assumption, DMI type 0 is not always before other
|
||||||
|
types, in at least one case, it is last, so can't use that as trigger to start loop.
|
||||||
|
|
||||||
|
Now using: Table at .. which is always at start of dmi output.
|
||||||
|
|
||||||
|
Also, changed size output per module to be in MB GB TB instead of all mB, since modules
|
||||||
|
are sold by GB or MB, the data should show that as well. Also shortens output.
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
-- Harald Hope - Sun, 17 Aug 2014 12:01:38 -0700
|
||||||
|
|
||||||
=====================================================================================
|
=====================================================================================
|
||||||
Version: 2.1.97
|
Version: 2.1.97
|
||||||
Patch Version: 00
|
Patch Version: 00
|
||||||
|
|
Loading…
Reference in a new issue