diff --git a/inxi b/inxi index 7e28f36..29db451 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/usr/bin/env bash ######################################################################## #### Script Name: inxi -#### Version: 2.1.90 -#### Date: 2014-08-11 +#### Version: 2.1.91 +#### Date: 2014-08-12 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -4922,11 +4922,12 @@ get_dmidecode_data() sub(/^\tDMI type.*/, "", $0) cutExtraTab="true" } + gsub(/'"$BAN_LIST_NORMAL"'/, "", twoData) - gsub(/,/, " ", $0) + gsub(/,/, " ", twoData) # clean out Handle line # sub(/^Handle.*/,"", $0) - sub(/^[[:space:]]*Inactive.*/,"",$0) + sub(/^[[:space:]]*Inactive.*/,"",twoData) # yes, there is a typo in a user data set, unknow # Base Board Version|Base Board Serial Number # Chassis Manufacturer|Chassis Version|Chassis Serial Number @@ -4934,8 +4935,8 @@ get_dmidecode_data() # To Be Filled By O.E.M. # 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) + sub(/^Base Board .*|^Chassis .*|.*O\.E\.M\..*|.*OEM.*|^Not .*|^System .*|.*unknow.*|.*N\/A.*|none|^To be filled.*|^0x[0]+$/, "", twoData) + sub(/.*(AssetTagNum|Manufacturer| Or Motherboard|PartNum.*|SerNum).*/, "", twoData) gsub(/bios|acpi/, "", twoData) sub(/http:\/\/www.abit.com.tw\//, "Abit", twoData) @@ -4948,7 +4949,6 @@ get_dmidecode_data() else { sub(/^\t\t+/, "~", oneData) } - gsub(/^[[:space:]]+|[[:space:]]+$/, "", twoData) gsub(/^[[:space:]]+|[[:space:]]+$/, "", oneData) gsub(/ [ \t]+/, " ", twoData) @@ -4965,7 +4965,7 @@ N /^\n$/D }' \ )" - # echo ":${DMIDECODE_DATA/*Permission denied*/}:" + # echo ":${DMIDECODE_DATA}:" log_function_data "DMIDECODE_DATA (PRE): $DMIDECODE_DATA" if [[ ${#DMIDECODE_DATA} -lt 100 ]];then if [[ -z ${DMIDECODE_DATA/*Permission denied*/} ]];then @@ -6095,7 +6095,6 @@ get_machine_data() board_vendor board_name board_version board_serial bios_vendor bios_version bios_date " - if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then machine_files="$machine_files chassis_vendor chassis_type chassis_version chassis_serial @@ -6222,6 +6221,9 @@ get_machine_data() exit # stop the loop } END { + # sys_vendor product_name product_version product_serial product_uuid + # board_vendor board_name board_version board_serial + # bios_vendor bios_version bios_date if ( bItemFound == "true" ) { fullString = systemManufacturer "," systemProductName "," systemVersion "," systemSerialNumber fullString = fullString "," systemUuid "," baseboardManufacturer "," baseboardProductName @@ -6236,11 +6238,13 @@ get_machine_data() fi fi fi + echo $array_string IFS=',' A_MACHINE_DATA=( $array_string ) IFS="$ORIGINAL_IFS" - a_temp=${A_MACHINE_DATA[@]} -# echo ${a_temp[@]} + # echo ${A_MACHINE_DATA[5]} + a_temp=( ${A_MACHINE_DATA[@]} ) + # echo ${#a_temp[@]} log_function_data "A_MACHINE_DATA: $a_temp" eval $LOGFE } @@ -8166,7 +8170,7 @@ get_ram_data() if ( $1 == "Error Correction Type") { errorCorrection=$2 if ( errorCorrection == "" ){ - errorCorrection="None" + errorCorrection="No" } } if ( $1 == "Number of Devices") { @@ -8199,12 +8203,13 @@ get_ram_data() deviceSize=$2 } if ( $1 == "Locator") { - sub(/.*_/,"",$2) + # sub(/.*_/,"",$2) + sub(/RAM slot #|^DIMM/, "slot",$2) locator=toupper($2) } if ( $1 == "Bank Locator") { sub(/_.*/,"",$2) - sub(/Channel/,"bank",$2) + sub(/RAM slot #|Channel|Chan/,"bank",$2) bankLocator=toupper($2) } if ( $1 == "Form Factor") { @@ -8223,15 +8228,15 @@ get_ram_data() configuredClockSpeed=$2 } if ( $1 == "Manufacturer") { - sub(/([0]+|Undefined.*|Manufacturer.*)/,"",$2) + gsub(/(^[0]+$|Undefined.*|.*Manufacturer.*)/,"",$2) deviceManufacturer=$2 } if ( $1 == "Part Number") { - sub(/([0]+|PartNum.*|Undefined.*)/,"",$2) + sub(/(^[0]+$||.*Module.*|Undefined.*)/,"",$2) devicePartNumber=$2 } if ( $1 == "Serial Number") { - sub(/([0]+|SerNum.*|Undefined.*)/,"",$2) + gsub(/(^[0]+$|Undefined.*)/,"",$2) deviceSerialNumber=$2 } } @@ -10705,8 +10710,8 @@ print_machine_data() # 9-bios_vendor 10-bios_version 11-bios_date ## with extra data: # 12-chassis_vendor 13-chassis_type 14-chassis_version 15-chassis_serial - - if [[ ${#A_MACHINE_DATA[@]} -gt 0 ]];then + # a null array always has a count of 1 + if [[ ${#A_MACHINE_DATA[@]} -gt 1 ]];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 @@ -11863,7 +11868,7 @@ print_raid_data() print_ram_data() { eval $LOGFS - local memory_line="${C1}Placeholder$SEP3${C2} Feature not yet developed" + local memory_line='' line_2='' line_3='' local error_string='' a_memory_item='' line_starter='Memory:' array_counter=0 local dmidecodeNull='No dmidecode memory data: try newer kernel.' @@ -11872,9 +11877,8 @@ print_ram_data() local device_size='' array_use='' location='' error_correction='' max_capacity='' nu_of_devices='' get_ram_data - #echo ${#A_MEMORY_DATA[@]} - # echo ${A_MEMORY_DATA[0]} + #echo ${A_MEMORY_DATA[0]} if [[ ${#A_MEMORY_DATA[@]} -gt 0 ]];then if [[ ${A_MEMORY_DATA[0]} == 'dmidecode-error-'* ]];then error_string=$( print_dmidecode_error 'default' "${A_MEMORY_DATA[0]}" ) @@ -11885,9 +11889,13 @@ print_ram_data() IFS=',' a_memory_item=(${A_MEMORY_DATA[i]}) IFS="$ORIGINAL_IFS" + memory_line='' + line_2='' + line_3='' + part_nu='' + serial_nu='' + manufacturer='' # memory-array,0x0012,System Board,8 GB,4,System Memory,None - # memory-device,0x002C,8192 MB,ChannelD,ChannelD_Dimm2,DIMM,DDR3,Synchronous,2400 MHz,2400 MHz,64 bits,64 bits,Undefined,F3-19200C10-8GBZH,00000000 - if [[ ${a_memory_item[0]} == 'memory-array' ]];then if [[ -n ${a_memory_item[4]} ]];then nu_of_devices=${a_memory_item[4]} @@ -11904,7 +11912,7 @@ print_ram_data() else error_correction='N/A' fi - memory_line="${C1}Array$SEP3${C2} $array_counter ${C1}Capacity$SEP3${C2} $max_capacity ${C1}Devices$SEP3${C2} $nu_of_devices ${C1}EC$SEP3${C2} $error_correction" + memory_line="${C1}Array$SEP3${C2} $array_counter ${C1}capacity$SEP3${C2} $max_capacity ${C1}devices$SEP3${C2} $nu_of_devices ${C1}EC$SEP3${C2} $error_correction" (( array_counter++ )) else if [[ -n ${a_memory_item[3]} ]];then @@ -11918,8 +11926,8 @@ print_ram_data() bank='N/A' fi if [[ -n ${a_memory_item[4]} ]];then - if [[ -z ${a_memory_item[4]/DIMM*/} ]];then - slot=${a_memory_item[4]#DIMM} + if [[ -z ${a_memory_item[4]/SLOT*/} ]];then + slot=${a_memory_item[4]#SLOT} slot=${slot## } else slot=${a_memory_item[4]} @@ -11934,9 +11942,14 @@ print_ram_data() fi if [[ -n ${a_memory_item[6]} ]];then device_type=${a_memory_item[6]} + if [[ $B_EXTRA_EXTRA_EXTRA_DATA == 'true' && -n ${a_memory_item[7]} \ + && ${a_memory_item[7]} != 'Other' ]];then + device_type="$device_type (${a_memory_item[7]}) " + fi else - device_type='N/A' + device_type='N/A ' fi + device_type="${C1}type$SEP3${C2} $device_type " if [[ -n ${a_memory_item[8]} ]];then if [[ -n ${a_memory_item[9]} ]];then device_speed=${a_memory_item[9]} @@ -11946,11 +11959,72 @@ print_ram_data() else device_speed='N/A' fi - memory_line="${C1}Bank$SEP3${C2} $bank ${C1}Slot$SEP3${C2} $slot ${C1}size$SEP3${C2} $device_size ${C1}speed$SEP3${C2} $device_speed ${C1}type$SEP3${C2} $device_type " + device_speed="${C1}speed$SEP3${C2} $device_speed " + # memory-device,0x002C,8192 MB,ChannelD,ChannelD_Dimm2,DIMM,DDR3,Synchronous,2400 MHz,2400 MHz,64 bits,64 bits,Undefined,F3-19200C10-8GBZH,00000000 + if [[ $B_EXTRA_DATA == 'true' ]];then + if [[ -n ${a_memory_item[13]} ]];then + part_nu=${a_memory_item[13]} + else + part_nu='N/A' + fi + part_nu="${C1}part$SEP3${C2} $part_nu " + fi + if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then + if [[ -n ${a_memory_item[12]} ]];then + manufacturer=${a_memory_item[12]} + else + manufacturer='N/A' + fi + manufacturer="${C1}manufacturer$SEP3${C2} $manufacturer " + if [[ -n ${a_memory_item[14]} ]];then + serial_nu=${a_memory_item[14]} + else + serial_nu='N/A' + fi + serial_nu="${C1}serial$SEP3${C2} $serial_nu " + fi + if [[ $B_EXTRA_EXTRA_EXTRA_DATA == 'true' ]];then + if [[ -n ${a_memory_item[11]} ]];then + data_width=${a_memory_item[11]} + else + data_width='N/A' + fi + data_width="${C1}width$SEP3 total$SEP3${C2} $data_width " + if [[ -n ${a_memory_item[10]} ]];then + total_width=${a_memory_item[10]} + else + total_width='N/A' + fi + total_width="${C1}data$SEP3${C2} $total_width " + fi + memory_line="${C1}Bank$SEP3${C2} $bank ${C1}slot$SEP3${C2} $slot ${C1}size$SEP3${C2} $device_size $device_speed" + if [[ $( calculate_line_length "$memory_line$device_type" ) -le $COLS_INNER ]];then + memory_line="$memory_line$device_type" + device_type='' + fi + line_3="$manufacturer$part_nu$serial_nu" + line_2="$device_type$data_width$total_width" + # echo $( calculate_line_length "$memory_line" ) + # echo $( calculate_line_length "$memory_line$line_2" ) + if [[ $( calculate_line_length "$memory_line$line_2$line_3" ) -gt $COLS_INNER ]];then + memory_line=$( create_print_line "$line_starter" "$memory_line${CN}" ) + print_screen_output "$memory_line" + memory_line="$line_2" + line_starter=' ' + if [[ -n $line_3 && $( calculate_line_length "$memory_line$line_3" ) -gt $COLS_INNER ]];then + memory_line=$( create_print_line "$line_starter" "$memory_line${CN}" ) + print_screen_output "$memory_line" + memory_line="$line_3" + else + memory_line="$line_2$line_3" + fi + else + memory_line="$memory_line$line_2$line_3" + fi fi memory_line=$( create_print_line "$line_starter" "$memory_line${CN}" ) print_screen_output "$memory_line" - line_starter='' + line_starter=' ' done memory_line=' ' fi diff --git a/inxi.changelog b/inxi.changelog index 42bd259..ccd0233 100755 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,19 @@ +===================================================================================== +Version: 2.1.91 +Patch Version: 00 +Script Date: 2014-08-12 +----------------------------------- +Changes: +----------------------------------- +New version, new tarball. This is a transitional version, most -x/-xx/-xxx data is now +working, but help/man does not have that yet, until I finalize the order. + +Fixed dmidecode issues, showing extra data types for -m, added line length handling +so -m is properly integrated with rest of inxi re max line lengths. + +----------------------------------- +-- Harald Hope - Tue, 12 Aug 2014 18:11:29 -0700 + ===================================================================================== Version: 2.1.90 Patch Version: 00