dmidecode output cleanup, for dev memory stuff.

This commit is contained in:
inxi-svn 2014-04-15 00:44:02 +00:00
parent 3c75f53521
commit 9ceb7b8cb1

13
inxi
View file

@ -4828,6 +4828,7 @@ get_dmidecode_data()
# strip out starting white space so that the following stuff will clear properly
sub(/^[[:space:]]+/, "", twoData)
sub(/^Base Board .*|^Chassis .*|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*/, "", twoData)
sub(/(AssetTagNum|Manufacturer| Or Motherboard|PartNum|SerNum).*/, "", twoData)
gsub(/bios|acpi/, "", twoData)
sub(/http:\/\/www.abit.com.tw\//, "Abit", twoData)
@ -10293,7 +10294,8 @@ print_machine_data()
system_line="${C2}$sysDmiNull"
fi
# patch to dump all of above if dmidecode was data source and non root user
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' || ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' || \
${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
if [[ ${A_MACHINE_DATA[0]} == 'dmidecode-non-root-user' ]];then
system_line="${C2}${sysDmiError}dmidecode: you must be root to run dmidecode"
elif [[ ${A_MACHINE_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
@ -10329,6 +10331,15 @@ print_memory_data()
memory_line=$( create_print_line "Memory:" "$memory_line${CN}" )
print_screen_output "$memory_line"
if [[ ${A_MEMORY_DATA[0]} == 'dmidecode-non-root-user' || \
${A_MEMORY_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
if [[ ${A_MEMORY_DATA[0]} == 'dmidecode-non-root-user' ]];then
memory_line="${C2}${sysDmiError}dmidecode: you must be root to run dmidecode"
elif [[ ${A_MEMORY_DATA[0]} == 'dmidecode-no-smbios-dmi-data' ]];then
memory_line="${C2}${sysDmiError}dmidecode: no machine data available"
fi
fi
eval $LOGFE
}