diff --git a/inxi b/inxi index bfabb85..523329a 100755 --- a/inxi +++ b/inxi @@ -40,8 +40,8 @@ use POSIX qw(uname strftime ttyname); ## INXI INFO ## my $self_name='inxi'; -my $self_version='3.2.02'; -my $self_date='2021-01-10'; +my $self_version='3.3.00'; +my $self_date='2021-01-28'; my $self_patch='00'; ## END INXI INFO ## @@ -66,8 +66,8 @@ my (%alerts,%build_prop,%client,%colors,%debugger,%dl,%files, ## Arrays # ps_aux is full output, ps_cmd is only the last 10 columns to last -my (@app,@dmesg_boot,@devices_audio,@devices_graphics,@devices_network, -@devices_hwraid,@devices_timer,@dmi,@gpudata,@ifs,@ifs_bsd, +my (@app,@dmesg_boot,@devices_audio,@devices_bluetooth,@devices_graphics, +@devices_network,@devices_hwraid,@devices_timer,@dmi,@gpudata,@ifs,@ifs_bsd, @paths,@proc_partitions,@ps_aux,@ps_cmd,@ps_gui,@sensors_exclude,@sensors_use, @sysctl,@sysctl_battery,@sysctl_sensors,@sysctl_machine,@uname,@usb); ## Disk arrays @@ -79,13 +79,14 @@ my @test = (0,0,0,0,0); my ($b_active_general,$b_active_lvm, $b_admin,$b_android,$b_arm,$b_bb_ps,$b_block_tool,$b_build_prop, $b_display,$b_dmesg_boot_check,$b_dmi,$b_dmidecode_force, -$b_fake_bsd,$b_fake_cpu,$b_fake_dboot,$b_fake_dmidecode,$b_fake_logical,$b_fake_pciconf, -$b_fake_raid,$b_fake_sensors,$b_fake_sysctl,$b_fake_usbdevs,$b_force_display, +$b_fake_bluetooth,$b_fake_bsd,$b_fake_cpu,$b_fake_dboot,$b_fake_dmidecode, +$b_fake_logical,$b_fake_pciconf,$b_fake_raid,$b_fake_sensors,$b_fake_sysctl, +$b_fake_usbdevs,$b_force_display, $b_gpudata,$b_hddtemp_force,$b_irc,$b_log,$b_log_colors,$b_log_full,$b_lvm,$b_lvm_data, $b_man,$b_mapper,$b_mdadm,$b_mem,$b_mips, $b_no_html_wan,$b_no_sudo,$b_pci,$b_pci_tool,$b_pkg,$b_ppc,$b_proc_partitions, $b_ps_gui,$b_root,$b_running_in_display,$b_sensors,$b_skip_dig, -$b_slot_tool,$b_soc_audio,$b_soc_gfx,$b_soc_net,$b_soc_timer,$b_sparc, +$b_slot_tool,$b_soc_audio,$b_soc_bluetooth,$b_soc_gfx,$b_soc_net,$b_soc_timer,$b_sparc, $b_swaps,$b_sysctl,$b_usb,$b_usb_check,$b_usb_sys,$b_usb_tool, $b_wmctrl); ## Disk checks @@ -242,7 +243,7 @@ sub check_tools { } # note: gnu/linux has sysctl so it may be used that for something if present # there is lspci for bsds so doesn't hurt to check it - if ($b_lvm || $b_pci || $b_sysctl){ + if ($b_lvm || $b_pci || $b_sysctl || $show{'bluetooth'}){ if (!$bsd_type){ if ($b_pci ){ $commands{'lspci'} = '-n'; @@ -283,6 +284,13 @@ sub check_tools { } } %commands = (); + if ($show{'bluetooth'}){ + # hangs when bluetooth service is enabled + # $commands{'bt-adapter'} = '-l'; + # hangs endlessly + # $commands{'bluetoothctl'} = 'list'; + $commands{'hciconfig'} = 'linux'; + } if ($show{'sensor'}){ $commands{'sensors'} = 'linux'; } @@ -1392,6 +1400,7 @@ sub run_debugger { print $line3; if (!$b_debug){ audio_data(); + bluetooth_data(); disk_data(); display_data(); network_data(); @@ -1507,6 +1516,19 @@ sub audio_data { push(@files,@files2) if @files2; copy_files(\@files,'audio'); } +sub bluetooth_data { + print "Collecting bluetooth data...\n"; +# no warnings 'uninitialized'; + my @cmds = ( + # ['bluetoothctl','list'], # do not use, hangs!! + # ['bt-adapter','-l'], # hangs once bluetooth service is enabled + ['hciconfig','-a'], + ['hcidump',''], + ['hcitool','dev'], + ); + run_commands(\@cmds,'bluetooth'); +} + ## NOTE: >/dev/null 2>&1 is sh, and &>/dev/null is bash, fix this # ls -w 1 /sysrs > tester 2>&1 sub disk_data { @@ -1836,7 +1858,6 @@ sub system_data { ['dmidecode',''], ['dmesg',''], ['gcc','--version'], - ['hciconfig','-a'], ['initctl','list'], ['ipmi-sensors',''], ['ipmi-sensors','--output-sensor-thresholds'], @@ -1939,7 +1960,8 @@ sub run_self { my $w = ($debugger{'width'}) ? $debugger{'width'} : 120; my $iz = "$i$z"; $iz =~ s/[\s-]//g; - my $cmd = "$self_path/$self_name -FRfJLrploudma$i$z --slots --debug 10 -y $w > $data_dir/$self_name-FRfJLrploudma$iz-slots-y$w.txt 2>&1"; + my $self_file = "$data_dir/$self_name-FERfJLrploudma$iz-slots-y$w.txt"; + my $cmd = "$self_path/$self_name -FERfJLrploudma$i$z --slots --debug 10 -y $w > $self_file 2>&1"; system($cmd); copy($log_file, "$data_dir") or main::error_handler('copy-failed', "$log_file", "$!"); system("$self_path/$self_name --recommends -y 120 > $data_dir/$self_name-recommends-120.txt 2>&1"); @@ -2640,7 +2662,7 @@ sub check_items { $info_os = 'info-bsd'; } else { - @data = qw(blockdev dig dmidecode fdisk file hddtemp ifconfig ip ipmitool + @data = qw(blockdev dig dmidecode fdisk file hciconfig hddtemp ifconfig ip ipmitool ipmi-sensors lsblk lsusb lvs mdadm modinfo runlevel sensors smartctl strings sudo tree upower uptime); } @@ -2918,7 +2940,7 @@ sub item_data { 'rpm' => '', }, 'hciconfig' => { - 'info' => 'Experimental', + 'info' => '-E bluetooth HCI data', 'info-bsd' => '', 'apt' => 'bluez', 'pacman' => 'bluez-utils', @@ -4120,6 +4142,10 @@ sub get_options { 'D|disk' => sub { $show{'short'} = 0; $show{'disk'} = 1; }, + 'E|bluetooth' => sub { + $show{'short'} = 0; + $show{'bluetooth'} = 1; + $show{'bluetooth-forced'} = 1;}, 'f|flags|flag' => sub { $show{'short'} = 0; $show{'cpu'} = 1; @@ -4128,6 +4154,7 @@ sub get_options { $show{'short'} = 0; $show{'audio'} = 1; $show{'battery'} = 1; + $show{'bluetooth'} = 1; $show{'cpu'} = 1; $show{'disk'} = 1; $show{'graphic'} = 1; @@ -4297,6 +4324,7 @@ sub get_options { } if ($arg >= 5 ){ $show{'audio'} = 1; + $show{'bluetooth'} = 1; $show{'ram'} = 1; $show{'label'} = 1; $show{'optical-basic'} = 1; @@ -4315,6 +4343,7 @@ sub get_options { } if ($arg >= 7 ){ $b_downloader = 1 if ! check_program('dig'); + $show{'bluetooth-forced'} = 1; $show{'cpu-flag'} = 1; $show{'ip'} = 1; $show{'raid-forced'} = 1; @@ -4505,7 +4534,7 @@ sub get_options { $debugger{'test-1'} = 1; }, 'debug-width:i' => sub { my ($opt,$arg) = @_; - if ($arg =~ /^[0-9]+$/ && $arg >= 80){ + if ($arg =~ /^[0-9]+$/ && ($arg == 1 || $arg >= 80)){ $debugger{'width'} = $arg; } else { @@ -4772,10 +4801,10 @@ sub get_options { ( ( $bsd_type || $b_dmidecode_force ) && ($show{'machine'} || $show{'battery'}) ) ){ $b_dmi = 1; } - if ($show{'audio'} || $show{'graphic'} || $show{'network'} || $show{'raid'} || $show{'raid-forced'} ){ + if ($show{'audio'} || $show{'graphic'} || $show{'network'} || $show{'raid'} ){ $b_pci = 1; } - if ($show{'usb'} || $show{'audio'} || $show{'graphic'} || $show{'network'} ){ + if ($show{'usb'} || $show{'audio'} || $show{'bluetooth'} || $show{'graphic'} || $show{'network'} ){ $b_usb = 1; } if ($bsd_type && ($show{'short'} || $show{'system'} || $show{'battery'} || $show{'cpu'} || $show{'cpu-basic'} || @@ -4806,8 +4835,8 @@ sub show_options { it will display a short system summary." ], ['0', '', '', '' ], ['0', '', '', "You can use these options alone or together, - to show or add the item(s) you want to see: A, B, C, D, G, I, J, L, M, N, P, - R, S, W, d, f, i, j, l, m, n, o, p, r, s, t, u, w, --slots. + to show or add the item(s) you want to see: A, B, C, D, E, G, I, J, L, M, N, + P, R, S, W, d, f, i, j, l, m, n, o, p, r, s, t, u, w, --slots. If you use them with -v [level], -b or -F, $self_name will add the requested lines to the output." ], ['0', '', '', '' ], @@ -4837,11 +4866,13 @@ sub show_options { ['1', '-D', '--disk', "Hard Disk info, including total storage and details for each disk. Disk total used percentage includes swap ${partition_string} size(s)." ], + ['1', '-E', '--bluetooth', "Show bluetooth device data and report, if available. + Shows state, address, IDs, version info." ], ['1', '-f', '--flags', "All CPU $flags. Triggers -C. Not shown with -F to avoid spamming." ], ['1', '-F', '--full', "Full output. Includes all Upper Case line letters - except -W, plus --swap, -s and -n. Does not show extra verbose options such - as -d -f -i -l -m -o -p -r -t -u -x, unless specified." ], + (except -J, -W) plus --swap, -s and -n. Does not show extra verbose options such + as -d -f -i -J -l -m -o -p -r -t -u -x, unless specified." ], ['1', '-G', '--graphics', "Graphics info (devices(s), drivers, display protocol (if available), display server/Wayland compositor, resolution, renderer, OpenGL version)." ], @@ -4903,22 +4934,23 @@ sub show_options { Should not be used with -b or -F. Example: $self_name^-v^4" ], ['2', '0', '', "Same as: $self_name" ], ['2', '1', '', "Basic verbose, -S + basic CPU + -G + basic Disk + -I." ], - ['2', '2', '', "Networking card (-N), Machine (-M), Battery (-B; if present), + ['2', '2', '', "Networking device (-N), Machine (-M), Battery (-B; if present), and, if present, basic RAID (devices only; notes if inactive). Same as $self_name^-b" ], ['2', '3', '', "Advanced CPU (-C), battery (-B), network (-n); triggers -x. " ], ['2', '4', '', "$partition_string_u size/used data (-P) for (if present) /, /home, /var/, /boot. Shows full disk data (-D). " ], - ['2', '5', '', "Audio card (-A), sensors (-s), memory/RAM (-m), - $partition_string label^(-l), full swap (-j), UUID^(-u), short form - of optical drives, standard RAID data (-R). " ], + ['2', '5', '', "Audio device (-A), sensors (-s), memory/RAM (-m), + bluetooth (if present), $partition_string label^(-l), full swap (-j), + UUID^(-u), short form of optical drives, RAID data (if present)." ], ['2', '6', '', "Full $partition_string (-p), unmounted $partition_string (-o), optical drive (-d), USB (-J), full RAID; triggers -xx." ], - ['2', '7', '', "Network IP data (-i); triggers -xxx."], + ['2', '7', '', "Network IP data (-i), bluetooth and RAID forced; + triggers -xxx."], ['2', '8', '', "Everything available, including logical (-L), - repos (-r), processes (-tcm), PCI slots (--slots)."], + repos (-r), processes (-tcm), PCI slots (--slots); triggers admin (-a)."], ); # if distro maintainers don't want the weather feature disable it if ( $use{'weather'} ){ @@ -4962,6 +4994,8 @@ sub show_options { than 9, otherwise hex; microcode - format: hex." ], ['2', '-d,-D', '', "If available: logical and physical block sizes; drive family; maj:min, USB drive specifics; SMART report." ], + ['2', '-E', '', "If available: in Report:, adds Info: line: acl-mtu, + sco-mtu, link-policy, link-mode, service-classes." ], ['2', '-G', '', "If available: Xorg Display ID, Screens total, default Screen, current Screen; per X Screen: resolution, dpi, size, diagonal; per Monitor: resolution; hz; dpi; size; diagonal; list of alternate kernel modules/drivers @@ -4984,7 +5018,7 @@ sub show_options { ['1', '-x', '--extra', "Adds the following extra data (only works with verbose or line output, not short form):" ], ['2', '-A', '', "Specific vendor/product information (if relevant); - PCI Bus ID/USB ID number of card; Version/port(s)/driver version (if available)." ], + PCI/USB ID of device; Version/port(s)/driver version (if available)." ], ['2', '-B', '', "Vendor/model, status (if available); attached devices (e.g. wireless mouse, keyboard, if present)." ], ['2', '-C', '', "CPU $flags (short list, use -f to see full list); @@ -4996,8 +5030,10 @@ sub show_options { ['2', '-D', '', "HDD temp with disk data if you have hddtemp installed, if you are root, or if you have added to /etc/sudoers (sudo v. 1.7 or newer). Example:^^ALL^=^NOPASSWD:^/usr/sbin/hddtemp" ], + ['2', '-E', '', "PCI/USB Bus ID of device, driver version, + LMP version." ], ['2', '-G', '', "Specific vendor/product information (if relevant); - PCI Bus ID/USB ID number of card; Direct rendering status (in X); Screen + PCI/USB ID of device; Direct rendering status (in X); Screen number GPU is running on (Nvidia only)." ], ['2', '-i', '', "For IPv6, show additional scope addresses: Global, Site, Temporary, Unknown. See --limit for large counts of IP addresses." ], @@ -5010,7 +5046,7 @@ sub show_options { ['2', '-L', '', "For VG > LV, and other Devices, dm:" ], ['2', '-m,--memory-modules', '', "Max memory module size (if available), device type." ], ['2', '-N', '', "Specific vendor/product information (if relevant); - PCI Bus ID/USB ID number of card; Version/port(s)/driver version (if available)." ], + PCI/USB ID of device; Version/port(s)/driver version (if available)." ], ['2', '-o,-p,-P', '', "Add mapped: name if partition mapped." ], ['2', '-r', '', "Packages, see -Ix." ], ['2', '-R', '', "md-raid: second RAID Info line with extra data: @@ -5036,10 +5072,11 @@ sub show_options { ['2', '-C', '', "L1/L3 cache (if root and dmidecode installed)." ], ['2', '-D', '', "Disk transfer speed; NVMe lanes; Disk serial number; LVM volume group free space (if available)." ], - ['2', '-G', '', "Chip vendor:product ID for each video card; OpenGL + ['2', '-E', '', "Chip vendor:product ID, LMP subversion." ], + ['2', '-G', '', "Chip vendor:product ID for each video device; OpenGL compatibility version, if free drivers and available; Xorg compositor; alternate Xorg drivers (if available). Alternate means driver is on automatic - driver check list of Xorg for the card vendor, but is not installed on system; + driver check list of Xorg for the device vendor, but is not installed on system; Xorg dpi." ], ['2', '-I', '', "Other detected installed gcc versions (if present). System default runlevel. Adds parent program (or tty) for shell info if not in @@ -5072,11 +5109,13 @@ sub show_options { ['0', '', '', ''], ['1', '-xxx', '--extra 3', "Show extra, extra, extra data (only works with verbose or line output, not short form):" ], - ['2', '-A', '', "Serial number." ], + ['2', '-A', '', "Serial number, class ID." ], ['2', '-B', '', "Chemistry, cycles, location (if available)." ], ['2', '-C', '', "CPU voltage, external clock speed (if root and dmidecode installed)." ], ['2', '-D', '', "Firmware rev. if available; partition scheme, in some cases; disk rotation speed (if detected)." ], + ['2', '-E', '', "Serial number, class ID, HCI version and revision." ], + ['2', '-G', '', "Serial number, class ID." ], ['2', '-I', '', "For 'Shell:' adds ([su|sudo|login]) to shell name if present; adds default shell+version if different; for 'running in:' adds (SSH) if SSH session; adds wakeups: (from suspend) to Uptime." ], @@ -5084,7 +5123,7 @@ sub show_options { ['2', '-m,--memory-modules', '', "Width of memory bus, data and total (if present and greater than data); Detail for Type, if present; module voltage, if available; serial number." ], - ['2', '-N', '', "Serial number." ], + ['2', '-N', '', "Serial number, class ID." ], ['2', '-R', '', "zfs-raid: portion allocated (used) by RAID devices/arrays. md-raid: system md-raid support types (kernel support, read ahead, RAID events). Hardware RAID rev, ports, specific vendor/product information." ], @@ -5730,6 +5769,12 @@ sub dmi_cleaner { return $string; } +sub general_cleaner { + my ($string) = @_; + my $cleaner = '\b(defauult string|empty|none|undefined.*|unknown|unspecified)\b'; + $string =~ s/$cleaner//i; + return $string; +} # args: $1 - size in KB, return KB, MB, GB, TB, PB, EB; $2 - 'string'; # $3 - default value if null # returns string with units or array or size unmodified if not numeric @@ -5859,6 +5904,7 @@ sub row_defaults { 'arm-pci' => 'No ARM data found for this feature.', 'battery-data' => 'No system Battery data found. Is one present?', 'battery-data-sys' => 'No /sys data found.', + 'bluetooth-data' => 'No Bluetooth data was found.', 'cpu-bugs-null' => 'No CPU vulnerability/bugs data available.', 'cpu-model-null' => 'Model N/A', 'cpu-speeds' => "No speed data found for $id cores.", @@ -6475,6 +6521,9 @@ sub card_data { $chip_id = $row->[6]; } $rows[$j]->{main::key($num++,0,2,'chip ID')} = $chip_id; + if ($extra > 2 && $row->[1]){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = $row->[1]; + } } #print "$row->[0]\n"; } @@ -6544,6 +6593,7 @@ sub usb_data { foreach my $row (@usb){ # a device will always be the second or > device on the bus if ($row->[1] > 1 && $row->[7] eq $id){ + # print Data::Dumper::Dumper $row; $num = 1; # makre sure to reset, or second device trips last flag ($driver,$path_id,$product) = ('','',''); @@ -6564,6 +6614,9 @@ sub usb_data { $row->[7] ||= 'N/A'; $rows[$j]->{main::key($num++,0,2,'chip ID')} = $row->[7]; } + if ($extra > 2 && defined $row->[5] && $row->[5] ne ''){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = "$row->[4]$row->[5]"; + } if ($extra > 2 && $row->[16]){ $rows[$j]->{main::key($num++,0,2,'serial')} = main::apply_filter($row->[16]); } @@ -7024,6 +7077,291 @@ sub upower_data { } +## BluetoothData +{ +package BluetoothData; +my ($b_hci_error,$b_hci,%hci); +sub get { + eval $start if $b_log; + my (@data,@rows); + my $num = 0; + if (($b_arm || $b_mips) && !$b_soc_bluetooth && !$b_pci_tool){ + # do nothing, but keep the test conditions to force + # the non arm case to always run + #my $type = ($b_arm) ? 'arm' : 'mips'; + #my $key = 'Message'; + #push(@rows,{ + #main::key($num++,0,1,$key) => main::row_defaults($type . '-pci',''), + #},); + } + else { + @data = card_data(); + push(@rows,@data); + } + @data = usb_data(); + push(@rows,@data); + if (!@rows){ + if ($show{'bluetooth-forced'}){ + my $key = 'Message'; + push(@rows,{ + main::key($num++,0,1,$key) => main::row_defaults('bluetooth-data'), + },); + } + } + # if there are any unhandled hci items print them out + if (%hci){ + push(@rows,advanced_data('check','')); + } + eval $end if $b_log; + return @rows; +} + +sub card_data { + eval $start if $b_log; + my (@rows); + my ($j,$num) = (0,1); + foreach my $row (@devices_bluetooth){ + $num = 1; + $j = scalar @rows; + my $driver = ($row->[9]) ? $row->[9] : 'N/A'; + my $card = $row->[4]; + $card = ($card) ? main::pci_cleaner($card,'output') : 'N/A'; + # have seen absurdly verbose card descriptions, with non related data etc + if (length($card) > 85 || $size{'max'} < 110){ + $card = main::pci_long_filter($card); + } + push(@rows, { + main::key($num++,1,1,'Device') => $card, + },); + if ($extra > 0 && $b_pci_tool && $row->[12]){ + my $item = main::get_pci_vendor($row->[4],$row->[12]); + $rows[$j]->{main::key($num++,0,2,'vendor')} = $item if $item; + } + $rows[$j]->{main::key($num++,1,2,'driver')} = $driver; + if ($extra > 0 && $row->[9] && !$bsd_type){ + my $version = main::get_module_version($row->[9]); + $rows[$j]->{main::key($num++,0,3,'v')} = $version if $version; + } + if ($b_admin && $row->[10]){ + $row->[10] = main::get_driver_modules($row->[9],$row->[10]); + $rows[$j]->{main::key($num++,0,3,'alternate')} = $row->[10] if $row->[10]; + } + if ($extra > 0){ + $rows[$j]->{main::key($num++,0,2,'bus ID')} = (!$row->[2] && !$row->[3]) ? 'N/A' : "$row->[2].$row->[3]"; + } + if ($extra > 1){ + my $chip_id = 'N/A'; + if ($row->[5] && $row->[6]){ + $chip_id = "$row->[5]:$row->[6]"; + } + elsif ($row->[6]){ + $chip_id = $row->[6]; + } + $rows[$j]->{main::key($num++,0,2,'chip ID')} = $chip_id; + if ($extra > 2 && $row->[1]){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = $row->[1]; + } + } + push(@rows,advanced_data('pci',"$row->[2].$row->[3]")) if defined $row->[2] && defined $row->[3]; + #print "$row->[0]\n"; + } + eval $end if $b_log; + return @rows; +} +sub usb_data { + eval $start if $b_log; + return if !@usb; + my (@rows,$driver,$path_id,$product); + my ($j,$num) = (0,1); + foreach my $row (@usb){ + #print Data::Dumper::Dumper $row; + if ($row->[14] && $row->[14] eq 'Bluetooth'){ + #print Data::Dumper::Dumper $row; + $num = 1; + $j = scalar @rows; + # makre sure to reset, or second device trips last flag + ($driver,$path_id,$product) = ('','',''); + $product = main::cleaner($row->[13]) if $row->[13]; + $driver = ($row->[15]) ? $row->[15] : 'N/A'; + $path_id = $row->[2] if $row->[2]; +# $product ||= 'N/A'; + push(@rows, { + main::key($num++,1,1,'Device') => $product, + main::key($num++,0,2,'type') => 'USB', + main::key($num++,1,2,'driver') => $driver, + },); + if ($extra > 0 && $row->[15] && !$bsd_type){ + my $version = main::get_module_version($row->[15]); + $rows[$j]->{main::key($num++,0,3,'v')} = $version if $version; + } + if ($extra > 0){ + $rows[$j]->{main::key($num++,0,2,'bus ID')} = "$path_id:$row->[1]"; + } + if ($extra > 1){ + $row->[7] ||= 'N/A'; + $rows[$j]->{main::key($num++,0,2,'chip ID')} = $row->[7]; + } + if ($extra > 2 && defined $row->[5] && $row->[5] ne ''){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = "$row->[4]$row->[5]"; + } + if ($extra > 2 && $row->[16]){ + $rows[$j]->{main::key($num++,0,2,'serial')} = main::apply_filter($row->[16]); + } + push(@rows,advanced_data('usb',$path_id)) if $path_id; + } + } + eval $end if $b_log; + return @rows; +} +sub advanced_data { + my ($type,$bus_id) = @_; + eval $start if $b_log; + my ($path,@rows,@temp); + my ($j,$num,$k,$l,$m,$id,$id2) = (0,1,2,3,4,'',''); + hci_data() if !$b_hci && $alerts{'hciconfig'}->{'action'} eq 'use'; + if ($type eq 'usb'){ + $path = "/sys/bus/usb/devices/$bus_id:*/bluetooth"; + } + elsif ($type eq 'pci') { + $path = "/sys/bus/pci/devices/0000:$bus_id/bluetooth"; + } + if ($type ne 'check'){ + @temp = main::globber("$path/*") if $path; + @temp = map {$_ =~ s|^/.*/||;$_;} @temp if @temp; + } + elsif ($type eq 'check' && %hci){ + @temp = keys %hci; + $id = '-ID'; + ($k,$l,$m) = (1,2,3); + } + if (@temp && %hci){ + foreach my $item (@temp){ + if ($hci{$item}){ + $id2 = $item if $id; + $j = scalar @rows; + push(@rows,{ + main::key($num++,1,$k,'Report' . $id) => $id2, + },); + $rows[$j]->{main::key($num++,0,$l,'ID')} = $item if !$id; + $rows[$j]->{main::key($num++,0,$l,'state')} = $hci{$item}->{'state'}; + if (my $btv = bluetooth_version($hci{$item}->{'lmp-version'})){ + $rows[$j]->{main::key($num++,0,$l,'bt-v')} = $btv; + } + if ($extra > 0 && $hci{$item}->{'lmp-version'}){ + $rows[$j]->{main::key($num++,0,$l,'lmp-v')} = $hci{$item}->{'lmp-version'}; + if ($extra > 1 && $hci{$item}->{'lmp-subversion'}){ + $rows[$j]->{main::key($num++,0,$m,'sub-v')} = $hci{$item}->{'lmp-subversion'}; + } + } + if ($extra > 0 && $hci{$item}->{'hci-version'} && ($extra > 2 || !$hci{$item}->{'lmp-version'} || + ($hci{$item}->{'lmp-version'} && $hci{$item}->{'lmp-version'} ne $hci{$item}->{'hci-version'}))){ + $rows[$j]->{main::key($num++,0,$l,'hci-v')} = $hci{$item}->{'hci-version'}; + if ($extra > 1 && $hci{$item}->{'hci-revision'}){ + $rows[$j]->{main::key($num++,0,$m,'rev')} = $hci{$item}->{'hci-revision'}; + } + } + $rows[$j]->{main::key($num++,0,$l,'address')} = main::apply_filter($hci{$item}->{'address'}); + if ($b_admin && + ($hci{$item}->{'acl-mtu'} || $hci{$item}->{'sco-mtu'} || $hci{$item}->{'link-policy'})){ + $j = scalar @rows; + push(@rows,{ + main::key($num++,1,$l,'Info') => '', + },); + if ($hci{$item}->{'acl-mtu'}){ + $rows[$j]->{main::key($num++,0,$m,'acl-mtu')} = $hci{$item}->{'acl-mtu'}; + } + if ($hci{$item}->{'sco-mtu'}){ + $rows[$j]->{main::key($num++,0,$m,'sco-mtu')} = $hci{$item}->{'sco-mtu'}; + } + if ($hci{$item}->{'link-policy'}){ + $rows[$j]->{main::key($num++,0,$m,'link-policy')} = $hci{$item}->{'link-policy'}; + } + if ($hci{$item}->{'link-mode'}){ + $rows[$j]->{main::key($num++,0,$m,'link-mode')} = $hci{$item}->{'link-mode'}; + } + if ($hci{$item}->{'service-classes'}){ + $rows[$j]->{main::key($num++,0,$m,'service-classes')} = $hci{$item}->{'service-classes'}; + } + } + delete $hci{$item}; + } + } + } + if ($alerts{'hciconfig'}->{'action'} ne 'use' && !$b_hci_error){ + my $key = 'Message'; + push(@rows,{ + main::key($num++,0,1,$key) => $alerts{'hciconfig'}->{$alerts{'hciconfig'}->{'action'}}, + },); + $b_hci_error = 1; + } + eval $end if $b_log; + return @rows; +} +sub hci_data { + eval $start if $b_log; + $b_hci = 1; + my (@data,$id); + if ($b_fake_bluetooth){ + my $file; + $file = ""; + @data = main::reader($file,'strip'); + } + else { + my $cmd = "$alerts{'hciconfig'}->{'path'} -a 2>/dev/null"; + @data = main::grabber($cmd,'', 'strip'); + } + # print Data::Dumper::Dumper \@data; + main::log_data('dump','@data', \@data) if $b_log; + foreach (@data){ + if (/^(hci[0-9]+):\s+Type:\s+(.*)\s+Bus:\s+([\S]+)/){ + $id = $1; + $hci{$id} = { + 'type'=> $2, + 'bus' => $3, + }; + } + elsif (/^BD Address:\s+([0-9A-F:]*)\s+ACL\s+MTU:\s+([0-9:]+)\s+SCO MTU:\s+([0-9:]+)/){ + $hci{$id}->{'address'} = $1; + $hci{$id}->{'acl-mtu'} = $2; + $hci{$id}->{'sco-mtu'} = $3; + } + elsif (/^(UP.*|DOWN.*)/){ + $hci{$id}->{'state'} = lc($1); + } + elsif (/^HCI Version:\s+([0-9\.]+)\s+.*Revision:\s+0x([0-9a-f]+)/){ + $hci{$id}->{'hci-version'} = $1; + $hci{$id}->{'hci-revision'} = $2; + } + elsif (/^LMP Version:\s+([0-9\.]+)\s+.*Subversion:\s+0x([0-9a-f]+)/){ + $hci{$id}->{'lmp-version'} = $1; + $hci{$id}->{'lmp-subversion'} = $2; + } + elsif (/^Link policy:\s+(.*)/){ + $hci{$id}->{'link-policy'} = lc($1); + } + elsif (/^Link mode:\s+(.*)/){ + $hci{$id}->{'link-mode'} = lc($1); + } + elsif (/^Service Classes?:\s+(.+)/){ + $hci{$id}->{'service-classes'} = main::general_cleaner(lc($1)); + } + } + # print Data::Dumper::Dumper \%hci; + main::log_data('dump','%hci', \%hci) if $b_log; + eval $end if $b_log; +} +sub bluetooth_version { + eval $start if $b_log; + my ($lmp) = @_; + return if !main::is_numeric($lmp); + $lmp = int($lmp); + # conveniently, LMP starts with 0, so perfect for array indexes + my @bt = qw(1.0b 1.1 1.2 2.0 2.1 3.0 4.0 4.1 4.2 5.0 5.1 5.2); + return $bt[$lmp]; + eval $end if $b_log; +} +} + ## CpuData { package CpuData; @@ -9494,7 +9832,8 @@ sub smartctl_data { $data->[$i]{'speed'} = $2 if !$data->[$i]{'speed'}; } } - elsif ($split[$a] eq 'Sector Sizes'){ + # seen both Size and Sizes + elsif ($split[$a] =~ /^Sector Sizes?$/ ){ if( $data->[$i]{'type'} || !$data->[$i]{'block-logical'} || !$data->[$i]{'block-physical'} ){ if ($split[$r] =~ m|^([0-9]+) bytes logical/physical| ){ $data->[$i]{'block-logical'} = $1; @@ -9616,7 +9955,6 @@ sub smartctl_data { $data->[$i]{'smart-written'} = main::get_size($split[$r],'string'); } } - ## DEVICE OLD AGE ## # 191 G-Sense_Error_Rate 0x0032 001 001 000 Old_age Always - 291 elsif ($split[$a] eq 'G-Sense_Error_Rate'){ @@ -9932,23 +10270,23 @@ sub set_vendors { # H10 HBRPEKNX0202A NVMe INTEL 512GB ['(\bINTEL\b|^SSD(PAM|SA2))','\bINTEL\b','Intel',''], # note: S[AV][1-9][0-9] can trigger false positives - ['(KINGSTON|DataTraveler|DT\s?(DUO|Microduo|101)|^SMS|^SHS|^SS0|^SUV|^Ultimate CF|HyperX|^S[AV][1234]00|^SKYMEDI)','KINGSTON','Kingston',''], # maybe SHS: SHSS37A SKC SUV + ['(KINGSTON|DataTraveler|DT\s?(DUO|Microduo|101)|^RBU|^SMS|^SHS|^SS0|^SUV|^Ultimate CF|HyperX|^S[AV][1234]00|^SKYMEDI)','KINGSTON','Kingston',''], # maybe SHS: SHSS37A SKC SUV # must come before samsung MU. NOTE: toshiba can have: TOSHIBA_MK6475GSX: mush: MKNSSDCR120GB_ ['(^MKN|Mushkin)','Mushkin','Mushkin',''], # MKNS # MU = Multiple_Flash_Reader too risky: |M[UZ][^L] HD103SI HD start risky # HM320II HM320II - ['(SAMSUNG|^MCG[0-9]+GC|^MCC|^MCBOE|\bEVO\b|^[GS]2 Portable|^DS20|^[DG]3 Station|^DUO\b|^P3|^[BC]GN|^[CD]JN|^BJ[NT]|^[BC]WB|^(HM|SP)[0-9]{2}|^MZMPC|^HD[0-9]{3}[A-Z]{2}$|SV[0-9])','SAMSUNG','Samsung',''], # maybe ^SM, ^HM + ['(SAMSUNG|^MCG[0-9]+GC|^MCC|^MCBOE|\bEVO\b|^[GS]2 Portable|^DS20|^[DG]3 Station|^DUO\b|^P3|^[BC]GN|^[CD]JN|^BJ[NT]|^[BC]WB|^(HM|SP)[0-9]{2}|^MZMPC|^HD[0-9]{3}[A-Z]{2}$|SV[0-9]|E[A-Z][1-9]QT|YP\b)','SAMSUNG','Samsung',''], # maybe ^SM, ^HM # Android UMS Composite? - ['(SanDisk|^SDS[S]?[DQ]|^D[AB]4|^SL([0-9]+)G|^AFGCE|^ABLCD|^SDW[1-9]|^U3\b|^SU[0-9]|^DX[1-9]|ULTRA\sFIT|Clip Sport|Cruzer|^Extreme|iXpand)','SanDisk','SanDisk',''], + ['(SanDisk|^SDS[S]?[DQ]|^D[AB]4|^SL([0-9]+)G|^AFGCE|^ABLCD|^SDW[1-9]|^SEM[1-9]|^U3\b|^SU[0-9]|^DX[1-9]|ULTRA\sFIT|Clip Sport|Cruzer|^Extreme|iXpand)','SanDisk','SanDisk',''], # these are HP/Sandisk cobranded. DX110064A5xnNMRI ids as HP and Sandisc ['(^DX[1-9])','^(HP\b|SANDDISK)','Sandisk/HP',''], # ssd drive, must come before seagate ST test - # real, SSEAGATE Backup+; XP1600HE30002 | 024 HN (spinpoint) - ['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^5AS|^BUP|Expansion Desk|^Expansion|FreeAgent|GoFlex|Backup(\+|\s?Plus)\s?(Hub)?|OneTouch)','[S]?SEAGATE','Seagate',''], - ['^(WD|WL[0]9]|Western Digital|My (Book|Passport)|\d*LPCX|Elements|easystore|MD0|M000|EARX|EFRX|\d*EAVS|0JD|JP[CV]|[0-9]+(BEV|(00)?AAK|AAV|AZL|EA[CD]S)|3200[AB]|2500[BJ]|5000[AB]|6400[AB]|7500[AB]|i HTS|00[ABL][A-Z]{2})','(^WDC|Western\s?Digital)','Western Digital',''], + # real, SSEAGATE Backup+; XP1600HE30002 | 024 HN (spinpoint) ; possible usb: 24AS + ['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^5AS|^BUP|Expansion Desk|^Expansion|FreeAgent|GoFlex|Backup(\+|\s?Plus)\s?(Hub)?|OneTouch|Slim\s? BK)','[S]?SEAGATE','Seagate',''], + ['^(WD|WL[0]9]|Western Digital|My (Book|Passport)|\d*LPCX|Elements|easystore|MD0|M000|EARX|EFRX|\d*EAVS|0JD|JP[CV]|[0-9]+(BEV|(00)?AAK|AAV|AZL|EA[CD]S)|3200[AB]|2500[BJ]|EA[A-Z]S|20G2|5000[AB]|6400[AB]|7500[AB]|i HTS|00[ABL][A-Z]{2})','(^WDC|Western\s?Digital)','Western Digital',''], # rare cases WDC is in middle of string ['(\bWDC\b)','','Western Digital',''], ## THEN BETTER KNOWN ONESs ## - ['^(A-DATA|ADATA|AX[MN]|CH11|HV[1-9]|IM2|HD[1-9])','^(A-DATA|ADATA)','A-Data',''], + ['^(A-DATA|ADATA|AX[MN]|CH11|HV[1-9]|IM2|HD[1-9]|HDD\s?CH)','^(A-DATA|ADATA)','A-Data',''], ['^ASUS','^ASUS','ASUS',''], # ATCS05 can be hitachi travelstar but not sure ['^ATP','^ATP\b','ATP',''], @@ -9961,7 +10299,7 @@ sub set_vendors { ['^(HGST|Touro|54[15]0|7250)','^HGST','HGST (Hitachi)',''], # HGST HUA ['^(Hitachi|HCS|HD[PST]|DK[0-9]|IC|HT|HU|HMS|HDE|0G[0-9])','^Hitachi','Hitachi',''], # vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G ;GB0500EAFYL GB starter too generic? - ['^(HP\b|[MV]B[0-6]|G[BJ][0-9]|DF[0-9]|F[BK]|0-9]|PSS|XR[0-9]{4}|v[0-9]{3}[bgorw]$|x[0-9]{3}[w]$)','^HP','HP',''], + ['^(HP\b|[MV]B[0-6]|G[BJ][0-9]|DF[0-9]|F[BK]|0-9]|PSS|XR[0-9]{4}|c350|v[0-9]{3}[bgorw]$|x[0-9]{3}[w]$)','^HP','HP',''], ['^(Lexar|LSD|JumpDrive|JD\s?Firefly|WorkFlow)','^Lexar','Lexar',''], # mmc-LEXAR_0xb016546c; JD Firefly; # OCZSSD2-2VTXE120G is OCZ-VERTEX2_3.5 ['^(OCZ|APOC|D2|DEN|DEN|DRSAK|EC188|FTNC|GFGC|MANG|MMOC|NIMC|NIMR|PSIR|RALLY2|TALOS2|TMSC|TRSAK)','^OCZ[\s-]','OCZ',''], @@ -9979,10 +10317,12 @@ sub set_vendors { ['^(AbonMax|ASU[0-9])','^AbonMax','AbonMax',''], ['^Acasis','^Acasis','Acasis (hub)',''], ['^Acclamator','^Acclamator','Acclamator',''], + ['^(Actions|HS USB Flash)','^Actions','Actions',''], ['^Addlink','^Addlink','Addlink',''], ['^(ADplus|SuperVer\b)','^ADplus','ADplus',''], ['^ADTRON','^(ADTRON)','Adtron',''], ['^(Advantech|SQF)','^Advantech','Advantech',''], + ['^(Agile|AGI)','^(AGI|Agile\s?Gear\s?Int[a-z]*)','AGI',''], ['^Aireye','^Aireye','Aireye',''], ['^Alcatel','^Alcatel','Alcatel',''], ['^Alfawise','^Alfawise','Alfawise',''], @@ -10012,7 +10352,7 @@ sub set_vendors { ['^BUSlink','^BUSlink','BUSlink',''], ['^(STMicro|SMI|CBA)','^(STMicroelectronics|SMI)','SMI (STMicroelectronics)',''], ['^Centerm','^Centerm','Centerm',''], - ['^Centon','^Centon','Centon',''], + ['^(Centon|DS pro)','^Centon','Centon',''], ['^(Chipsbank|CHIPSBNK)','^Chipsbank','Chipsbank',''], ['^CHN\b','','Zheino',''], ['^Clover','^Clover','Clover',''], @@ -10047,10 +10387,11 @@ sub set_vendors { ['^Emperor','^Emperor','Emperor',''], ['^Emtec','^Emtec','Emtec',''], ['^Energy','^Energy','Energy',''], + ['^eNova','^eNOVA','eNOVA',''], ['^Epson','^Epson','Epson',''], ['^(Etelcom|SSD051)','^Etelcom','Etelcom',''], # NOTE: ESA3... may be IBM PCIe SAD card/drives - ['^EXCELSTOR','^EXCELSTOR( TECHNO(LOGY)?)?','ExcelStor',''], + ['^(EXCELSTOR|r technology)','^EXCELSTOR( TECHNO(LOGY)?)?','ExcelStor',''], ['^EZLINK','^EZLINK','EZLINK',''], ['^Fantom','^Fantom( Drive[s]?)?','Fantom Drives',''], ['^Faspeed','^Faspeed','Faspeed',''], @@ -10084,7 +10425,7 @@ sub set_vendors { ['^HUAWEI','^HUAWEI','Huawei',''], ['^HyperX','^HyperX','HyperX',''], ['^Hyundai','^Hyundai','Hyundai',''], - ['^(IBM|DT)','^IBM','IBM',''], + ['^(IBM|DT|ESA[1-9])','^IBM','IBM',''], ['^IEI Tech','^IEI Tech(\.|nology)?( Corp(\.|oration)?)?','IEI Technology',''], ['^(Imation|Nano\s?Pro|HQT)','^Imation(\sImation)?','Imation',''], # Imation_ImationFlashDrive; TF20 is imation/tdk ['^(Inca\b|Npenterprise)','^Inca','Inca',''], @@ -10106,7 +10447,7 @@ sub set_vendors { ['^KimMIDI','^KimMIDI','KimMIDI',''], ['^Kimtigo','^Kimtigo','Kimtigo',''], ['^Kingchux[\s-]?ing','^Kingchux[\s-]?ing','Kingchuxing',''], - ['^KingDian','^KingDian','KingDian',''], + ['^(KingDian|NGF)','^KingDian','KingDian',''], ['^Kingfast','^Kingfast','Kingfast',''], ['^KingMAX','^KingMAX','KingMAX',''], ['^Kingrich','^Kingrich','KingrSU04Gich',''], @@ -10155,6 +10496,7 @@ sub set_vendors { # Monster MONSTER DIGITAL ['^(Monster\s)+(Digital)?|OD[\s-]?ADVANCE','^(Monster\s)+(Digital)?','Monster Digital',''], ['^Morebeck','^Morebeck','Morebeck',''], + ['^(Moser\s?Bear|MBIL)','^Moser\s?Bear','Moser Bear',''], ['^(Motile|SSM[0-9])','^Motile','Motile',''], ['^(Motorola|XT[0-9]{4})','^Motorola','Motorola',''], ['^Moweek','^Moweek','Moweek',''], @@ -10179,7 +10521,7 @@ sub set_vendors { ['PHISON[\s-]?','PHISON[\s-]?','Phison',''],# E12-256G-PHISON-SSD-B3-BB1 ['^Pioneer','Pioneer','Pioneer',''], ['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''], - ['^(PQI|Intelligent\s?Stick)','^PQI','PQI',''], + ['^(PQI|Intelligent\s?Stick|Cool\s?Drive)','^PQI','PQI',''], ['^(Premiertek|QSSD|Quaroni)','^Premiertek','Premiertek',''], ['^(Pretec|UltimateGuard)','Pretec','Pretec',''], # PS3109S9 is the result of an error condition with ssd drive @@ -10195,6 +10537,7 @@ sub set_vendors { ['^Runcore','^Runcore','Runcore',''], ['^Sabrent','^Sabrent','Sabrent',''], ['^Sage','^Sage(\s?Micro)?','Sage Micro',''], + ['^SAMSWEET','^SAMSWEET','Samsweet',''], ['^SandForce','^SandForce','SandForce',''], ['^Sannobel','^Sannobel','Sannobel',''], # SATADOM can be innodisk or supermirco: dom == disk on module @@ -10212,6 +10555,7 @@ sub set_vendors { ['^SH','','Smart Modular Tech.',''], ['^Skill','^Skill','Skill',''], ['^(SMART( Storage Systems)?|TX)','^(SMART( Storage Systems)?)','Smart Storage Systems',''], + ['^Sobetter','^Sobetter','Sobetter',''], ['^(S[FR]-|Sony)','^Sony','Sony',''], ['^STE[CK]','^STE[CK]','sTec',''], # wd bought this one ['^STmagic','^STmagic','STmagic',''], @@ -10243,7 +10587,8 @@ sub set_vendors { ['^TopSunlight','^TopSunlight','TopSunlight',''], ['^TOROSUS','^TOROSUS','Torosus',''], ['^([F]?TS|Transcend|JetDrive|JetFlash|USDU)','^Transcend','Transcend',''], - ['^(TrekStor|DS maxi|DataStation)','^TrekStor','TrekStor',''], + ['^(TrekStor|DS (maxi|pocket)|DataStation)','^TrekStor','TrekStor',''], + ['^(TwinMOS|TW[0-9])','^TwinMOS','TwinMOS',''], ['^UDinfo','^UDinfo','UDinfo',''], ['^USBTech','^USBTech','USBTech',''], ['^(UNIC2)','^UNIC2','UNIC2',''], @@ -10252,7 +10597,7 @@ sub set_vendors { ['^(OOS[1-9]|Utania)','Utania','Utania',''], ['^U-TECH','U-TECH','U-Tech',''], ['^VBOX','','VirtualBox',''], - ['^(Verbatim|STORE N GO|Vi[1-9])','^Verbatim','Verbatim',''], + ['^(Verbatim|STORE N GO|Vi[1-9]|OTG\s?Tiny)','^Verbatim','Verbatim',''], ['^V-GEN','^V-GEN','V-Gen',''], ['^(Victorinox|Swissflash)','^Victorinox','Victorinox',''], ['^(Visipro|SDVP)','^Visipro','Visipro',''], @@ -10269,7 +10614,7 @@ sub set_vendors { ['^XUNZHE','^XUNZHE','XUNZHE',''], ['^(Yeyian|valk)','^Yeyian','Yeyian',''], ['^(YUCUN|R880)','^YUCUN','YUCUN',''], - ['^ZALMAN','^ZALMAN','Zalman',''], + ['^(ZALMAN|ZM\b)','^ZALMAN','Zalman',''], ['^ZEUSLAP','^ZEUSLAP','ZEUSLAP',''], ['^(Zheino|CHN[0-9]|CNM)','^Zheino','Zheino',''], ['^(Zotac|ZTSSD)','^Zotac','Zotac',''], @@ -10620,6 +10965,9 @@ sub card_data { if ($extra > 1){ $rows[$j]->{main::key($num++,0,2,'chip ID')} = ($row->[5]) ? "$row->[5]:$row->[6]" : $row->[6]; } + if ($extra > 2 && $row->[1]){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = $row->[1]; + } #print "$row->[0]\n"; } eval $end if $b_log; @@ -10662,6 +11010,9 @@ sub usb_data { $row->[7] ||= 'N/A'; $rows[$j]->{main::key($num++,0,2,'chip ID')} = $row->[7]; } + if ($extra > 2 && defined $row->[5] && $row->[5] ne ''){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = "$row->[4]$row->[5]"; + } if ($extra > 2 && $row->[16]){ $rows[$j]->{main::key($num++,0,2,'serial')} = main::apply_filter($row->[16]); } @@ -12562,7 +12913,7 @@ sub get { } if ($show{'ip'}){ @data = wan_ip(); - push(@rows,@data); + push(@rows,@data) if @data; } eval $end if $b_log; return @rows; @@ -12627,6 +12978,9 @@ sub card_data { if ($extra > 1){ $rows[$j]->{main::key($num++,0,2,'chip ID')} = $chip_id; } + if ($extra > 2 && $row->[1]){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = $row->[1]; + } if ($show{'network-advanced'}){ my @data; if (!$bsd_type){ @@ -12663,7 +13017,7 @@ sub usb_data { foreach my $row (@usb){ # a device will always be the second or > device on the bus, except for # daisychained hubs - if ($row->[1] > 1 && $row->[4] ne '9'){ + if ($row->[1] > 1 && $row->[4] ne '09'){ $num = 1; ($driver,$path,$path_id,$product,$test,$type) = ('','','','','',''); $product = main::cleaner($row->[13]) if $row->[13]; @@ -12686,6 +13040,9 @@ sub usb_data { if ($extra > 1){ $rows[$j]->{main::key($num++,0,2,'chip ID')} = $row->[7]; } + if ($extra > 2 && defined $row->[5] && $row->[5] ne ''){ + $rows[$j]->{main::key($num++,0,2,'class ID')} = "$row->[4]$row->[5]"; + } if ($extra > 2 && $row->[16]){ $rows[$j]->{main::key($num++,0,2,'serial')} = main::apply_filter($row->[16]); } @@ -13061,8 +13418,9 @@ sub network_device { my ($b_network); # belkin=050d; d-link=07d1; netgear=0846; ralink=148f; realtek=0bda; # Atmel makes other stuff. NOTE: exclude 'networks': IMC Networks - my @tests = qw(wifi Wi-Fi.*Adapter Ethernet \bLAN\b WLAN Network\b Networking\b 802\.11 - Wireless.*Adapter 54\sMbps 100\/1000 Mobile\sBroadband Atheros D-Link.*Adapter + my @tests = qw(wifi Wi-Fi.*Adapter Ethernet \bLAN\b WLAN Network\b Networking\b + 802\.1[15] 802\.3 + Wireless.*Adapter 54\sMbps 100\/1000 NBase-T Mobile\sBroadband Atheros D-Link.*Adapter Dell.*Wireless D-Link.*Wireless Linksys Netgea Ralink Realtek.*Network Realtek.*Wireless Belkin.*Wireless Actiontec.*Wireless AirLink.*Wireless Asus.*Wireless Buffalo.*Wireless Davicom DWA-.*RangeBooster DWA-.*Wireless @@ -14314,6 +14672,7 @@ sub throttled { { package RaidData; # debugger switches +my $b_hw = 0; my $b_lvm = 0; my $b_md = 0; my $b_zfs = 0; @@ -14322,7 +14681,7 @@ sub get { eval $start if $b_log; my (@data,@hardware_raid,@rows,$key1,$val1); my $num = 0; - @hardware_raid = hw_data() if $b_hardware_raid; + @hardware_raid = hw_data() if $b_hardware_raid || $b_hw; raid_data() if !$b_raid; #print 'get: ', Data::Dumper::Dumper \@lvm_raid; #print 'get: ', Data::Dumper::Dumper \@md_raid; @@ -14461,13 +14820,13 @@ sub create_output_lvm { } sub create_output_md { eval $start if $b_log; - my (@components,@components_good,@failed,@rows,@spare,@temp); + my (@components,@components_good,@failed,@inactive,@rows,@spare,@temp); my ($blocks,$chunk,$level,$report,$size,$status); my ($j,$num) = (0,0); #print Data::Dumper::Dumper \@md_raid; - if ($extra > 2 && $md_raid[0]->{'system-supported'}){ + if ($extra > 2 && $md_raid[0]->{'supported-levels'}){ push(@rows, { - main::key($num++,0,1,'System supports mdraid') => $md_raid[0]->{'system-supported'}, + main::key($num++,0,1,'Supported mdraid levels') => $md_raid[0]->{'supported-levels'}, }); } foreach my $row (sort {$a->{'id'} cmp $b->{'id'}} @md_raid){ @@ -14524,17 +14883,22 @@ sub create_output_md { } } @components = (ref $row->{'components'} eq 'ARRAY') ? @{$row->{'components'}} : (); - @failed = (); - @spare = (); @components_good = (); + @failed = (); + @inactive = (); + @spare = (); # @spare = split(/\s+/, $row->{'unused'}) if $row->{'unused'}; + # print Data::Dumper::Dumper \@components; foreach my $item (sort { $a->[1] <=> $b->[1]} @components){ - if (defined $item->[2] && $item->[2] =~ /^(F|DEGRADED|FAULTED|UNAVAIL)$/){ + if (defined $item->[2] && $item->[2] =~ /^(F)$/){ push(@failed, $item); } - elsif (defined $item->[2] && $item->[2] =~ /(S|OFFLINE)$/){ + elsif (defined $item->[2] && $item->[2] =~ /(S)$/){ push(@spare, $item); } + elsif ($row->{'status'} && $row->{'status'} eq 'inactive' ){ + push(@inactive, $item); + } else { push(@components_good, $item); } @@ -14544,6 +14908,7 @@ sub create_output_md { my $b_bump; create_components_output('mdraid','Online',\@rows,\@components_good,\$j,\$num,\$b_bump); create_components_output('mdraid','Failed',\@rows,\@failed,\$j,\$num,\$b_bump); + create_components_output('mdraid','Inactive',\@rows,\@inactive,\$j,\$num,\$b_bump); create_components_output('mdraid','Spare',\@rows,\@spare,\$j,\$num,\$b_bump); if ($row->{'recovery-percent'}){ $j = scalar @rows; @@ -14679,8 +15044,8 @@ sub create_output_zfs { sub create_components_output { eval $start if $b_log; my ($type,$item,$rows_ref,$array_ref,$j_ref,$num_ref,$b_bump_ref) = @_; - my ($extra1,$extra2,$f1,$f2,$f3,$f4,$f5,$k,$k1,$key1,$l1,$l2,$l3); return if !@$array_ref && $item ne 'Online'; + my ($extra1,$extra2,$f1,$f2,$f3,$f4,$f5,$k,$k1,$key1,$l1,$l2,$l3); if ($type eq 'lvm'){ ($f1,$f2,$f3,$f4,$f5,$l1,$l2,$l3) = (1,2,3,4,5,3,4,5); $k = 1; @@ -14690,23 +15055,28 @@ sub create_components_output { elsif ($type eq 'mdraid'){ ($f1,$f2,$f3,$f4,$k1,$l1,$l2,$l3) = (3,4,5,6,1,3,4,5); $extra1 = 'mapped'; + $k = 1 if $item eq 'Inactive'; } elsif ($type eq 'zfs'){ ($f1,$f2,$f3,$l1,$l2,$l3) = (1,2,3,4,5,6); $k = 1; } + #print "item: $item\n"; $$j_ref++ if $$b_bump_ref; $$b_bump_ref = 0; my $good = ($item eq 'Online' && !@$array_ref ) ? 'N/A' : ''; $$rows_ref[$$j_ref]->{main::key($$num_ref++,1,$l1,$item)} = $good; + #$$j_ref++ if $b_admin; + #print Data::Dumper::Dumper $array_ref; foreach my $device (@$array_ref){ next if ref $device ne 'ARRAY'; - if ($b_admin && $device->[$f1] && $device->[$f2]){ + #if ($b_admin && $device->[$f1] && $device->[$f2]){ + if ($b_admin){ $$j_ref++; $$b_bump_ref = 1; $$num_ref = 1; } - $key1 = (defined $k1) ? $device->[$k1] : $k++; + $key1 = (defined $k1 && defined $device->[$k1]) ? $device->[$k1] : $k++; $$rows_ref[$$j_ref]->{main::key($$num_ref++,1,$l2,$key1)} = $device->[0]; if ($b_admin && $device->[$f2]){ $$rows_ref[$$j_ref]{main::key($$num_ref++,0,$l3,'maj-min')} = $device->[$f2]; @@ -14855,35 +15225,49 @@ sub md_data { #$mdstat = "$ENV{'HOME'}/bin/scripts/inxi/data/raid/md-2-mirror-fserver2-1.txt"; #$mdstat = "$ENV{'HOME'}/bin/scripts/inxi/data/raid/md-2-raid10-abucodonosor.txt"; #$mdstat = "$ENV{'HOME'}/bin/scripts/inxi/data/raid/md-2-raid10-ant.txt"; + #$mdstat = "$ENV{'HOME'}/bin/scripts/inxi/data/raid/md-inactive-weird-syntax.txt"; + #$mdstat = "$ENV{'HOME'}/bin/scripts/inxi/data/raid/md-inactive-active-syntax.txt"; + #$mdstat = "$ENV{'HOME'}/bin/scripts/inxi/data/raid/md-inactive-active-spare-syntax.txt"; } my @working = main::reader($mdstat,'strip'); #print Data::Dumper::Dumper \@working; my (@mdraid,@temp,$b_found,$system,$unused); - # NOTE: a system with empty mdstat will still show these values + # NOTE: a system with empty mdstat will not show these values if ($working[0] && $working[0] =~ /^Personalities/){ $system = ( split(/:\s*/, $working[0]))[1]; $system =~ s/\[|\]//g if $system; shift @working; } - if ($working[-1] && $working[-1] =~ /^used\sdevices/){ - $unused = ( split(/:\s*/, $working[0]))[1]; + if ($working[-1] && $working[-1] =~ /^unused\sdevices/){ + $unused = ( split(/:\s*/, $working[-1]))[1]; $unused =~ s/<|>|none//g if $unused; pop @working; } foreach (@working){ $_ =~ s/\s*:\s*/:/; # print "$_\n"; - #md126 : active (auto-read-only) raid1 sdq1[0] - if (/^(md[0-9]+)\s*:\s*([^\s]+)(\s\([^)]+\))?\s([^\s]+)\s(.*)/){ - my $id = $1; - my $status = $2; - my $level = $4; - my $component_string = $5; - my (@components,%details,%device,$maj_min,@part,$size); + # md0 : active raid1 sdb1[2] sda1[0] + # md126 : active (auto-read-only) raid1 sdq1[0] + # md127 : inactive sda0 + # md1 : inactive sda1[0] sdd1[3] sdc1[2] sdb1[1] + # if (/^(md[0-9]+)\s*:\s*([^\s]+)(\s\([^)]+\))?\s([^\s]+)\s(.*)/){ + if (/^(md[0-9]+)\s*:\s*([\S]+)(\s\([^)]+\))?/){ + my ($component_string,$id,$level,$maj_min,@part,$size,$status); + my (@components,%details,%device); + $id = $1; + $status = $2; + if (/^(md[0-9]+)\s*:\s*([\S]+)(\s\([^)]+\))?\s((faulty|linear|multipath|raid)[\S]*)\s(.*)/){ + $level = $4; + $component_string = $6; + $level =~ s/^raid1$/mirror/; + $level =~ s/^raid/raid-/; + $level = 'mirror' if $level eq '1'; + } + elsif (/^(md[0-9]+)\s*:\s*([\S]+)(\s\([^)]+\))?\s(.*)/){ + $component_string = $4; + $level = 'N/A'; + } @temp = (); - $level =~ s/^raid1$/mirror/; - $level =~ s/^raid/raid-/; - $level = 'mirror' if $level eq '1'; # cascade of tests, light to cpu intense if ((!$maj_min || !$size) && @proc_partitions){ @part = main::get_proc_partition($id); @@ -14908,6 +15292,9 @@ sub md_data { if ($component =~ /([\S]+)\[([0-9]+)\]\(?([SF])?\)?/){ ($name,$number,$info) = ($1,$2,$3); } + elsif ($component =~ /([\S]+)/){ + $name = $1; + } next if !$name; if ($details{'devices'} && ref $details{'devices'} eq 'HASH'){ $maj_min = $details{'devices'}->{$name}{'maj-min'}; @@ -14976,7 +15363,7 @@ sub md_data { #print 'mdraid loop: ', Data::Dumper::Dumper \@mdraid; } if (@mdraid){ - $mdraid[0]->{'system-supported'} = $system if $system; + $mdraid[0]->{'supported-levels'} = $system if $system; $mdraid[0]->{'unused'} = $unused if $unused; } #print Data::Dumper::Dumper \@mdraid; @@ -18096,7 +18483,7 @@ sub unmounted_filesystem { } } -## UsbData$base_arch_distro$base_arch_distro +## UsbData { package UsbData; @@ -18151,7 +18538,7 @@ sub usb_data { $path_id = $id->[2] if $id->[2]; $bus_id = "$path_id:$id->[1]"; # it's a hub - if ($id->[4] eq '9'){ + if ($id->[4] eq '09'){ $ports = $id->[10] if $id->[10]; $ports ||= 'N/A'; #print "pt0:$protocol\n"; @@ -18183,7 +18570,7 @@ sub usb_data { $rows[$j]->{main::key($num++,0,3,'rev')} = $speed; } # for either hub or device - if ($extra > 2 && main::is_numeric($id->[17])){ + if ($extra > 1 && main::is_numeric($id->[17])){ my $speed = $id->[17]; if ($speed >= 1000) {$speed = ($id->[17] / 1000 ) . " Gb/s"} else {$speed = $id->[17] . " Mb/s"} @@ -18192,6 +18579,10 @@ sub usb_data { if ($extra > 1){ $rows[$j]->{main::key($num++,0,$ind_sc,'chip ID')} = $chip_id; } + if ($extra > 2 && defined $id->[5] && $id->[5] ne ''){ + my $id = sprintf("%02s",$id->[4]) . sprintf("%02s", $id->[5]); + $rows[$j]->{main::key($num++,0,$ind_sc,'class ID')} = $id; + } if (!$b_hub && $extra > 2){ if ($serial){ $rows[$j]->{main::key($num++,0,$ind_sc,'serial')} = main::apply_filter($serial); @@ -21647,6 +22038,10 @@ sub assign_data { push(@devices_audio,[@$data]); $b_soc_audio = 1 if $tool eq 'soc'; } + if (check_bluetooth($data->[0],$data->[1])){ + push(@devices_bluetooth,[@$data]); + $b_soc_bluetooth = 1 if $tool eq 'soc'; + } elsif (check_hwraid($data->[0],$data->[1])){ push(@devices_hwraid,[@$data]); $b_soc_net = 1 if $tool eq 'soc'; @@ -21665,16 +22060,24 @@ sub assign_data { } # note: for soc, these have been converted in soc_type() sub check_audio { - if ( ( $_[1] && length($_[1]) == 4 && $_[1] =~/^04/ ) || + if ( ( $_[1] && length($_[1]) == 4 && $_[1] =~ /^04/ ) || ( $_[0] && $_[0] =~ /^(audio|hdmi|multimedia|sound)$/i )){ return 1; } else {return 0} } +sub check_bluetooth { + if ( ( $_[1] && length($_[1]) == 4 && $_[1] eq '0d11' ) || + ( $_[0] && $_[0] =~ /^(bluetooth)$/i )){ + return 1; + } + else {return 0} +} sub check_graphics { # note: multimedia class 04 is viddeo if 0400. 'tv' is risky I think - if ( ( $_[1] && length($_[1]) == 4 && ($_[1] =~/^03/ || $_[1] eq '0400' ) ) || - ( $_[0] && $_[0] =~ /^(vga|display|hdmi|3d|video|tv|television)$/i)){ + if ( ( $_[1] && length($_[1]) == 4 && ($_[1] =~ /^03/ || $_[1] eq '0400' || + $_[1] eq '0d80' ) ) || + ( $_[0] && $_[0] =~ /^(vga|display|hdmi|3d|video|tv|television)$/i)){ return 1; } else {return 0} @@ -21684,8 +22087,9 @@ sub check_hwraid { } # NOTE: class 06 subclass 80 # https://www-s.acm.illinois.edu/sigops/2007/roll_your_own/7.c.1.html +# 0d20: 802.11a 0d21: 802.11b 0d80: other wireless sub check_network { - if ( ( $_[1] && length($_[1]) == 4 && ($_[1] =~/^02/ || $_[1] eq '0680' ) ) || + if ( ( $_[1] && length($_[1]) == 4 && ($_[1] =~/^02/ || $_[1] =~ /^0d2/ || $_[1] eq '0680' ) ) || ( $_[0] && $_[0] =~ /^(ethernet|network|wifi|wlan)$/i ) ){ return 1; } @@ -22329,6 +22733,7 @@ my ($b_hub,$addr_id,$bus_id,$bus_id_alpha,$chip_id,$class_id, $device_id,$driver,$ids,$interfaces,$name,$path,$path_id,$product, $protocol_id,$serial,$speed,$subclass_id,$type,$version,$vendor,$vendor_id,); my $b_live = 1; # debugger file data + sub set { eval $start if $b_log; $b_usb_check = 1; @@ -22369,7 +22774,7 @@ sub lsusb_data { $working[1] = $addr_id; $working[2] = $path_id; $working[3] = ''; - $working[4] = 0; + $working[4] = '00'; $working[5] = ''; $working[6] = ''; $working[7] = $chip_id; @@ -22426,7 +22831,7 @@ sub usbdevs_data { $working[1] = $addr_id; $working[2] = $path; $working[3] = ''; - $working[4] = 9; + $working[4] = '09'; $working[5] = ''; $working[6] = ''; $working[7] = $chip_id; @@ -22456,7 +22861,7 @@ sub usbdevs_data { $working[1] = $addr_id; $working[2] = $path_id; $working[3] = ''; - $working[4] = 1; + $working[4] = '01'; $working[5] = ''; $working[6] = ''; $working[7] = $chip_id; @@ -22544,8 +22949,11 @@ sub sys_data { $bus_id = int($working[2]); $bus_id_alpha = bus_id_alpha($path_id); $device_id = int($working[3]); + # this will be a hex number $class_id = sys_item("$_/bDeviceClass"); + # $subclass_id = sys_item("$_/bDeviceSubClass"); $class_id = hex($class_id) if $class_id; + # this populates class, subclass, and protocol id with decimal numbers @drivers = uevent_data("$_/[0-9]*/uevent"); push(@drivers, uevent_data("$_/[0-9]*/*/uevent")) if !$b_hub; $ports = sys_item("$_/maxchild") if $b_hub; @@ -22558,9 +22966,14 @@ sub sys_data { $usb_version = sys_item("$_/version"); $speed = sys_item("$_/speed"); $configuration = sys_item("$_/configuration"); + $class_id = sprintf("%02x", $class_id) if defined $class_id && $class_id ne ''; + $subclass_id = sprintf("%02x", $subclass_id) if defined $subclass_id && $subclass_id ne ''; if ($source eq 'lsusb'){ for ($i = 0; $i < scalar @usb; $i++){ if ($usb[$i]->[0] eq $bus_id && $usb[$i]->[1] == $device_id){ + if (!$b_hub && $usb[$i]->[13] && (!$type || $type eq '' )){ + $type = check_type($usb[$i]->[13],$driver,$type); + } #print $type,"\n"; $usb[$i]->[0] = $bus_id_alpha; $usb[$i]->[2] = $path_id; @@ -22608,6 +23021,9 @@ sub sys_data { $name = $type; } $name = main::remove_duplicates($name) if $name; + if (!$b_hub && $name && (!$type || $type eq '' )){ + $type = check_type($name,$driver,$type); + } # this isn't that useful, but save in case something shows up #if ($configuration){ # $name = ($name) ? "$name $configuration" : $configuration; @@ -22682,11 +23098,11 @@ sub uevent_data { } if (@interfaces){ main::uniq(\@interfaces); - # clear out values like: ,Printer - if ( scalar @interfaces > 1 && (grep {/^,Printer + if (scalar @interfaces > 1 && (grep {!/^';} if (scalar @types == 3){ $class_id = $types[0]; $subclass_id = $types[1]; $protocol_id = $types[2]; } - if (!@types || $types[0] eq '0' || scalar @types != 3) {return '';} - elsif ($types[0] eq '255') { return '';} - if ($types[0] eq '1'){$type = 'Audio';} elsif ($types[0] eq '2'){ if ($types[1] eq '2'){$type = 'Abstract (modem)';} @@ -22752,7 +23168,25 @@ sub device_type { elsif ($types[2] eq '3'){$type = 'Device Wire Adapter';} } } - + # print "$data: $type\n"; + return $type; +} +# device name/driver string based test, return if not detected +sub check_type { + my ($name,$driver,$type) = @_; + $name = lc($name); + # ntoe used but if we want to add in bsd usb audio support could be good + if ($name =~ /(audio|hifi|sound)/){ + $type = 'Audio'; + } + # Broadcom HP Portable SoftSailing + elsif (($driver && $driver =~ /btusb/) || $name =~ /(bluetooth)/){ + $type = 'Bluetooth'; + } + elsif (($driver && $driver =~ /uvcvideo/) || $name =~ /(display|video|camera)/){ + $type = 'Video'; + } + # ethernet/wifi test not needed because NetworkData runs its own tests on the data return $type; } # this is used to create an alpha sortable bus id for main $usb[0] @@ -22854,6 +23288,12 @@ sub generate_lines { %row = line_handler('Network','network'); assign_data(\%row); } + if ( $show{'bluetooth'} ){ + USBData::set() if !$b_usb_check; + DeviceData::set($b_pci_check) if !$b_pci_check; + %row = line_handler('Bluetooth','bluetooth'); + assign_data(\%row); + } if ( $show{'logical'} ){ %row = line_handler('Logical','logical'); assign_data(\%row); @@ -22918,6 +23358,7 @@ sub line_handler { my %subs = ( 'audio' => \&AudioData::get, 'battery' => \&BatteryData::get, + 'bluetooth' => \&BluetoothData::get, 'cpu' => \&CpuData::get, 'disk' => \&DiskData::get, 'graphic' => \&GraphicData::get, diff --git a/inxi.1 b/inxi.1 index 71a33f9..c6c701a 100644 --- a/inxi.1 +++ b/inxi.1 @@ -1,4 +1,4 @@ -.TH INXI 1 "2021\-01\-13" inxi "inxi manual" +.TH INXI 1 "2021\-01\-28" inxi "inxi manual" .SH NAME inxi \- Command line system information script for console and IRC @@ -6,7 +6,7 @@ inxi \- Command line system information script for console and IRC .SH SYNOPSIS \fBinxi\fR -\fBinxi\fR [\fB\-AbBCdDfFGhiIjJlLmMnNopPrRsSuUVwzZ\fR] +\fBinxi\fR [\fB\-AbBCdDEfFGhiIjJlLmMnNopPrRsSuUVwzZ\fR] \fBinxi\fR [\fB\-c NUMBER\fR] [\fB\-\-sensors\-exclude SENSORS\fR] [\fB\-\-sensors\-use SENSORS\fR] @@ -93,6 +93,9 @@ capacity, and then this figure as a percentage of original capacity available in With \fB\-x\fR shows attached \fBDevice\-x\fR information (mouse, keyboard, etc.) if they are battery powered. +.TP +.B \-\-bluetooth\fR \- See \fB\-E\fR + .TP .B \-c\fR,\fB \-\-color\fR \fR[\fB0\fR\-\fB42\fR] Set color scheme. If no scheme number is supplied, 0 is assumed. @@ -193,6 +196,30 @@ Also shows per disk information: Disk ID, type (if present), vendor (if detected model, and size. See \fBExtra Data Options\fR (\fB\-x\fR options) and \fBAdmin Extra Data Options\fR (\fB\-\-admin\fR options) for many more features. +.TP +.B \-E\fR, \fB\-\-bluetooth\fR +Show bluetooth device(s), drivers. Show \fBReport:\fR with +(if available) bluetooth version (\fBbt\-v\fR), HCI ID, state, +address per device. See \fBExtra Data Options\fR for more. + +Note that \fBReport\-ID:\fR indicates that the HCI item was not able to be linked to a +specific device, similar to \fBIF\-ID:\fR in \fB\-n\fR. + +Note that if your internal bluetooth device does not show, it's possible that +it has been disabled, if you try enabling it using for example: + +\fBhciconfig hci0 up\fR + +and it returns a blocked by RF-Kill error, you can do one of these: + +\fBconnmanctl enable bluetooth + +or + +\fBrfkill list\fR + +\fBrfkill unblock bluetooth\fR + .TP .B \-\-filter\fR,\fB \-\-filter\-override\fR \- See \fB\-z\fR, \fB\-Z\fR. @@ -215,10 +242,10 @@ to avoid spamming. ARM CPUs: show \fBfeatures\fR items. .TP .B \-F\fR,\fB \-\-full\fR -Show Full output for inxi. Includes all Upper Case line letters except \fB\-W\fR, -plus \fB\-\-swap\fR, \fB\-s\fR and \fB\-n\fR. Does not show extra verbose options such as -\fB\-d \-f \-i \-l \-m \-o \-p \-r \-t \-u \-x\fR unless you use those arguments in -the command, e.g.: \fBinxi \-Frmxx\fR +Show Full output for inxi. Includes all Upper Case line letters (except \fB\-J\fR +and \fB\-W\fR) plus \fB\-\-swap\fR, \fB\-s\fR and \fB\-n\fR. Does not show extra +verbose options such as \fB\-d \-f \-i -J \-l \-m \-o \-p \-r \-t \-u \-x\fR unless +you use those arguments in the command, e.g.: \fBinxi \-Frmxx\fR .TP .B \-G\fR,\fB \-\-graphics\fR @@ -458,7 +485,7 @@ Shows interface, speed, MAC ID, state, etc. .TP .B \-N\fR,\fB \-\-network\fR -Show Network device(s) information, including device driver. With \fB\-x\fR, shows PCI BusID, +Show Network device(s) information, including device driver. With \fB\-x\fR, shows Bus ID, Port number. .TP @@ -640,7 +667,7 @@ speeds, if available) + \fB\-G\fR + basic Disk + \fB\-I\fR. .TP .B \-v 2 -\- Adds networking card (\fB\-N\fR), Machine (\fB\-M\fR) data, Battery (\fB\-B\fR) +\- Adds networking device (\fB\-N\fR), Machine (\fB\-M\fR) data, Battery (\fB\-B\fR) (if available). Same as: \fBinxi \-b\fR .TP @@ -655,9 +682,11 @@ advanced data option. .TP .B \-v 5 -\- Adds audio card (\fB\-A\fR), memory/RAM (\fB\-m\fR), sensors (\fB\-s\fR), -partition label (\fB\-l\fR), UUID (\fB\-u\fR), full swap data (\fB\-j\fR), -and short form of optical drives. +\- Adds audio device (\fB\-A\fR), memory/RAM (\fB\-m\fR), +bluetooth data (\fB\-E\fR) (if present), sensors (\fB\-s\fR), +RAID data (if present), partition label (\fB\-l\fR), +UUID (\fB\-u\fR), full swap data (\fB\-j\fR), and short form of +optical drives. .TP .B \-v 6 @@ -667,7 +696,8 @@ USB (\fB\-J\fR); triggers \fB\-xx\fR extra data option. .TP .B \-v 7 -\- Adds network IP data (\fB\-i\fR); triggers \fB\-xxx\fR +\- Adds network IP data (\fB\-i\fR), forced bluetooth (\fB\-E\fR), +RAID (\fB\-R\fR); triggers \fB\-xxx\fR .TP .B \-v 8 @@ -778,10 +808,9 @@ extra data level. \- Adds (if available and/or relevant) \fBvendor:\fR item, which shows specific vendor [product] information. -\- Adds version/port(s)/driver version (if available) for each Audio -device. +\- Adds version/port(s)/driver version (if available) for each device. -\- Adds PCI Bus ID/USB ID number of each Audio device. +\- Adds PCI/USB ID of each device. .TP .B \-x \-B\fR @@ -843,6 +872,18 @@ You can force use of \fBhddtemp\fR for all drives using \fB\-\-hddtemp\fR. on Local Storage line. This is how much unused space the VGs contain, that is, space not assigned to LVs. +.TP +.B \-x \-E\fR (\fB\-\-bluetooth\fR) +\- Adds (if available and/or relevant) \fBvendor:\fR item, which shows +specific vendor [product] information. + +\- Adds PCI/USB Bus ID of each device. + +\- Adds driver version (if available) for each device. + +\- Adds LMP (HCI if no LMP data, and HCI if HCI/LMP versions are different) +version (if available) for each HCI ID. + .TP .B \-x \-G\fR \- Adds (if available and/or relevant) \fBvendor:\fR item, which shows @@ -852,7 +893,7 @@ specific vendor [product] information. \- Adds (for single GPU, nvidia driver) screen number that GPU is running on. -\- Adds PCI Bus ID/USB ID number of each Graphics card. +\- Adds PCI/USB ID of each device. .TP .B \-x \-i\fR @@ -925,9 +966,9 @@ generate one. \- Adds (if available and/or relevant) \fBvendor:\fR item, which shows specific vendor [product] information. -\- Adds version/port(s)/driver version (if available) for each Network card; +\- Adds version/port(s)/driver version (if available) for each device; -\- Adds PCI Bus ID/USB ID number of each Network card. +\- Adds PCI/USB ID of each device. .TP .B \-x \-o\fR, \fB\-x \-p\fR, \fB\-x \-P\fR @@ -945,7 +986,7 @@ Example: \fBID\-4: /home ... dev: /dev/dm-6 mapped: ar0-home\fR \- md\-raid: Adds second RAID Info line with extra data: blocks, chunk size, bitmap (if present). Resync line, shows blocks synced/total blocks. -\- Hardware RAID: Adds driver version, bus ID. +\- Hardware RAID: Adds driver version, Bus ID. .TP .B \-x \-s\fR @@ -974,7 +1015,7 @@ methods are found for each distribution system base detection. .TP .B \-xx \-A\fR -\- Adds vendor:product ID for each Audio device. +\- Adds vendor:product ID for each device. .TP .B \-xx \-B\fR @@ -1007,9 +1048,15 @@ For a PCIe 3 NVMe drive, with speed of \fB8 GT/s\fR and \fB4\fR lanes \fBspeed: 31.6 Gb/s lanes: 4\fR +.TP +.B \-xx \-E\fR (\fB\-\-bluetooth\fR) +\- Adds vendor:product ID of each device. + +\- Adds LMP subversion (and/or HCI revision if applicable) for each device. + .TP .B \-xx \-G\fR -\- Adds vendor:product ID of each Graphics card. +\- Adds vendor:product ID of each device. \- Adds Xorg compositor, if found (always shows for Wayland systems). @@ -1020,11 +1067,11 @@ the same. Example: \fBv: 3.3 Mesa 11.2.0 compat\-v: 3.0\fR \- If available, shows \fBalternate:\fR Xorg drivers. This means a driver on -the default list of drivers Xorg automatically checks for the card, but which +the default list of drivers Xorg automatically checks for the device, but which is not installed. For example, if you have \fBnouveau\fR driver, \fBnvidia\fR would show as alternate if it was not installed. Note that \fBalternate:\fR does NOT mean you should have it, it's just one of the drivers Xorg checks to see if is present -and loaded when checking the card. This can let you know there are other driver options. +and loaded when checking the device. This can let you know there are other driver options. Note that if you have explicitly set the driver in \fBxorg.conf\fR, Xorg will not create this automatic check driver list. @@ -1086,7 +1133,7 @@ ROM size if using \fBdmidecode\fR. .TP .B \-xx \-N\fR -\- Adds vendor:product ID for each Network card. +\- Adds vendor:product ID for each device. .TP .B \-xx \-r\fR @@ -1132,6 +1179,8 @@ to observation time), if available. .B \-xxx \-A\fR \- Adds, if present, serial number. +\- Adds, if present, PCI/USB class ID. + .TP .B \-xxx \-B\fR \- Adds battery chemistry (e.g. \fBLi\-ion\fR), cycles (NOTE: there appears to @@ -1159,6 +1208,16 @@ Only appears if detected (SSD drives do not have rotation speeds, for example). found, nothing shows. Not all disks report this speed, so even if they are spinnning, no data will show. +.TP +.B \-xxx \-E\fR (\fB\-\-bluetooth\fR) +\- Adds, if present, PCI/USB class ID. + +\- Adds HCI version, revision. + +.TP +.B \-xxx \-G\fR +\- Adds, if present, PCI/USB class ID. + .TP .B \-xxx \-I\fR \- For \fBUptime:\fR adds \fBwakeups:\fR to show how many times the machine @@ -1181,6 +1240,8 @@ uses the \fBwho am i\fR test. \- Adds, if available, USB speed in \fBMbits/s\fR or \fBGbits/s\fR. +\- Adds, if present, USB class ID. + .TP .B \-xxx \-m\fR, \fB\-\-memory\-modules\fR \- Adds memory bus width: primary bus width, and if present, total width. e.g. @@ -1199,6 +1260,8 @@ data available. .B \-xxx \-N\fR \- Adds, if present, serial number. +\- Adds, if present, PCI/USB class ID. + .TP .B \-xxx \-R\fR \- md\-raid: Adds system mdraid support types (kernel support, read ahead, RAID events) @@ -1319,6 +1382,11 @@ available, and different from enclosure model/serial, and corrects block sizes if necessary. Adds in drive temperature for some drives as well, and other useful data. +.TP +.B \-a \-E\fR (\fB\-\-bluetooth\fR) +\- Adds extra line to \fBReport:\fR, \fBInfo:\fR. Includes, if available, +ACL MTU, SCO MTU, Link policy, Link mode, and Service Classes. + .TP .B \-a \-G\fR Triggers a much more complete Screen/Monitor output on the diff --git a/inxi.changelog b/inxi.changelog index 6c52dae..d0ed3e2 100644 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,94 @@ +===================================================================================== +Version: 3.3.00 +Patch: 00 +Date: 2021-01-28 +----------------------------------- +Changes: +----------------------------------- + +Bug fixes!! New Feature!! Edits, cleanups!! + +Bugs: +1. Small bug, wrong regex would make mdraid unused report never show. +Was looking for ^used, not ^unused. No idea how that happened, but it's fixed. + +2. Big RAID bug. Due to never having seen an 'inactive' state mdraid dataset, +inxi had a bunch of bugs around that. I'd assumed active and inactive would have +roughly the same syntax, but they don't. This is now corrected. Thanks Solus user +for giving me the required data. This case when not corrected resulted in a +spray of errors as RAID ran, and a fairly incomplete RAID report for mdraid. + +3. A bug that probably never impacted anyone, but in SMART the matching rules +failed to match field name Size[s]? in the logical/physical block sizes. +However, those were already coming in from I believe pre-existing /sys data +for the drives but now it's fixed anyway. I had not realized that smartctl +made it plural when logical/physical were different, and singular when +they were the same. + +Fixes: +1. Going along with bug 2, fixed some other admin/non admin report glitches. +Made patterns more aggressively matching, whitelist based to avoid the types +of syntax issues that caused bug 2. + +2. Added 'faulty' type to mdraid matches, that had not been handled. + +3. Found even more of those pesky 'card' references in help and man page, +replaced all of them with 'device[s]'. + +4. Subtle fix, for debugger data collectors, added -y1 support, which can +be useful at times. + +Enhancements: +1. In USB data grabber, added fallback case for unspecified type cases, now +uses a simple name/driver string test to determine if it's graphics, audio, +or bluetooth. This was mainly to make sure bluetooth usb devices get caught. + +2. New feature! -E/--bluetooth. Gives an -n like bluetooth Device-x/Report. +Requires for the 'Report:' part hciconfig, which most all distros still have +in their repos. With -a, shows an additional Info: line that has more obscure +bluetooth hci data: acl-mtu sco-mtu, link-policy, link-mode, service-classes. + +This closes the ancient, venerable issue #79, filed by mikaela so many years +ago. Better late than never!! However, features like this were really difficult +in legacy bash/gawk inxi 2.x, and became fairly easy with inxi 3.x, so I guess +we'll slowly whittle away at these things when the mood, and global pandemic +lockdowns, make that seem like a good idea... + +Includes a small lookup table to match LMP number to Bluetooth version (bt-v:), +hopefully that's a correct way to determine bluetooth version, there was some +ambiguity about that. + +-x, -xx, and -xxx function pretty much the same way as with -A, -G, and -N +devices, adding Chip IDs, Bus IDs, version info, and so on. +Since this bluetooth report does not require root and is an upper case option, +it's been added to default -F, similar to -R, and -v 5, where raid/bluetooth +shows only if data is found. With -v7 or -R or -E, always shows, including +no data found message. + +Includes a fallback report Report-ID: case where for some reason, inxi could +not match the HCI ID with the device. That's similar to IF-ID in -n, which +does the same when some of the IFs could not be matched to a specific device. + +3. For -A, -G, -N, and -E, new item for -xxx, classID, I realized this is +actually useful for many cases of trying to figure out what devices are, +though most users would not know what to do with that information, but that's +why it's an -xxx option! + +4. Yes! You've been paying attention!! More disk vendors, and new vendor IDs!! +The cornucopia flows its endless bounty over the grateful data collector, and, +hopefully, inxi users!! Thanks as always, linux-lite hardware database, and +linux-lite users who really seem set on the impossible project of obtaining +all the disks/vendors known to man. + +Changes: +1. Small change in wording for mdraid report: +'System supported mdraid' becomes 'Supported mdraid levels' which is cleaner +and much more precise. + + +----------------------------------- +-- Harald Hope - Thu, 28 Jan 2021 19:34:17 -0800 + ===================================================================================== Version: 3.2.02 Patch: 00