mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
branch three, more dmidecode
This commit is contained in:
parent
c7d1eb2f6a
commit
3db4eb50a1
25
inxi
25
inxi
|
@ -3,7 +3,7 @@
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### Version: 2.1.29
|
#### Version: 2.1.29
|
||||||
#### Date: 2014-08-11
|
#### Date: 2014-08-11
|
||||||
#### Patch Number: 02-b3
|
#### Patch Number: 03-b3
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -9973,17 +9973,26 @@ print_cpu_flags_full()
|
||||||
done
|
done
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
# args: $1 - get_dmidecode_data error return
|
# args: $1 - get_dmidecode_data error return
|
||||||
print_dmidecode_error()
|
print_dmidecode_error()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local error_message='Unknown dmidecode error.'
|
local error_message='Unknown dmidecode error.'
|
||||||
|
local sysDmiError='No /sys/class/dmi, using '
|
||||||
|
|
||||||
|
if [[ -n $BSD_TYPE ]];then
|
||||||
|
sysDmiError='Using '
|
||||||
|
elif [[ $B_FORCE_DMIDECODE == 'true' ]];then
|
||||||
|
sysDmiError='Forcing '
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-error-requires-root' ]];then
|
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-error-requires-root' ]];then
|
||||||
error_message="dmidecode: you must be root to run dmidecode"
|
error_message="${sysDmiError}dmidecode: you must be root to run dmidecode"
|
||||||
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-error-not-installed' ]];then
|
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-error-not-installed' ]];then
|
||||||
error_message="dmidecode: dmidecode is not installed."
|
error_message="${sysDmiError}dmidecode: dmidecode is not installed."
|
||||||
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-error-no-smbios-dmi-data' ]];then
|
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-error-no-smbios-dmi-data' ]];then
|
||||||
error_message="dmidecode: no machine data available"
|
error_message="${sysDmiError}dmidecode: no machine data available"
|
||||||
fi
|
fi
|
||||||
echo $error_message
|
echo $error_message
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -10510,16 +10519,10 @@ print_machine_data()
|
||||||
local system_vendor='' product_name='' product_version='' product_serial='' product_uuid=''
|
local system_vendor='' product_name='' product_version='' product_serial='' product_uuid=''
|
||||||
local chassis_vendor='' chassis_type='' chassis_version='' chassis_serial=''
|
local chassis_vendor='' chassis_type='' chassis_version='' chassis_serial=''
|
||||||
local b_skip_system='false' b_skip_chassis='false'
|
local b_skip_system='false' b_skip_chassis='false'
|
||||||
local sysDmiError='No /sys/class/dmi, using '
|
|
||||||
local sysDmiNull='No /sys/class/dmi machine data: try newer kernel, or install dmidecode'
|
local sysDmiNull='No /sys/class/dmi machine data: try newer kernel, or install dmidecode'
|
||||||
# set A_MACHINE_DATA
|
# set A_MACHINE_DATA
|
||||||
get_machine_data
|
get_machine_data
|
||||||
|
|
||||||
if [[ -n $BSD_TYPE || $B_FORCE_DMIDECODE == 'true' ]];then
|
|
||||||
sysDmiError=''
|
|
||||||
sysDmiNull='No machine data available. Is dmidecode installed?'
|
|
||||||
fi
|
|
||||||
|
|
||||||
IFS=','
|
IFS=','
|
||||||
## keys for machine data are:
|
## keys for machine data are:
|
||||||
# 0-sys_vendor 1-product_name 2-product_version 3-product_serial 4-product_uuid
|
# 0-sys_vendor 1-product_name 2-product_version 3-product_serial 4-product_uuid
|
||||||
|
@ -10528,7 +10531,7 @@ print_machine_data()
|
||||||
## with extra data:
|
## with extra data:
|
||||||
# 12-chassis_vendor 13-chassis_type 14-chassis_version 15-chassis_serial
|
# 12-chassis_vendor 13-chassis_type 14-chassis_version 15-chassis_serial
|
||||||
|
|
||||||
if [[ ${#A_MACHINE_DATA[@]} -gt 0 ]];then
|
if [[ ${#A_MACHINE_DATAs[@]} -gt 0 ]];then
|
||||||
# note: in some case a mobo/version will match a product name/version, do not print those
|
# note: in some case a mobo/version will match a product name/version, do not print those
|
||||||
# but for laptops, or even falsely id'ed desktops with batteries, let's print it all if it matches
|
# but for laptops, or even falsely id'ed desktops with batteries, let's print it all if it matches
|
||||||
# there can be false id laptops if battery appears so need to make sure system is filled
|
# there can be false id laptops if battery appears so need to make sure system is filled
|
||||||
|
|
Loading…
Reference in a new issue