diff options
Diffstat (limited to 'inxi')
| -rwxr-xr-x | inxi | 274 |
1 files changed, 158 insertions, 116 deletions
@@ -1,6 +1,6 @@ #!/usr/bin/env perl ## infobash: Copyright (C) 2005-2007 Michiel de Boer aka locsmif -## inxi: Copyright (C) 2008-2020 Harald Hope +## inxi: Copyright (C) 2008-2021 Harald Hope ## Additional features (C) Scott Rogers - kde, cpu info ## Further fixes (listed as known): Horst Tritremmel <hjt at sidux.com> ## Steven Barrett (aka: damentz) - usb audio patch; swap percent used patch @@ -40,8 +40,8 @@ use POSIX qw(uname strftime ttyname); ## INXI INFO ## my $self_name='inxi'; -my $self_version='3.2.01'; -my $self_date='2020-12-17'; +my $self_version='3.2.02'; +my $self_date='2021-01-10'; my $self_patch='00'; ## END INXI INFO ## @@ -132,7 +132,7 @@ my %size = ( # Default indentation level. NOTE: actual indent is 1 greater to allow for # spacing 'indent' => 11, -'indent-min' => 90, +'wrap-max' => 90, 'irc' => 100, # shorter because IRC clients have nick lists etc 'max' => 0, 'no-display' => 130, @@ -455,9 +455,8 @@ sub set_os { } } -# This data is hard set top of program but due to a specific project's -# foolish idea that ignoring the FSH totally is somehow a positive step -# forwards for free software, we also have to padd the results with PATH. +# Sometimes users will have more PATHs local to their setup, so we want those +# too. sub set_path { # Extra path variable to make execute failures less likely, merged below my (@path); @@ -1176,7 +1175,7 @@ sub get_config_item { elsif ($key eq 'COLS_MAX_IRC') {$size{'irc'} = $val if is_int($val)} elsif ($key eq 'COLS_MAX_NO_DISPLAY') {$size{'no-display'} = $val if is_int($val)} elsif ($key eq 'INDENT') {$size{'indent'} = $val if is_int($val)} - elsif ($key eq 'INDENT_MIN') {$size{'indent-min'} = $val if is_int($val)} + elsif ($key eq 'WRAP_MAX' || $key eq 'INDENT_MIN') {$size{'wrap-max'} = $val if is_int($val)} # print "mc: key: $key val: $val\n"; # print Dumper (keys %size) . "\n"; } @@ -1685,9 +1684,9 @@ sub display_data { 'clutter-backend' => $ENV{'CLUTTER_BACKEND'}, 'sdl-videodriver' => $ENV{'SDL_VIDEODRIVER'}, # program display values - 'size-indent' => $size{'indent'}, - 'size-indent-min' => $size{'indent-min'}, 'size-cols-max' => $size{'max'}, + 'size-indent' => $size{'indent'}, + 'size-wrap-width' => $size{'wrap-max'}, ); write_data(\%data,'display'); my @cmds = ( @@ -4516,7 +4515,7 @@ sub get_options { $b_skip_dig = 0; }, 'display:s' => sub { my ($opt,$arg) = @_; - if ($arg =~ /^:?([0-9]+)?$/){ + if ($arg =~ /^:?([0-9\.]+)?$/){ $display=$arg; $display ||= ':0'; $display = ":$display" if $display !~ /^:/; @@ -4576,14 +4575,6 @@ sub get_options { $show{'no-host'} = 0}, 'html-wan' => sub { $b_no_html_wan = 0; }, - 'indent-min:i' => sub { - my ($opt,$arg) = @_; - if ($arg =~ /^\d+$/){ - $size{'indent-min'} = $arg; - } - else { - error_handler('bad-arg', $opt, $arg); - }}, 'irc' => sub { $b_irc = 1; }, 'man' => sub { @@ -4710,6 +4701,14 @@ sub get_options { }}, 'wm' => sub { $b_wmctrl = 1 }, + 'wrap-max|indent-min:i' => sub { + my ($opt,$arg) = @_; + if ($arg =~ /^\d+$/){ + $size{'wrap-max'} = $arg; + } + else { + error_handler('bad-arg', $opt, $arg); + }}, '<>' => sub { my ($opt) = @_; error_handler('unknown-option', "$opt", "" ); } @@ -4815,37 +4814,8 @@ sub show_options { ['0', '', '', "Examples:^$self_name^-v4^-c6 OR $self_name^-bDc^6 OR $self_name^-FzjJxy^80" ], ['0', '', '', $line ], - ['0', '', '', "Output Control Options:" ], - ['1', '-a', '--admin', "Adds advanced sys admin data (only works with - verbose or line output, not short form); check man page for explanations!; - also sets --extra=3:" ], - ['2', '-A', '', "If available: list of alternate kernel modules/drivers - for device(s)." ], - ['2', '-C', '', "If available: CPU socket type, base/boost speeds - (dmidecode+root/sudo required); CPU vulnerabilities (bugs); - family, model-id, stepping - format: hex (decimal) if greater - 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', '-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 - for device(s)." ], - ['2', '-I', '', "As well as per package manager counts, also adds total - number of lib files found for each package manager if not -r." ], - ['2', '-j,-p,-P', '', "For swap (if available): swappiness and vfs cache - pressure, and if values are default or not." ], - ['2', '-L', '', "LV, Crypto, devices, components: add maj:min; show - full device/components report (speed, mapped names)." ], - ['2', '-n,-N', '', "If available: list of alternate kernel modules/drivers - for device(s)." ], - ['2', '-o', '', "If available: maj:min of device." ], - ['2', '-p,-P', '', "If available: raw size of ${partition_string}s, maj:min, - percent available for user, block size of file system (root required)." ], - ['2', '-r', '', "Packages, see -Ia." ], - ['2', '-R', '', "mdraid: device maj:min; per component: size, maj:min, state." ], - ['2', '-S', '', "If available: kernel boot parameters." ], - ['1', '-A', '--audio', "Audio/sound card(s), driver, sound server." ], + ['0', '', '', "Output Control Options (see Extra Data Options to extend output):" ], + ['1', '-A', '--audio', "Audio/sound devices(s), driver, sound server." ], ['1', '-b', '--basic', "Basic output, short form. Same as $self_name^-v^2." ], ['1', '-B', '--battery', "System battery info, including charge and condition, plus extra info (if battery present)." ], @@ -4872,7 +4842,7 @@ sub show_options { ['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." ], - ['1', '-G', '--graphics', "Graphics info (card(s), driver, display protocol + ['1', '-G', '--graphics', "Graphics info (devices(s), drivers, display protocol (if available), display server/Wayland compositor, resolution, renderer, OpenGL version)." ], ['1', '-i', '--ip', "WAN IP address and local interfaces (requires ifconfig @@ -4885,7 +4855,7 @@ sub show_options { ['1', '-l', '--label', "$partition_string_u labels. Triggers -P. For full -p output, use -pl." ], ['1', '-L', '--logical', "Logical devices, LVM (VG, LV), - LUKS, Crypto, bcache, etc. Shows compenents/devices, sizes, etc." ], + LUKS, Crypto, bcache, etc. Shows components/devices, sizes, etc." ], ['1', '-m', '--memory', "Memory (RAM) data. Requires root. Numbers of devices (slots) supported and individual memory devices (sticks of memory etc). For devices, shows device locator, size, speed, type (e.g. DDR3). @@ -4897,9 +4867,9 @@ sub show_options { VM etc.), motherboard, BIOS and, if present, system builder (e.g. Lenovo). Shows UEFI/BIOS/UEFI [Legacy]. Older systems/kernels without the required /sys data can use dmidecode instead, run as root. Dmidecode can be forced with --dmidecode" ], - ['1', '-n', '--network-advanced', "Advanced Network card info. Triggers -N. Shows + ['1', '-n', '--network-advanced', "Advanced Network device info. Triggers -N. Shows interface, speed, MAC id, state, etc. " ], - ['1', '-N', '--network', "Network card(s), driver." ], + ['1', '-N', '--network', "Network device(s), driver." ], ['1', '-o', '--unmounted', "Unmounted $partition_string info (includes UUID and Label if available). Shows file system type if you have lsblk installed (Linux) or, for BSD/GNU Linux, if 'file' installed and you are root or if @@ -4968,6 +4938,49 @@ sub show_options { ); } push(@data, + ['1', '-y', '--width', "Output line width max (integer >= 80). Overrides IRC/Terminal + settings or actual widths. If no integer give, defaults to 80. -1 removes line lengths. + 1 switches output to 1 key/value pair per line. Example:^inxi^-y^130" ], + ['1', '-z', '--filter', "Adds security filters for IP/MAC addresses, serial numbers, + location (-w), user home directory name, host name. Default on for IRC clients." ], + ['1', '', '--filter-label', "Filters out ${partition_string} labels in -j, + -o, -p, -P, -Sa." ], + ['1', '-Z', '--filter-override', "Override for output filters. Useful for + debugging networking issues in IRC, for example." ], + ['1', '', '--filter-uuid', "Filters out ${partition_string} UUIDs in -j, + -o, -p, -P, -Sa." ], + ['0', '', '', "$line" ], + ['0', '', '', "Extra Data Options:" ], + ['1', '-a', '--admin', "Adds advanced sys admin data (only works with + verbose or line output, not short form); check man page for explanations!; + also sets --extra=3:" ], + ['2', '-A', '', "If available: list of alternate kernel modules/drivers + for device(s)." ], + ['2', '-C', '', "If available: CPU socket type, base/boost speeds + (dmidecode+root/sudo required); CPU vulnerabilities (bugs); + family, model-id, stepping - format: hex (decimal) if greater + 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', '-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 + for device(s)." ], + ['2', '-I', '', "As well as per package manager counts, also adds total + number of lib files found for each package manager if not -r." ], + ['2', '-j,-p,-P', '', "For swap (if available): swappiness and vfs cache + pressure, and if values are default or not." ], + ['2', '-L', '', "LV, Crypto, devices, components: add maj:min; show + full device/components report (speed, mapped names)." ], + ['2', '-n,-N', '', "If available: list of alternate kernel modules/drivers + for device(s)." ], + ['2', '-o', '', "If available: maj:min of device." ], + ['2', '-p,-P', '', "If available: raw size of ${partition_string}s, maj:min, + percent available for user, block size of file system (root required)." ], + ['2', '-r', '', "Packages, see -Ia." ], + ['2', '-R', '', "mdraid: device maj:min; per component: size, maj:min, state." ], + ['2', '-S', '', "If available: kernel boot parameters." ], + ['0', '', '', ''], ['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); @@ -5011,10 +5024,11 @@ sub show_options { ); if ( $use{'weather'} ){ push(@data, - ['2', '-w -W', '', "Wind speed and direction, humidity, pressure, + ['2', '-w,-W', '', "Wind speed and direction, humidity, pressure, and time zone, if available." ]); } push(@data, + ['0', '', '', ''], ['1', '-xx', '--extra 2', "Show extra, extra data (only works with verbose or line output, not short form):" ], ['2', '-A', '', "Chip vendor:product ID for each audio device." ], @@ -5050,11 +5064,12 @@ sub show_options { ); if ( $use{'weather'} ){ push(@data, - ['2', '-w -W', '', "Snow, rain, precipitation, (last observed hour), + ['2', '-w,-W', '', "Snow, rain, precipitation, (last observed hour), cloud cover, wind chill, dew point, heat index, if available." ] ); } push(@data, + ['0', '', '', ''], ['1', '-xxx', '--extra 3', "Show extra, extra, extra data (only works with verbose or line output, not short form):" ], ['2', '-A', '', "Serial number." ], @@ -5079,22 +5094,11 @@ sub show_options { ); if ( $use{'weather'} ){ push(@data, - ['2', '-w -W', '', "Location (uses -z/irc filter), weather observation + ['2', '-w,-W', '', "Location (uses -z/irc filter), weather observation time, altitude, sunrise/sunset, if available." ] ); } push(@data, - ['1', '-y', '--width', "Output line width max (integer >= 80). Overrides IRC/Terminal - settings or actual widths. If no integer give, defaults to 80. -1 removes line lengths. - 1 switches output to 1 key/value pair per line. Example:^inxi^-y^130" ], - ['1', '-z', '--filter', "Adds security filters for IP/MAC addresses, serial numbers, - location (-w), user home directory name, host item. Default on for IRC clients." ], - ['1', '', '--filter-label', "Filters out ${partition_string} labels in -j, - -o, -p, -P, -Sa." ], - ['1', '-Z', '--filter-override', "Override for output filters. Useful for - debugging networking issues in IRC, for example." ], - ['1', '', '--filter-uuid', "Filters out ${partition_string} UUIDs in -j, - -o, -p, -P, -Sa." ], [0, '', '', "$line" ], [0, '', '', "Additional Options:" ], ['1', '-h', '--help', "This help menu." ], @@ -5135,7 +5139,6 @@ sub show_options { ['1', '', '--hddtemp', "Force use of hddtemp for disk temps." ], ['1', '', '--host', "Turn on hostname for -S." ], ['1', '', '--html-wan', "Overrides configuration item NO_HTML_WAN (resets to default)." ], - ['1', '', '--indent-min', "Set point where $self_name autowraps line starters." ], ['1', '', '--limit', "[-1; 1-x] Set max output limit of IP addresses for -i (default 10; -1 removes limit)." ], ); @@ -5146,7 +5149,8 @@ sub show_options { } push(@data, ['1', '', '--no-dig', "Skip dig for WAN IP checks, use downloader program." ], - ['1', '', '--no-host', "Turn off hostname for -S. Useful if showing output from servers etc." ], + ['1', '', '--no-host', "Turn off hostname for -S. Useful if showing output from servers etc. + -z triggers --no-host." ], ['1', '', '--no-html-wan', "Skip HTML IP sources for WAN IP checks, use dig only, or nothing if --no-dig." ], ); @@ -5184,6 +5188,8 @@ sub show_options { URL output must end in the IP address. See man. Example:^$self_name^-i^--wan-ip-url^https://yoursite.com/ip.php" ], ['1', '', '--wm', "Force wm: to use wmctrl as data source. Default uses ps." ], + ['1', '', '--wrap-max', "Set maximum width where $self_name autowraps line starters + (previously --indent-min). Current: $size{'wrap-max'}" ], ['0', '', '', $line ], ['0', '', '', "Debugging Options:" ], ['1', '', '--dbg', "Specific debuggers, change often. Only 1 is constant:" ], @@ -5994,7 +6000,7 @@ sub generate_json { eval $start if $b_log; my ($data) = @_; my ($json); - my $b_debug = 1; + my $b_debug = 0; my ($b_cpanel,$b_valid); error_handler('not-in-irc', 'help') if $b_irc; print Dumper $data if $b_debug; @@ -6160,7 +6166,7 @@ sub print_data { my ($b_container,$indent_use,$indentx) = (0,0,0); # $size{'max'} = 88; # NOTE: indent < 11 would break the output badly in some cases - if ($size{'max'} < $size{'indent-min'} || $size{'indent'} < 11 ){ + if ($size{'max'} < $size{'wrap-max'} || $size{'indent'} < 11 ){ $indent = 2; } #foreach my $key1 (sort { (split('#', $a))[0] <=> (split('#', $b))[0] } keys %$data) { @@ -6191,6 +6197,7 @@ sub print_data { 'Device' => 1, 'Floppy' => 1, 'Hardware' => 1, # hardware raid report + 'Hub' => 1, 'ID' => 1, 'IF-ID' => 1, 'LV' => 1, @@ -9930,35 +9937,38 @@ sub set_vendors { ['(^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|^BGN|^[CD]JN|^BJ[NT]|^[BC]WB|^(HM|SP)[0-9]{2}|^MZMPC|^HD[0-9]{3}[A-Z]{2}$)','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])','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|ULTRA\sFIT|Clip Sport|Cruzer|^Extreme|iXpand)','SanDisk','SanDisk',''], - ['^STEC\b','^STEC\b','STEC',''], # ssd drive, must come before seagate ST test + ['(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',''], + # 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|JPVX|[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',''], + ['^(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',''], + # 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)','^(A-DATA|ADATA)','A-Data',''], + ['^(A-DATA|ADATA|AX[MN]|CH11|HV[1-9]|IM2|HD[1-9])','^(A-DATA|ADATA)','A-Data',''], ['^ASUS','^ASUS','ASUS',''], # ATCS05 can be hitachi travelstar but not sure ['^ATP','^ATP\b','ATP',''], # Force MP500 - ['^(Corsair|Force\s|(Flash\s*)?(Survivor|Voyager))','^Corsair','Corsair',''], - # MAB3045SP shows as HP or Fujitsu, probably HP branded fujitsu + ['^(Corsair|Force\s|(Flash\s*)?(Survivor|Voyager))','^surge Corsair','Corsair',''], ['^(FUJITSU|MJA|MH[TVWYZ][0-9]|MP|MAP[0-9])','^FUJITSU','Fujitsu',''], + # MAB3045SP shows as HP or Fujitsu, probably HP branded fujitsu + ['^(MAB[0-9])','^(HP\b|FUJITSU)','Fujitsu/HP',''], # note: 2012: wdc bought hgst ['^(HGST|Touro|54[15]0|7250)','^HGST','HGST (Hitachi)',''], # HGST HUA - ['^(Hitachi|HCS|HD[PST]|DK[0-9]|IC|HT|HU|HMS)','^Hitachi','Hitachi',''], + ['^(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? - # DX110064A5xnNMRI ids as HP and Sandisc, same ID, made by sandisc for hp? not sure - ['^(HP\b|[MV]B[0-6]|G[BJ][01]|DF|0-9]|FK|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}|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',''], ['^OWC','^OWC\b','OWC',''], ['^(Philips|GoGear)','^Philips','Philips',''], ['^PIONEER','^PIONEER','Pioneer',''], - ['^(PNY|Hook\s?Attache|SSD2SC)','^PNY\s','PNY','','^PNY'], + ['^(PNY|Hook\s?Attache|SSD2SC|(SSD7?)?EP7)','^PNY\s','PNY','','^PNY'], # note: get rid of: M[DGK] becasue mushkin starts with MK # note: seen: KXG50ZNV512G NVMe TOSHIBA 512GB | THNSN51T02DUK NVMe TOSHIBA 1024GB ['(^[S]?TOS|^THN|TOSHIBA|TransMemory|^M[GKQ][0-9]|KBG4)','[S]?TOSHIBA','Toshiba',''], # scsi-STOSHIBA_STOR.E_EDITION_ @@ -9970,6 +9980,7 @@ sub set_vendors { ['^Acasis','^Acasis','Acasis (hub)',''], ['^Acclamator','^Acclamator','Acclamator',''], ['^Addlink','^Addlink','Addlink',''], + ['^(ADplus|SuperVer\b)','^ADplus','ADplus',''], ['^ADTRON','^(ADTRON)','Adtron',''], ['^(Advantech|SQF)','^Advantech','Advantech',''], ['^Aireye','^Aireye','Aireye',''], @@ -9999,6 +10010,7 @@ sub set_vendors { ['^(BUFFALO|BSC)','^BUFFALO','Buffalo',''], # usb: BSCR05TU2 ['^Bulldozer','^Bulldozer','Bulldozer',''], ['^BUSlink','^BUSlink','BUSlink',''], + ['^(STMicro|SMI|CBA)','^(STMicroelectronics|SMI)','SMI (STMicroelectronics)',''], ['^Centerm','^Centerm','Centerm',''], ['^Centon','^Centon','Centon',''], ['^(Chipsbank|CHIPSBNK)','^Chipsbank','Chipsbank',''], @@ -10022,6 +10034,8 @@ sub set_vendors { ['^DGM','^DGM\b','DGM',''], ['^Digifast','^Digifast','Digifast',''], ['^DIGITAL\s?FILM','DIGITAL\s?FILM','Digital Film',''], + ['^(Disney|PIX[\s]?JR)','^Disney','Disney',''], + ['^(Doggo|DQ-|Sendisk|Shenchu)','^(doggo|Sendisk(.?Shenchu)?|Shenchu(.?Sendisk)?)','Doggo (SENDISK/Shenchu)',''], ['^(Dogfish|Shark)','^Dogfish(\s*Technology)?','Dogfish Technolgy',''], ['^DragonDiamond','^DragonDiamond','DragonDiamond',''], ['^DREVO\b','^DREVO','Drevo',''], @@ -10034,21 +10048,24 @@ sub set_vendors { ['^Emtec','^Emtec','Emtec',''], ['^Energy','^Energy','Energy',''], ['^Epson','^Epson','Epson',''], + ['^(Etelcom|SSD051)','^Etelcom','Etelcom',''], + # NOTE: ESA3... may be IBM PCIe SAD card/drives ['^EXCELSTOR','^EXCELSTOR( TECHNO(LOGY)?)?','ExcelStor',''], ['^EZLINK','^EZLINK','EZLINK',''], ['^Fantom','^Fantom( Drive[s]?)?','Fantom Drives',''], ['^Faspeed','^Faspeed','Faspeed',''], ['^FASTDISK','^FASTDISK','FASTDISK',''], + ['^Festtive','^Festtive','Festtive',''], ['^FiiO','^FiiO','FiiO',''], ['^Fordisk','^Fordisk','Fordisk',''], # FK0032CAAZP/FB160C4081 FK or FV can be HP but can be other things - ['^FORESEE','^FORESEE','Foresee',''], + ['^FORESEE','^FORESEE','ForeseSU04Ge',''], ['^(FOXLINE|FLD)','^FOXLINE','Foxline',''], # russian vendor? ['^(GALAX\b|Gamer\s?L)','^GALAX','GALAX',''], ['^Galaxy\b','^Galaxy','Galaxy',''], ['^(Garmin|Fenix|Nuvi|Zumo)','^Garmin','Garmin',''], ['^Geil','^Geil','Geil',''], - ['^Generic','^Generic','Generic',''], + ['^Generic','^Generic','GeneriSU04Gc',''], ['^Gigabyte','^Gigabyte','Gigabyte',''], # SSD ['^Gigastone','^Gigastone','Gigastone',''], ['^Gloway','^Gloway','Gloway',''], @@ -10092,17 +10109,19 @@ sub set_vendors { ['^KingDian','^KingDian','KingDian',''], ['^Kingfast','^Kingfast','Kingfast',''], ['^KingMAX','^KingMAX','KingMAX',''], - ['^Kingrich','^Kingrich','Kingrich',''], + ['^Kingrich','^Kingrich','KingrSU04Gich',''], ['^KING\s?SHARE','^KING\s?SHARE','KingShare',''], - ['^(KingSpec|ACSC)','^KingSpec','KingSpec',''], + ['^(KingSpec|ACSC|KS[DQ]|NT-[0-9]|P4\b|PA18)','^KingSpec','KingSpec',''], ['^KingSSD','^KingSSD','KingSSD',''], # kingwin docking, not actual drive ['^(EZD|EZ-Dock)','','Kingwin Docking Station',''], ['(KIOXIA|^K[BX]G[0-9])','KIOXIA','KIOXIA',''], # company name comes after product ID ['^KLEVV','^KLEVV','KLEVV',''], ['^Kodak','^Kodak','Kodak',''], + ['^KUNUP','^KUNUP','KUNUP',''], ['^(Lacie|P92|itsaKey|iamaKey)','^Lacie','LaCie',''], ['^LANBO','^LANBO','LANBO',''], + ['^LANTIC','^LANTIC','Lantic',''], ['^LDLC','^LDLC','LDLC',''], # LENSE30512GMSP34MEAT3TA / UMIS RPITJ256PED2MWX ['^(LEN|UMIS)','^Lenovo','Lenovo',''], @@ -10115,7 +10134,7 @@ sub set_vendors { ['^M-Systems','^M-Systems','M-Systems',''], ['^(Mach\s*Xtreme|MXSSD|MXU)','^Mach\s*Xtreme','Mach Xtreme',''], ['^Maximus','^Maximus','Maximus',''], - ['^(MAXTOR|Atlas|TM[0-9]{4})','^MAXTOR','Maxtor',''], # note M2 M3 is usually maxtor, but can be samsung + ['^(MAXTOR|Atlas|TM[0-9]{4}|[KL]0[1-9])','^MAXTOR','Maxtor',''], # note M2 M3 is usually maxtor, but can be samsung ['^(Memorex|TravelDrive|TD\s?Classic)','^Memorex','Memorex',''], # note: C300/400 can be either micron or crucial, but C400 is M4 from crucial ['(^MT|^M5|^Micron|00-MT|C[34]00)','^Micron','Micron',''],# C400-MTFDDAK128MAM @@ -10128,12 +10147,15 @@ sub set_vendors { ['^Medion','^Medion','Medion',''], ['^(MEDIAMAX|WL[0-9]{2})','^MEDIAMAX','MediaMax',''], ['^Mengmi','^Mengmi','Mengmi',''], + ['^(Microsoft|S31)','^Microsoft','Microsoft',''], ['^MidasForce','^MidasForce','MidasForce',''], + ['^(Mimoco|Mimobot)','^Mimoco','Mimoco',''], ['^MINIX','^MINIX','MINIX',''], ['^Miracle','^Miracle','Miracle',''], # Monster MONSTER DIGITAL - ['^(Monster\s)+Digital','^(Monster\s)+Digital','Monster Digital',''], + ['^(Monster\s)+(Digital)?|OD[\s-]?ADVANCE','^(Monster\s)+(Digital)?','Monster Digital',''], ['^Morebeck','^Morebeck','Morebeck',''], + ['^(Motile|SSM[0-9])','^Motile','Motile',''], ['^(Motorola|XT[0-9]{4})','^Motorola','Motorola',''], ['^Moweek','^Moweek','Moweek',''], #MRMAD4B128GC9M2C @@ -10143,22 +10165,24 @@ sub set_vendors { ['^MTRON','^MTRON','MTRON',''], ['^(Neo\s*Forza|NFS[0-9])','^Neo\s*Forza','Neo Forza',''], ['^Netac','^Netac','Netac',''], + # NGFF is a type, like msata, sata ['^Nik','^Nikimi','Nikimi',''], ['^Orico','^Orico','Orico',''], ['^OSC','^OSC\b','OSC',''], ['^OWC','^OWC\b','OWC',''], ['^oyunkey','^oyunkey','Oyunkey',''], ['^PALIT','PALIT','Palit',''], # ssd + ['^Panram','^Panram','Panram',''], # ssd ['^(Pasoul|OASD)','^Pasoul','Pasoul',''], + ['^(Patriot|PS[8F]|VPN|Viper)','^Patriot([-\s]?Memory)?','Patriot',''],#Viper M.2 VPN100 ['^PERC\b','','Dell PowerEdge RAID Card',''], # ssd - ['^(PS[8F]|Patriot)','^Patriot([-\s]?Memory)?','Patriot',''], ['PHISON[\s-]?','PHISON[\s-]?','Phison',''],# E12-256G-PHISON-SSD-B3-BB1 ['^Pioneer','Pioneer','Pioneer',''], - ['^PIX[\s]?JR','^PIX[\s]?JR','Disney',''], ['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''], ['^(PQI|Intelligent\s?Stick)','^PQI','PQI',''], ['^(Premiertek|QSSD|Quaroni)','^Premiertek','Premiertek',''], - ['^Pretec','Pretec','Pretec',''], + ['^(Pretec|UltimateGuard)','Pretec','Pretec',''], + # PS3109S9 is the result of an error condition with ssd drive ['QEMU','^[0-9]*QEMU( QEMU)?','QEMU',''], # 0QUEMU QEMU HARDDISK ['(^Quantum|Fireball)','^Quantum','Quantum',''], ['^QUMO','^QUMO','Qumo',''], @@ -10175,15 +10199,16 @@ sub set_vendors { ['^Sannobel','^Sannobel','Sannobel',''], # SATADOM can be innodisk or supermirco: dom == disk on module # SATAFIRM is an ssd failure message + ['^(Sea\s?Tech|Transformer)','^Sea\s?Tech','Sea Tech',''], ['^SigmaTel','^SigmaTel','SigmaTel',''], # DIAMOND_040_GB ['^(SILICON\s?MOTION|SM[0-9])','^SILICON\s?MOTION','Silicon Motion',''], - ['(Silicon[\s-]?Power|^SP[CP]C|^Silicon|^Diamond|^Haspeed)','Silicon[\s-]?Power','Silicon Power',''], + ['(Silicon[\s-]?Power|^SP[CP]C|^Silicon|^Diamond|^HasTopSunlightpeed)','Silicon[\s-]?Power','Silicon Power',''], ['^SINTECHI?','^SINTECHI?','SinTech (adapter)',''], ['Smartbuy','\s?Smartbuy','Smartbuy',''], # SSD Smartbuy 60GB; mSata Smartbuy 3 # HFS128G39TND-N210A; seen nvme with name in middle ['(SK\s?HYNIX|^HF[MS]|^H[BC]G)','\s?SK\s?HYNIX','SK Hynix',''], - ['hynix','hynix','Hynix',''],# nvme middle of string, must be after sk hynix + ['(hynix|^HAG[0-9]|h[BC]8aP)','hynix','Hynix',''],# nvme middle of string, must be after sk hynix ['^SH','','Smart Modular Tech.',''], ['^Skill','^Skill','Skill',''], ['^(SMART( Storage Systems)?|TX)','^(SMART( Storage Systems)?)','Smart Storage Systems',''], @@ -10198,6 +10223,7 @@ sub set_vendors { ['^(Super\s*Talent|STT|F[HTZ]M[0-9]|PicoDrive|Teranova)','','Super Talent',''], ['^(SF|Swissbit)','^Swissbit','Swissbit',''], # ['^(SUPERSPEED)','^SUPERSPEED','SuperSpeed',''], # superspeed is a generic term + ['^Taisu','^Taisu','Taisu',''], ['^(TakeMS|ColorLine)','^TakeMS','TakeMS',''], ['^Tammuz','^Tammuz','Tammuz',''], ['^TANDBERG','^TANDBERG','Tanberg',''], @@ -10207,6 +10233,7 @@ sub set_vendors { ['^TEAM','^TEAM(\s*Group)?','TeamGroup',''], ['^(Teclast|CoolFlash)','^Teclast','Teclast',''], ['^Teelkoou','^Teelkoou','Teelkoou',''], + ['^Tele2','^Tele2','Tele2',''], ['^Teleplan','^Teleplan','Teleplan',''], ['^TEUTONS','^TEUTONS','TEUTONS',''], ['^Tigo','^Tigo','Tigo',''], @@ -10214,12 +10241,14 @@ sub set_vendors { ['^TKD','^TKD','TKD',''], ['^TopSunligt','^TopSunligt','TopSunligt',''], # is this a typo? hard to know ['^TopSunlight','^TopSunlight','TopSunlight',''], + ['^TOROSUS','^TOROSUS','Torosus',''], ['^([F]?TS|Transcend|JetDrive|JetFlash|USDU)','^Transcend','Transcend',''], - ['^(TrekStor|DS maxi)','^TrekStor','TrekStor',''], + ['^(TrekStor|DS maxi|DataStation)','^TrekStor','TrekStor',''], ['^UDinfo','^UDinfo','UDinfo',''], ['^USBTech','^USBTech','USBTech',''], ['^(UNIC2)','^UNIC2','UNIC2',''], ['^(UG|Unigen)','^Unigen','Unigen',''], + ['^(USBest|UT16)','^USBest','USBest',''], ['^(OOS[1-9]|Utania)','Utania','Utania',''], ['^U-TECH','U-TECH','U-Tech',''], ['^VBOX','','VirtualBox',''], @@ -10251,6 +10280,7 @@ sub set_vendors { ); eval $end if $b_log; } + # receives space separated string that may or may not contain vendor data sub device_vendor { eval $start if $b_log; @@ -10728,17 +10758,18 @@ sub display_data(){ else { $driver = $drivers[0]; } + $row[0]->{main::key($num++,1,2,'driver')} = ''; $driver ||= 'N/A'; - $row[0]->{main::key($num++,0,2,'driver')} = $driver; + $row[0]->{main::key($num++,1,3,'loaded')} = $driver; if ($driver_missing){ - $row[0]->{main::key($num++,0,3,'note')} = $driver_missing; - } - if ($drivers[2]){ - $row[0]->{main::key($num++,0,3,'FAILED')} = $drivers[2]; + $row[0]->{main::key($num++,0,4,'note')} = $driver_missing; } if ($drivers[1]){ $row[0]->{main::key($num++,0,3,'unloaded')} = $drivers[1]; } + if ($drivers[2]){ + $row[0]->{main::key($num++,0,3,'failed')} = $drivers[2]; + } if ($extra > 1 && $drivers[3]){ $row[0]->{main::key($num++,0,3,'alternate')} = $drivers[3]; } @@ -11473,8 +11504,10 @@ sub get { lvm_data() if !$b_lvm_data; if (!@lvm){ my $key = 'Message'; + # note: arch linux has a bug where lvs returns 0 if non root start + my $message = ($b_active_lvm) ? $alerts{'lvs'}->{'permissions'} : main::row_defaults('lvm-data',''); push(@rows, { - main::key($num++,0,1,$key) => main::row_defaults('lvm-data',''), + main::key($num++,0,1,$key) => $message, },); } else { @@ -11488,7 +11521,8 @@ sub get { main::key($num++,0,1,$key) => $alerts{'lvs'}->{'permissions'}, },); } - elsif (@lsblk && !$b_active_lvm && $alerts{'lvs'}->{'action'} eq 'permissions'){ + elsif (@lsblk && !$b_active_lvm && ($alerts{'lvs'}->{'action'} eq 'permissions' || + $alerts{'lvs'}->{'action'} eq 'missing')){ my $key = 'Message'; push(@rows, { main::key($num++,0,1,$key) => main::row_defaults('lvm-data',''), @@ -11617,7 +11651,7 @@ sub create_recursive_components { #print "inside: -n", Data::Dumper::Dumper $component->[$i]; $$j = scalar @$rows if $b_admin; my $id; - if ($component->[0][0] =~ /^(bcache|dm-|md)[0-9]/){ + if ($component->[0] =~ /^(bcache|dm-|md)[0-9]/){ $id = $c .'-' . $m; $m++; } @@ -11625,16 +11659,16 @@ sub create_recursive_components { $id = $p . '-' . $l; $l++; } - $$rows[$$j]->{main::key($$num++,1,$l2,$id)} = $component->[0][0]; + $$rows[$$j]->{main::key($$num++,1,$l2,$id)} = $component->[0]; if ($extra > 1){ if ($b_admin){ - $$rows[$$j]->{main::key($$num++,0,$l3,'maj-min')} = $component->[0][1]; - $$rows[$$j]->{main::key($$num++,0,$l3,'mapped')} = $component->[0][3] if $component->[0][3]; - $size = main::get_size($component->[0][2],'string','N/A'); + $$rows[$$j]->{main::key($$num++,0,$l3,'maj-min')} = $component->[1]; + $$rows[$$j]->{main::key($$num++,0,$l3,'mapped')} = $component->[3] if $component->[3]; + $size = main::get_size($component->[2],'string','N/A'); $$rows[$$j]->{main::key($$num++,0,$l3,'size')} = $size; } #next if !$component->[$i][4]; - for (my $i = 1; $i < scalar @$component; $i++){ + for (my $i = 4; $i < scalar @$component; $i++){ create_recursive_components($type,$j,$num,$rows,$component->[$i],$indent+1,$c.'c',$p.'p'); } } @@ -11802,10 +11836,10 @@ sub recursive_component_data { if ($device =~ /^(bcache|dm-|md)[0-9]+$/){ $mapped = $dmmapper{$device}; $raw_logical[1] += $part[2] if $mapped && $mapped =~ /_(cdata|cmeta)$/; - push(@components, [[$device,$mm2,$part[2],$mapped],[recursive_component_data($mm2)]]); + push(@components, [$device,$mm2,$part[2],$mapped,[recursive_component_data($mm2)]]); } else { - push(@components,[[$device,$mm2,$part[2]]]); + push(@components,[$device,$mm2,$part[2]]); } } eval $end if $b_log; @@ -14509,7 +14543,7 @@ sub create_output_md { $rows[$j]->{main::key($num++,1,2,'Components')} = ''; 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','Failed',\@rows,\@failed,\$j,\$num,\$b_bump); create_components_output('mdraid','Spare',\@rows,\@spare,\$j,\$num,\$b_bump); if ($row->{'recovery-percent'}){ $j = scalar @rows; @@ -14632,7 +14666,7 @@ sub create_output_zfs { $rows[$j]->{main::key($num++,1,3,'Components')} = ''; my $b_bump; create_components_output('zfs','Online',\@rows,\@components_good,\$j,\$num,\$b_bump); - create_components_output('zfs','FAILED',\@rows,\@failed,\$j,\$num,\$b_bump); + create_components_output('zfs','Failed',\@rows,\@failed,\$j,\$num,\$b_bump); create_components_output('zfs','Available',\@rows,\@spare,\$j,\$num,\$b_bump); } } @@ -18062,7 +18096,7 @@ sub unmounted_filesystem { } } -## UsbData +## UsbData$base_arch_distro$base_arch_distro { package UsbData; @@ -18869,6 +18903,7 @@ sub get_compiler_version_linux { #$result='Linux version 5.8.0-18-generic (buildd@lgw01-amd64-057) (gcc (Ubuntu 10.2.0-5ubuntu2) 10.2.0, GNU ld (GNU Binutils for Ubuntu) 2.35) #19-Ubuntu SMP Wed Aug 26 15:26:32 UTC 2020'; # $result='Linux version 5.8.9-fw1 (fst@x86_64.frugalware.org) (gcc (Frugalware Linux) 9.2.1 20200215, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Tue Sep 15 16:38:57 CEST 2020'; # $result='Linux version 5.8.0-2-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.0-9) 10.2.0, GNU ld (GNU Binutils for Debian) 2.35) #1 SMP Debian 5.8.10-1 (2020-09-19)'; + $result='Linux version 5.9.0-5-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-1) 10.2.1 20201207, GNU ld (GNU Binutils for Debian) 2.35.1) #1 SMP Debian 5.9.15-1 (2020-12-17)'; if ($result =~ /(gcc|clang).*version\s([\S]+)/){ $version = $2; $version ||= 'N/A'; @@ -19825,6 +19860,10 @@ sub get_linux_distro { } } if ($extra > 0){ + my $base_arch_distro = 'anarchy|antergos|archbang|archlabs|archman|archstrike|arco|artix'; + $base_arch_distro .= '|blackarch|bluestar|chakra|ctios|endeavour|hyperbola|kaos|linhes'; + $base_arch_distro .= '|manjaor|mysys2|netrunner\s?rolling|ninja|obarun|parabola'; + $base_arch_distro .= '|puppyrus-?a|reborn|snal|talkingarch|ubos'; my $base_debian_version_distro = 'sidux'; my $base_debian_version_osr = '\belive|lmde|neptune|parrot|pureos|rescatux|septor|sparky|tails'; my $base_default = 'antix-version|mx-version'; # osr has base ids @@ -19889,6 +19928,9 @@ sub get_linux_distro { ); $system_base = $manual{$id}; } + if (!$system_base && $distro && $distro =~ /^($base_arch_distro)/i){ + $system_base = 'Arch Linux'; + } if ($distro && -d '/etc/salixtools/' && $distro =~ /Slackware/i){ $system_base = $distro; } @@ -22307,14 +22349,14 @@ sub lsusb_data { eval $start if $b_log; my (@temp); my @data = data_grabber('lsusb'); - foreach (@data){ next if /^\s*$|^Couldn't/; # expensive second call: || /UNAVAIL/ @working = split(/\s+/, $_); + next unless defined $working[1] && defined $working[3]; $working[3] =~ s/:$//; # Seen FreeBSD lsusb with: # Bus /dev/usb Device /dev/ugen0.3: ID 24ae:1003 Shenzhen Rapoo Technology Co., Ltd. - next if !main::is_numeric($working[1]) || !main::is_numeric($working[3]); + next unless main::is_numeric($working[1]) && main::is_numeric($working[3]); $addr_id = int($working[3]); $bus_id = int($working[1]); $path_id = "$bus_id-$addr_id"; @@ -22382,7 +22424,7 @@ sub usbdevs_data { $port_value = ''; $working[0] = $bus_id; $working[1] = $addr_id; - $working[2] = $path_id; + $working[2] = $path; $working[3] = ''; $working[4] = 9; $working[5] = ''; |
