branch three, more dmidecode

This commit is contained in:
inxi-svn 2014-08-12 00:53:46 +00:00
parent c7d1eb2f6a
commit 3db4eb50a1

25
inxi
View file

@ -3,7 +3,7 @@
#### Script Name: inxi
#### Version: 2.1.29
#### Date: 2014-08-11
#### Patch Number: 02-b3
#### Patch Number: 03-b3
########################################################################
#### SPECIAL THANKS
########################################################################
@ -9973,17 +9973,26 @@ print_cpu_flags_full()
done
eval $LOGFE
}
# args: $1 - get_dmidecode_data error return
print_dmidecode_error()
{
eval $LOGFS
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
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
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
error_message="dmidecode: no machine data available"
error_message="${sysDmiError}dmidecode: no machine data available"
fi
echo $error_message
eval $LOGFE
@ -10510,16 +10519,10 @@ print_machine_data()
local system_vendor='' product_name='' product_version='' product_serial='' product_uuid=''
local chassis_vendor='' chassis_type='' chassis_version='' chassis_serial=''
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'
# set A_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=','
## keys for machine data are:
# 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:
# 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
# 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