diff --git a/inxi b/inxi index 939f921..9d0419b 100755 --- a/inxi +++ b/inxi @@ -38,7 +38,7 @@ use Getopt::Long qw(GetOptions); Getopt::Long::Configure ('bundling', 'no_ignore_case', 'no_getopt_compat', 'no_auto_abbrev','pass_through'); use POSIX qw(ceil uname strftime ttyname); -# use Benchmark qw(:all); +# use Benchmark qw(:all);_ # use Devel::Size qw(size total_size); # use feature qw(say state); # 5.10 or newer Perl @@ -46,8 +46,8 @@ use POSIX qw(ceil uname strftime ttyname); ## INXI INFO ## my $self_name='inxi'; -my $self_version='3.3.04'; -my $self_date='2021-04-16'; +my $self_version='3.3.05'; +my $self_date='2021-07-11'; my $self_patch='00'; ## END INXI INFO ## @@ -1845,9 +1845,12 @@ sub display_data { ['kded4','--version'], ['kded5','--version'], ['kded6','--version'], + ['kded7','--version'], + ['kf-config','--version'], ['kf4-config','--version'], ['kf5-config','--version'], ['kf6-config','--version'], + ['kf7-config','--version'], ['kwin_x11','--version'], # ['locate','/Xorg'], # for Xorg.wrap problem ['loginctl','--no-pager list-sessions'], @@ -2327,7 +2330,8 @@ sub process_sys_traverse { close $fh; # print $fh "$result"; } - +# perl compiler complains on start if prune = 1 used only once, so either +# do $File::Find::prune = 1 if !$File::Find::prune; OR use no warnings 'once' sub wanted { # note: we want these directories pruned before the -d test so find # doesn't try to read files inside of the directories @@ -2338,17 +2342,16 @@ sub wanted { $File::Find::name =~ m!^/proc/k! || $File::Find::name =~ m!^/proc/bus/pci! || $File::Find::name =~ m!^/proc/(irq|spl|sys)!){ - # perl compiler complains on start if defined test not used - $File::Find::prune = 1 if defined $File::Find::prune; + $File::Find::prune = 1; return; } } elsif ($parse_src eq 'sys'){ # note: a new file in 4.11 /sys can hang this, it is /parameter/ then # a few variables. Since inxi does not need to see that file, we will - # not use it. Also do not need . files or __ starting files - if ($File::Find::name =~ m!/(\.[a-z]|kernel/|trace/|parameters|debug)!){ - $File::Find::prune = 1 if defined $File::Find::prune; + # not use it. + if ($File::Find::name =~ m!/(kernel/|trace/|parameters|debug)!){ + $File::Find::prune = 1; } } return if -d; # not directory @@ -2361,6 +2364,8 @@ sub wanted { # picdec\/|, wait_for_fb_sleep/wake is an odroid thing caused hang # wakeup_count also fails for android, but works fine on regular systems return if $b_arm && $File::Find::name =~ m!^/sys/power/(wait_for_fb_|wakeup_count$)!; + # do not need . files or __ starting files + return if $File::Find::name =~ m!/\.[a-z]!; # pp_num_states: amdgpu driver bug; android: wakeup_count return if $File::Find::name =~ m!/pp_num_states$!; # comment this one out if you experience hangs or if @@ -3718,7 +3723,9 @@ sub set_program_values { 'xchat-gnome' => ['[0-9.]+',2,'-v','X-Chat-Gnome',1,1,0,'',''], 'xchat' => ['[0-9.]+',2,'-v','X-Chat',1,1,0,'',''], ## Desktops / wm / compositors ## + '2bwm' => ['^2bwm',0,'0','2bWM',0,1,0,'',''], # unverified/based on mcwm '3dwm' => ['^3dwm',0,'0','3Dwm',0,1,0,'',''], # unverified + '5dwm' => ['^5dwm',0,'0','5Dwm',0,1,0,'',''], # unverified '9wm' => ['^9wm',3,'-version','9wm',0,1,0,'',''], 'aewm' => ['^aewm',3,'--version','aewm',0,1,0,'',''], 'aewm++' => ['^Version:',2,'-version','aewm++',0,1,0,'',''], @@ -3734,6 +3741,7 @@ sub set_program_values { 'budgie-wm' => ['^budgie',0,'0','budgie-wm',0,1,0,'',''], 'cagebreak' => ['^Cagebreak',3,'-v','Cagebreak',0,1,0,'',''], 'calmwm' => ['^calmwm',0,'0','CalmWM',0,1,0,'',''], # unverified + 'catwm' => ['^catwm',0,'0','catwm',0,1,0,'',''], # unverified 'cinnamon' => ['^cinnamon',2,'--version','Cinnamon',0,1,0,'',''], 'clfswm' => ['^clsfwm',0,'0','clfswm',0,1,0,'',''], # no version 'compiz' => ['^compiz',2,'--version','Compiz',0,1,0,'',''], @@ -3776,16 +3784,17 @@ sub set_program_values { 'ion3' => ['^ion3',0,'--version','Ion3',0,1,0,'',''], # unverified; also shell called ion 'jbwm' => ['jbwm',3,'-v','JBWM',0,1,0,'',''], # might use full path in match 'jwm' => ['^jwm',2,'--version','JWM',0,1,0,'',''], - 'kded' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0,'',''], - 'kded1' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0,'',''], - 'kded2' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0,'',''], - 'kded3' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0,'',''], - 'kded4' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0,'',''], + 'kded' => ['^KDE( Development Platform)?:',2,'--version','KDE',0,1,0,'\sDevelopment Platform',''], + 'kded1' => ['^KDE( Development Platform)?:',2,'--version','KDE',0,1,0,'\sDevelopment Platform',''], + 'kded2' => ['^KDE( Development Platform)?:',2,'--version','KDE',0,1,0,'\sDevelopment Platform',''], + 'kded3' => ['^KDE( Development Platform)?:',2,'--version','KDE',0,1,0,'\sDevelopment Platform',''], + 'kded4' => ['^KDE( Development Platform)?:',2,'--version','KDE',0,1,0,'\sDevelopment Platform',''], 'ksmcon' => ['^ksmcon',0,'0','ksmcon',0,1,0,'',''],# no version 'kwin' => ['^kwin',0,'0','kwin',0,1,0,'',''],# no version 'kwin_wayland' => ['^kwin_wayland',0,'0','kwin_wayland',0,1,0,'',''],# no version 'kwin_x11' => ['^kwin_x11',0,'0','kwin_x11',0,1,0,'',''],# no version 'larswm' => ['^larswm',2,'-v','larswm',0,1,1,'',''], + 'leftwm' => ['^leftwm',0,'0','LeftWM',0,1,0,'',''],# no version, in CHANGELOG 'liri' => ['^liri',0,'0','liri',0,1,0,'',''], 'lumina-desktop' => ['^\S',1,'--version','Lumina',0,1,1,'',''], 'lwm' => ['^lwm',0,'0','lwm',0,1,0,'',''], # no version @@ -3801,11 +3810,13 @@ sub set_program_values { 'mate-about' => ['^MATE[[:space:]]DESKTOP',-1,'--version','MATE',0,1,0,'',''], # note, mate-session when launched with full path returns full path in version string 'mate-session' => ['mate-session',-1,'--version','MATE',0,1,0,'',''], + 'mcwm' => ['^mcwm',0,'0','mcwm',0,1,0,'',''], # unverified/see 2bwm 'metacity' => ['^metacity',2,'--version','Metacity',0,1,0,'',''], 'metisse' => ['^metisse',0,'0','metisse',0,1,0,'',''], 'mini' => ['^Mini',5,'--version','Mini',0,1,0,'',''], 'mir' => ['^mir',0,'0','mir',0,1,0,'',''],# unverified 'moblin' => ['^moblin',0,'0','moblin',0,1,0,'',''],# unverified + 'monsterwm' => ['^monsterwm',0,'0','monsterwm',0,1,0,'',''],# unverified 'motorcar' => ['^motorcar',0,'0','motorcar',0,1,0,'',''],# unverified 'muffin' => ['^muffin',2,'--version','Muffin',0,1,0,'',''], 'musca' => ['^musca',0,'-v','Musca',0,1,0,'',''], # unverified @@ -3818,6 +3829,7 @@ sub set_program_values { 'pantheon' => ['^pantheon',0,'0','Pantheon',0,1,0,'',''],# no version 'papyros' => ['^papyros',0,'0','papyros',0,1,0,'',''],# no version 'pekwm' => ['^pekwm',3,'--version','PekWM',0,1,0,'',''], + 'penrose' => ['^penrose',0,'0','Penrose',0,1,0,'',''],# no version? 'perceptia' => ['^perceptia',0,'0','perceptia',0,1,0,'',''], 'picom' => ['^\S',1,'--version','Picom',0,1,0,'^v',''], 'plasmashell' => ['^plasmashell',2,'--version','KDE Plasma',0,1,0,'',''], @@ -3829,6 +3841,7 @@ sub set_program_values { 'sawfish' => ['^sawfish',3,'--version','Sawfish',0,1,0,'',''], 'scrotwm' => ['^scrotwm.*welcome.*',5,'-v','scrotwm',0,1,1,'',''], 'sommelier' => ['^sommelier',0,'0','sommelier',0,1,0,'',''], # unverified + 'snapwm' => ['^snapwm',0,'0','snapwm',0,1,0,'',''], # unverified 'spectrwm' => ['^spectrwm.*welcome.*wm',5,'-v','spectrwm',0,1,1,'',''], # out of stump, 2 --version, but in tries to start new wm instance endless hang 'stumpwm' => ['^SBCL',0,'--version','StumpWM',0,1,0,'',''], # hangs when run in wm @@ -3844,6 +3857,7 @@ sub set_program_values { 'unity' => ['^unity',2,'--version','Unity',0,1,0,'',''], 'unity-system-compositor' => ['^unity-system-compositor',2,'--version', 'unity-system-compositor (mir)',0,0,0,'',''], + 'uwm' => ['^uwm',0,'0','UWM',0,1,0,'',''], # unverified 'wavy' => ['^wavy',0,'0','wavy',0,1,0,'',''], # unverified 'waycooler' => ['^way',3,'--version','way-cooler',0,1,0,'',''], 'way-cooler' => ['^way',3,'--version','way-cooler',0,1,0,'',''], @@ -3852,8 +3866,11 @@ sub set_program_values { 'westford' => ['^westford',0,'0','westford',0,1,0,'',''], # unverified 'weston' => ['^weston',0,'0','weston',0,1,0,'',''], # unverified 'windowlab' => ['^windowlab',2,'-about','WindowLab',0,1,0,'',''], + 'wingo' => ['^wingo',0,'0','Wingo',0,1,0,'',''], # unverified 'wm2' => ['^wm2',0,'0','wm2',0,1,0,'',''], # no version 'wmaker' => ['^Window[[:space:]]*Maker',-1,'--version','WindowMaker',0,1,0,'',''], + 'wmfs' => ['^wmfs',0,'0','WMFS',0,1,0,'',''], # unverified + 'wmfs2' => ['^wmfs',0,'0','WMFS',0,1,0,'',''], # unverified 'wmii' => ['^wmii',1,'-v','wmii',0,1,0,'^wmii[234]?-',''], # wmii is wmii3 'wmii2' => ['^wmii2',1,'--version','wmii2',0,1,0,'^wmii[234]?-',''], 'wmx' => ['^wmx',0,'0','wmx',0,1,0,'',''], # no version @@ -3863,6 +3880,10 @@ sub set_program_values { 'xfdesktop' => ['xfdesktop[[:space:]]version',5,'--version','Xfce',0,1,0,'',''], # command: xfdesktop 'xfdesktop-toolkit' => ['Built[[:space:]]with[[:space:]]GTK',4,'--version','Gtk',0,1,0,'',''], + # ' This is xfwm4 version 4.16.1 (revision 5f61a84ad) for Xfce 4.16' + 'xfwm' => ['xfwm[3-8]? version',5,'--version','xfwm',0,1,0,'^^\s+',''],# unverified + 'xfwm4' => ['xfwm4? version',5,'--version','xfwm',0,1,0,'^^\s+',''], + 'xfwm5' => ['xfwm5? version',5,'--version','xfwm',0,1,0,'^^\s+',''], # unverified 'xmonad' => ['^xmonad',2,'--version','XMonad',0,1,0,'',''], 'yeahwm' => ['^yeahwm',0,'--version','YeahWM',0,1,0,'',''], # unverified ## Toolkits ## @@ -3875,6 +3896,7 @@ sub set_program_values { 'gdm' => ['^gdm',2,'--version','GDM',0,1,0,'',''], 'gdm3' => ['^gdm',2,'--version','GDM3',0,1,0,'',''], 'kdm' => ['^kdm',0,'0','KDM',0,1,0,'',''], + 'kdm3' => ['^kdm',0,'0','KDM',0,1,0,'',''], 'ldm' => ['^ldm',0,'0','LDM',0,1,0,'',''], 'lightdm' => ['^lightdm',2,'--version','LightDM',0,1,1,'',''], 'lxdm' => ['^lxdm',0,'0','LXDM',0,1,0,'',''], @@ -3936,7 +3958,7 @@ sub program_values { my ($app) = @_; my (@program_data); set_program_values() if !%program_values; - if ( defined $program_values{$app} ){ + if (defined $program_values{$app}){ @program_data = @{$program_values{$app}}; } # my $debug = Dumper \@program_data; @@ -4889,8 +4911,8 @@ sub get { 'force:s' => sub { my ($opt,$arg) = @_; if ($arg){ - my $wl = 'display|dmidecode|hddtemp|lsusb|man|meminfo|'; - $wl .= 'no-dig|no-doas|no-html-wan|no-sudo|usb-sys|vmstat|wmctrl'; + my $wl = 'display|dmidecode|hddtemp|lsusb|man|meminfo|no-dig|'; + $wl .= 'no-doas|no-html-wan|no-sudo|pkg|usb-sys|vmstat|wmctrl'; for (split(',',$arg)){ if ($_ =~ /\b($wl)\b/){ $force{lc($1)} = 1; @@ -4961,6 +4983,8 @@ sub get { else { main::error_handler('bad-arg', $opt, $arg); }}, + 'pkg' => sub { + $force{'pkg'} = 1 }, 'ppc' => sub { $b_ppc = 1 }, 'recommends' => sub { @@ -5323,7 +5347,7 @@ sub show_options { if ( $use{'weather'} ){ push(@data, ['1', '-w', '--weather', "Local weather data/time. To check an alternate - location, see -W. NO AUTOMATED QUERIES ALLOWED!"], + location, see -W. NO AUTOMATED QUERIES OR EXCESSIVE USE ALLOWED!"], ['1', '-W', '--weather-location', "[location] Supported options for [location]: postal code[,country/country code]; city, state (USA)/country (country/two character country code); latitude, longitude. Only use if you @@ -5586,6 +5610,8 @@ sub show_options { ['1', '', '--output-file', "[Full filepath|print] Output file to be used for --output." ], ['1', '', '--partition-sort', "[dev-base|fs|id|label|percent-used|size|uuid|used] Change sort order of ${partition_string} output. See man page for specifics." ], + ['1', '', '--pkg', "Force use of disabled package manager counts for packages feature. + RPM disabled by default due to possible massive rpm package query times." ], ['1', '', '--sensors-default', "Removes configuration item SENSORS_USE and SENSORS_EXCLUDE. Same as default behavior." ], ['1', '', '--sensors-exclude', "[sensor[s] name, comma separated] Exclude supplied sensor @@ -6321,19 +6347,22 @@ sub row_defaults { 'optical-data' => 'No optical or floppy data found.', 'optical-data-bsd' => 'No optical or floppy data found.', 'output-limit' => "Output throttled. IPs: $id; Limit: $limit; Override: --limit [1-x;-1 all]", - 'packages' => 'No packages detected. Unsupported package manager?', + 'package-data' => 'No packages detected. Unsupported package manager?', 'partition-data' => 'No partition data found.', 'partition-hidden' => 'N/A (hidden?)', 'pci-advanced-data' => 'bus/chip ids unavailable', 'pci-card-data' => 'No device data found.', 'pci-card-data-root' => 'Device data requires root.', 'pci-slot-data' => 'No PCI Slot data found.', + 'pm-disabled' => 'see --pkg', 'ps-data-null' => 'No process data available.', 'raid-data' => 'No RAID data found.', 'ram-data' => 'No RAM data found.', 'ram-data-complete' => 'For complete report, try with --dmidecode', 'ram-data-dmidecode' => 'No RAM data found. Try with --dmidecode', 'recommends' => 'see --recommends', + 'repo-data', "No repo data detected. Does $self_name support your package manager?", + 'repo-data-bsd', "No repo data detected. Does $self_name support $id?", 'root-feature' => 'Feature requires superuser permissions.', 'root-item-incomplete' => "Full $id report requires superuser permissions.", 'root-required' => '', @@ -9632,145 +9661,205 @@ sub cpu_arch { my $check = main::row_defaults('note-check'); # See: docs/inxi-resources.txt # print "type:$type fam:$family model:$model step:$stepping\n"; - if ( $type eq 'amd'){ + if ($type eq 'amd'){ if ($family eq '4'){ - if ( $model =~ /^(3|7|8|9|A)$/ ) {$arch = 'Am486'} - elsif ( $model =~ /^(E|F)$/ ) {$arch = 'Am5x86'} + if ($model =~ /^(3|7|8|9|A)$/){ + $arch = 'Am486'} + elsif ($model =~ /^(E|F)$/){ + $arch = 'Am5x86'} } elsif ($family eq '5'){ - if ( $model =~ /^(0|1|2|3)$/ ) {$arch = 'K5'} - elsif ( $model =~ /^(6|7)$/ ) {$arch = 'K6'} - elsif ( $model =~ /^(8)$/ ) {$arch = 'K6-2'} - elsif ( $model =~ /^(9|D)$/ ) {$arch = 'K6-3'} - elsif ( $model =~ /^(A)$/ ) {$arch = 'Geode'} + if ($model =~ /^(0|1|2|3)$/){ + $arch = 'K5'} + elsif ($model =~ /^(6|7)$/){ + $arch = 'K6'} + elsif ($model =~ /^(8)$/){ + $arch = 'K6-2'} + elsif ($model =~ /^(9|D)$/){ + $arch = 'K6-3'} + elsif ($model =~ /^(A)$/){ + $arch = 'Geode'} } elsif ($family eq '6'){ - if ( $model =~ /^(1|2)$/ ) {$arch = 'K7'} - elsif ( $model =~ /^(3|4)$/ ) {$arch = 'K7 Thunderbird'} - elsif ( $model =~ /^(6|7|8|A)$/ ) {$arch = 'K7 Palomino+'} - else {$arch = 'K7'} + if ($model =~ /^(1|2)$/){ + $arch = 'K7'} + elsif ($model =~ /^(3|4)$/){ + $arch = 'K7 Thunderbird'} + elsif ($model =~ /^(6|7|8|A)$/){ + $arch = 'K7 Palomino+'} + else { + $arch = 'K7'} } elsif ($family eq 'F'){ - if ( $model =~ /^(4|5|7|8|B|C|E|F|14|15|17|18|1B|1C|1F)$/ ) {$arch = 'K8'} - elsif ( $model =~ /^(21|23|24|25|27|28|2C|2F)$/ ) {$arch = 'K8 rev.E'} - elsif ( $model =~ /^(41|43|48|4B|4C|4F|5D|5F|68|6B|6C|6F|7C|7F|C1)$/ ) {$arch = 'K8 rev.F+'} - else {$arch = 'K8'} + if ($model =~ /^(4|5|7|8|B|C|E|F|14|15|17|18|1B|1C|1F)$/){ + $arch = 'K8'} + elsif ($model =~ /^(21|23|24|25|27|28|2C|2F)$/){ + $arch = 'K8 rev.E'} + elsif ($model =~ /^(41|43|48|4B|4C|4F|5D|5F|68|6B|6C|6F|7C|7F|C1)$/){ + $arch = 'K8 rev.F+'} + else { + $arch = 'K8'} } elsif ($family eq '10'){ - if ( $model =~ /^(2|4|5|6|8|9|A)$/ ) {$arch = 'K10'} - else {$arch = 'K10'} + if ($model =~ /^(2|4|5|6|8|9|A)$/){ + $arch = 'K10'} + else { + $arch = 'K10'} } elsif ($family eq '11'){ - if ( $model =~ /^(3)$/ ) {$arch = 'Turion X2 Ultra'} + if ($model =~ /^(3)$/){ + $arch = 'Turion X2 Ultra'} } # might also need cache handling like 14/16 elsif ($family eq '12'){ - if ( $model =~ /^(1)$/ ) {$arch = 'Fusion'} - else {$arch = 'Fusion'} + if ($model =~ /^(1)$/){ + $arch = 'Fusion'} + else { + $arch = 'Fusion'} } # SOC, apu elsif ($family eq '14'){ - if ( $model =~ /^(1|2)$/ ) {$arch = 'Bobcat'} - else {$arch = 'Bobcat'} + if ($model =~ /^(1|2)$/){ + $arch = 'Bobcat'} + else { + $arch = 'Bobcat'} } elsif ($family eq '15'){ - if ( $model =~ /^(0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F)$/ ) {$arch = 'Bulldozer'} - elsif ( $model =~ /^(10|11|12|13|14|15|16|17|18|19|1A|1B|1C|1D|1E|1F)$/ ) {$arch = 'Piledriver'} - elsif ( $model =~ /^(30|31|32|33|34|35|36|37|38|39|3A|3B|3C|3D|3E|3F)$/ ) {$arch = 'Steamroller'} - elsif ( $model =~ /^(60|61|62|63|64|65|66|67|68|69|6A|6B|6C|6D|6E|6F|70|71|72|73|74|75|76|77|78|79|7A|7B|7C|7D|7E|7F)$/ ) {$arch = 'Excavator'} - else {$arch = 'Bulldozer'} + if ($model =~ /^(0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F)$/){ + $arch = 'Bulldozer'} + elsif ($model =~ /^(10|11|12|13|14|15|16|17|18|19|1A|1B|1C|1D|1E|1F)$/){ + $arch = 'Piledriver'} + elsif ($model =~ /^(30|31|32|33|34|35|36|37|38|39|3A|3B|3C|3D|3E|3F)$/){ + $arch = 'Steamroller'} + elsif ($model =~ /^(60|61|62|63|64|65|66|67|68|69|6A|6B|6C|6D|6E|6F|70|71|72|73|74|75|76|77|78|79|7A|7B|7C|7D|7E|7F)$/){ + $arch = 'Excavator'} + else { + $arch = 'Bulldozer'} } # SOC, apu elsif ($family eq '16'){ - if ( $model =~ /^(0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F)$/ ) {$arch = 'Jaguar'} - elsif ( $model =~ /^(30|31|32|33|34|35|36|37|38|39|3A|3B|3C|3D|3E|3F)$/ ) {$arch = 'Puma'} - else {$arch = 'Jaguar'} + if ($model =~ /^(0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F)$/){ + $arch = 'Jaguar'} + elsif ($model =~ /^(30|31|32|33|34|35|36|37|38|39|3A|3B|3C|3D|3E|3F)$/){ + $arch = 'Puma'} + else { + $arch = 'Jaguar'} } elsif ($family eq '17'){ - if ( $model =~ /^(1|11|20)$/ ) {$arch = 'Zen'} + if ($model =~ /^(1|11|18|20)$/){ + $arch = 'Zen'} # Seen: stepping 1 is Zen+ Ryzen 7 3750H. But stepping 1 Zen is: Ryzen 3 3200U # Unknown if stepping 0 is Zen or either. - elsif ( $model =~ /^(18)$/ ) { + elsif ($model =~ /^(18)$/){ $arch = 'Zen/Zen+'; $note = $check; } - elsif ( $model =~ /^(8)$/ ) {$arch = 'Zen+'} - # not positive about 2x, main resource shows only listed hex values + # shares model 8 with zen, stepping unknown + elsif ($model =~ /^(8)$/){ + $arch = 'Zen+'} # used this but it didn't age well: ^(2[0123456789ABCDEF]| - elsif ( $model =~ /^(31|60|71|90)$/ ) {$arch = 'Zen 2'} - # no info on these yet, but they are coming and are scheduled - # elsif ( $model =~ /^()$/ ) {$arch = 'Zen 4'} + elsif ($model =~ /^(31|47|60|68|71|90)$/){ + $arch = 'Zen 2'} else { $arch = 'Zen'; $note = $check;} } elsif ($family eq '18'){ - # model #s not known yet + # model 0 $arch = 'Zen (Hygon Dhyana)'; } elsif ($family eq '19'){ - # unconfirmed: model: 0 20 40 50 + # model: 1 21 40 50 $arch = 'Zen 3'; } # note: family 20 may be Zen 4 but not known for sure yet + # elsif ($family eq '20'){ + # model: unknown + # $arch = 'Zen 4'; + # } } - elsif ( $type eq 'arm'){ - if ($family ne ''){$arch="ARMv$family";} - else {$arch='ARM';} + elsif ($type eq 'arm'){ + if ($family ne ''){ + $arch="ARMv$family";} + else { + $arch='ARM';} } -# elsif ( $type eq 'ppc'){ +# elsif ($type eq 'ppc'){ # $arch='PPC'; # } # aka VIA - elsif ( $type eq 'centaur'){ + elsif ($type eq 'centaur'){ if ($family eq '5'){ - if ( $model =~ /^(4)$/ ) {$arch = 'WinChip C6'} - elsif ( $model =~ /^(8)$/ ) {$arch = 'WinChip 2'} - elsif ( $model =~ /^(9)$/ ) {$arch = 'WinChip 3'} + if ($model =~ /^(4)$/){ + $arch = 'WinChip C6'} + elsif ($model =~ /^(8)$/){ + $arch = 'WinChip 2'} + elsif ($model =~ /^(9)$/){ + $arch = 'WinChip 3'} } elsif ($family eq '6'){ - if ( $model =~ /^(6)$/ ) {$arch = 'WinChip-based'} - elsif ( $model =~ /^(7|8)$/ ) {$arch = 'C3'} - elsif ( $model =~ /^(9)$/ ) {$arch = 'C3-2'} - elsif ( $model =~ /^(A|D)$/ ) {$arch = 'C7'} - elsif ( $model =~ /^(F)$/ ) {$arch = 'Isaiah'} + if ($model =~ /^(6)$/ ){ + $arch = 'WinChip-based'} + elsif ($model =~ /^(7|8)$/){ + $arch = 'C3'} + elsif ($model =~ /^(9)$/){ + $arch = 'C3-2'} + elsif ($model =~ /^(A|D)$/){ + $arch = 'C7'} + elsif ($model =~ /^(F)$/){ + $arch = 'Isaiah'} } } # note, to test uncoment $cpu{'type'} = Elbrus in proc/cpuinfo logic elsif ( $type eq 'elbrus'){ # E8CB if ($family eq '4'){ - if ($model eq '1') {$arch = 'Elbrus'} - elsif ($model eq '2') {$arch = 'Elbrus-S'} - elsif ($model eq '3') {$arch = 'Elbrus-4C'} - elsif ($model eq '4') {$arch = 'Elbrus-2C+'} - elsif ($model eq '6') {$arch = 'Elbrus-2CM'} - elsif ($model eq '7') { - if ($stepping >= 2) {$arch = 'Elbrus-8C1';} - else {$arch = 'Elbrus-8C';} + if ($model eq '1'){ + $arch = 'Elbrus'} + elsif ($model eq '2'){ + $arch = 'Elbrus-S'} + elsif ($model eq '3'){ + $arch = 'Elbrus-4C'} + elsif ($model eq '4'){ + $arch = 'Elbrus-2C+'} + elsif ($model eq '6'){ + $arch = 'Elbrus-2CM'} + elsif ($model eq '7'){ + if ($stepping >= 2){ + $arch = 'Elbrus-8C1';} + else { + $arch = 'Elbrus-8C';} } # note: stepping > 1 may be 8C1 - elsif ( $model eq '8' ) {$arch = 'Elbrus-1C+'} + elsif ( $model eq '8' ){ + $arch = 'Elbrus-1C+'} # 8C2 morphed out of E8CV, but the two were the same die - elsif ( $model eq '9' ) { + elsif ( $model eq '9' ){ $arch = 'Elbrus-8CV/8C2'; $note = $check;} - elsif ($model eq 'A') {$arch = 'Elbrus-12C'} - elsif ($model eq 'B') {$arch = 'Elbrus-16C'} - elsif ($model eq 'C') {$arch = 'Elbrus-2C3'} + elsif ($model eq 'A'){ + $arch = 'Elbrus-12C'} + elsif ($model eq 'B'){ + $arch = 'Elbrus-16C'} + elsif ($model eq 'C'){ + $arch = 'Elbrus-2C3'} else { $arch = 'Elbrus-??'; $note = $check;} } elsif ($family eq '5'){ - if ($model eq '9') {$arch = 'Elbrus-8C2'} + if ($model eq '9'){ + $arch = 'Elbrus-8C2'} else { $arch = 'Elbrus-??'; $note = $check;} } elsif ($family eq '6'){ - if ($model eq 'A') {$arch = 'Elbrus-12C'} - elsif ($model eq 'B') {$arch = 'Elbrus-16C'} - elsif ($model eq 'C') {$arch = 'Elbrus-2C3'} + if ($model eq 'A'){ + $arch = 'Elbrus-12C'} + elsif ($model eq 'B'){ + $arch = 'Elbrus-16C'} + elsif ($model eq 'C'){ + $arch = 'Elbrus-2C3'} else { $arch = 'Elbrus-??'; $note = $check;} @@ -9780,57 +9869,98 @@ sub cpu_arch { $note = $check; } } - elsif ( $type eq 'intel'){ + elsif ($type eq 'intel'){ if ($family eq '4'){ - if ( $model =~ /^(0|1|2|3|4|5|6|7|8|9)$/ ) {$arch = '486'} + if ( $model =~ /^(0|1|2|3|4|5|6|7|8|9)$/ ){ + $arch = '486'} } elsif ($family eq '5'){ - if ( $model =~ /^(1|2|3|7)$/ ) {$arch = 'P5'} - elsif ( $model =~ /^(4|8)$/ ) {$arch = 'P5'} # MMX - elsif ( $model =~ /^(9|A)$/ ) {$arch = 'Lakemont'} + if ( $model =~ /^(1|2|3|7)$/ ){ + $arch = 'P5'} + elsif ( $model =~ /^(4|8)$/ ){ + $arch = 'P5'} # MMX + elsif ( $model =~ /^(9|A)$/ ){ + $arch = 'Lakemont'} } elsif ($family eq '6'){ - if ( $model =~ /^(1)$/ ) {$arch = 'P6 Pro'} - elsif ( $model =~ /^(3)$/ ) {$arch = 'P6 II Klamath'} - elsif ( $model =~ /^(5)$/ ) {$arch = 'P6 II Deschutes'} - elsif ( $model =~ /^(6)$/ ) {$arch = 'P6 II Mendocino'} - elsif ( $model =~ /^(7)$/ ) {$arch = 'P6 III Katmai'} - elsif ( $model =~ /^(8)$/ ) {$arch = 'P6 III Coppermine'} - elsif ( $model =~ /^(9)$/ ) {$arch = 'M Banias'} # pentium M - elsif ( $model =~ /^(A)$/ ) {$arch = 'P6 III Xeon'} - elsif ( $model =~ /^(B)$/ ) {$arch = 'P6 III Tualitin'} - elsif ( $model =~ /^(D)$/ ) {$arch = 'M Dothan'} # Pentium M - elsif ( $model =~ /^(E)$/ ) {$arch = 'M Yonah'} - elsif ( $model =~ /^(F|16)$/ ) {$arch = 'Core Merom'} - elsif ( $model =~ /^(15)$/ ) {$arch = 'M Tolapai'} # pentium M system on chip - elsif ( $model =~ /^(17|1D)$/ ) {$arch = 'Penryn'} - elsif ( $model =~ /^(1A|1E|1F|25|2C|2E|2F)$/ ) {$arch = 'Nehalem'} - elsif ( $model =~ /^(1C|26)$/ ) {$arch = 'Bonnell'} # atom Bonnell? 27? - elsif ( $model =~ /^(27|35|36)$/ ) {$arch = 'Saltwell'} - elsif ( $model =~ /^(25|2C|2F)$/ ) {$arch = 'Westmere'} - elsif ( $model =~ /^(2A|2D)$/ ) {$arch = 'Sandy Bridge'} - elsif ( $model =~ /^(37|4A|4D|5A|5D)$/ ) {$arch = 'Silvermont'} - elsif ( $model =~ /^(3A|3E)$/ ) {$arch = 'Ivy Bridge'} - elsif ( $model =~ /^(3C|3F|45|46)$/ ) {$arch = 'Haswell'} - elsif ( $model =~ /^(3D|47|4F|56)$/ ) {$arch = 'Broadwell'} - elsif ( $model =~ /^(4C)$/ ) {$arch = 'Airmont'} - elsif ( $model =~ /^(4E)$/ ) {$arch = 'Skylake'} + if ($model =~ /^(1)$/){ + $arch = 'P6 Pro'} + elsif ($model =~ /^(3)$/){ + $arch = 'P6 II Klamath'} + elsif ($model =~ /^(5)$/){ + $arch = 'P6 II Deschutes'} + elsif ($model =~ /^(6)$/){ + $arch = 'P6 II Mendocino'} + elsif ($model =~ /^(7)$/){ + $arch = 'P6 III Katmai'} + elsif ($model =~ /^(8)$/){ + $arch = 'P6 III Coppermine'} + elsif ($model =~ /^(9)$/){ + $arch = 'M Banias'} # pentium M + elsif ($model =~ /^(A)$/){ + $arch = 'P6 III Xeon'} + elsif ($model =~ /^(B)$/){ + $arch = 'P6 III Tualitin'} + elsif ($model =~ /^(D)$/){ + $arch = 'M Dothan'} # Pentium M + elsif ($model =~ /^(E)$/){ + $arch = 'M Yonah'} + elsif ($model =~ /^(F|16)$/){ + $arch = 'Core Merom'} + elsif ($model =~ /^(15)$/){ + $arch = 'M Tolapai'} # pentium M system on chip + elsif ($model =~ /^(17|1D)$/){ + $arch = 'Penryn'} + elsif ($model =~ /^(1A|1E|1F|25|2C|2E|2F)$/){ + $arch = 'Nehalem'} + elsif ($model =~ /^(1C|26)$/){ + $arch = 'Bonnell'} # atom Bonnell? 27? + elsif ($model =~ /^(27|35|36)$/){ + $arch = 'Saltwell'} + elsif ($model =~ /^(25|2C|2F)$/){ + $arch = 'Westmere'} + elsif ($model =~ /^(2A|2D)$/){ + $arch = 'Sandy Bridge'} + elsif ($model =~ /^(37|4A|4D|5A|5D)$/){ + $arch = 'Silvermont'} + elsif ($model =~ /^(3A|3E)$/){ + $arch = 'Ivy Bridge'} + elsif ($model =~ /^(3C|3F|45|46)$/){ + $arch = 'Haswell'} + elsif ($model =~ /^(3D|47|4F|56)$/){ + $arch = 'Broadwell'} + elsif ($model =~ /^(4C)$/){ + $arch = 'Airmont'} + elsif ($model =~ /^(4E)$/){ + $arch = 'Skylake'} # need to find stepping for these, guessing stepping 4 is last for SL - elsif ( $model =~ /^(55)$/ ) { - if ($stepping >= 5 && $stepping <= 7){$arch = 'Cascade Lake'} - elsif ($stepping >= 8){$arch = 'Cooper Lake'} - else {$arch = 'Skylake'} } - elsif ( $model =~ /^(57)$/ ) {$arch = 'Knights Landing'} - elsif ( $model =~ /^(5C|5F)$/ ) {$arch = 'Goldmont'} - elsif ( $model =~ /^(5E)$/ ) {$arch = 'Skylake-S'} - elsif ( $model =~ /^(66)$/ ) {$arch = 'Cannon Lake'} + elsif ($model =~ /^(55)$/){ + if ($stepping >= 5 && $stepping <= 7){ + $arch = 'Cascade Lake'} + elsif ($stepping >= 8){ + $arch = 'Cooper Lake'} + else { + $arch = 'Skylake'} } + elsif ($model =~ /^(57)$/){ + $arch = 'Knights Landing'} + elsif ($model =~ /^(5C|5F)$/){ + $arch = 'Goldmont'} + elsif ($model =~ /^(5E)$/){ + $arch = 'Skylake-S'} + elsif ($model =~ /^(66)$/){ + $arch = 'Cannon Lake'} # 6 are servers, 7 not - elsif ( $model =~ /^(6A|6C|7D|7E)$/ ) {$arch = 'Ice Lake'} - elsif ( $model =~ /^(7A)$/ ) {$arch = 'Goldmont Plus'} - elsif ( $model =~ /^(85)$/ ) {$arch = 'Knights Mill'} - elsif ( $model =~ /^(86)$/ ) {$arch = 'Tremont'} - elsif ( $model =~ /^(8C)$/ ) {$arch = 'Tiger Lake'} - elsif ( $model =~ /^(8E)$/ ) { + elsif ($model =~ /^(6A|6C|7D|7E)$/){ + $arch = 'Ice Lake'} + elsif ($model =~ /^(7A)$/){ + $arch = 'Goldmont Plus'} + elsif ($model =~ /^(85)$/){ + $arch = 'Knights Mill'} + elsif ($model =~ /^(8A|96|9C)$/){ + $arch = 'Tremont'} + elsif ($model =~ /^(8C|8D)$/){ + $arch = 'Tiger Lake'} + elsif ($model =~ /^(8E)$/){ # can be AmberL or KabyL if ($stepping == 9){ $arch = 'Amber/Kaby Lake'; @@ -9851,31 +9981,46 @@ sub cpu_arch { $arch = 'Kaby Lake'; $note = $check;} } - elsif ( $model =~ /^(9E)$/ ) { + elsif ($model =~ /^(8F)$/){ + $arch = 'Saphire Rapids'} # server + elsif ($model =~ /^(97|9A)$/){ + $arch = 'Alder Lake';} + elsif ($model =~ /^(9E)$/){ if ($stepping == 9){ - $arch = 'Kaby Lake'} + $arch = 'Kaby Lake';} elsif ($stepping >= 10 && $stepping <= 13){ $arch = 'Coffee Lake'} else { $arch = 'Kaby Lake'; $note = $check;} } - elsif ( $model =~ /^(A5)$/ ) {$arch = 'Comet Lake'} # steppings 0-5 + elsif ($model =~ /^(A5)$/){ + $arch = 'Comet Lake'} # steppings 0-5 + elsif ($model =~ /^(A7)$/){ + $arch = 'Rocket Lake'} # More info: comet: shares family/model, need to find stepping numbers - # Coming: meteor lake; alder lake; cooper lake; granite rapids; rocket lake; saphire rapids; + # Coming: meteor lake; granite rapids; diamond rapids } # itanium 1 family 7 all recalled elsif ($family eq 'B'){ - if ( $model =~ /^(0)$/ ) {$arch = 'Knights Ferry'} - if ( $model =~ /^(1)$/ ) {$arch = 'Knights Corner'} + if ($model =~ /^(0)$/){ + $arch = 'Knights Ferry'} + if ($model =~ /^(1)$/){ + $arch = 'Knights Corner'} } elsif ($family eq 'F'){ - if ( $model =~ /^(0|1)$/ ) {$arch = 'Netburst Willamette'} - elsif ( $model =~ /^(2)$/ ) {$arch = 'Netburst Northwood'} - elsif ( $model =~ /^(3)$/ ) {$arch = 'Netburst Prescott'} # 6? Nocona - elsif ( $model =~ /^(4)$/ ) {$arch = 'Netburst Smithfield'} # 6? Nocona - elsif ( $model =~ /^(6)$/ ) {$arch = 'Netburst Presler'} - else {$arch = 'Netburst'} + if ($model =~ /^(0|1)$/){ + $arch = 'Netburst Willamette'} + elsif ($model =~ /^(2)$/){ + $arch = 'Netburst Northwood'} + elsif ($model =~ /^(3)$/){ + $arch = 'Netburst Prescott'} # 6? Nocona + elsif ($model =~ /^(4)$/){ + $arch = 'Netburst Smithfield'} # 6? Nocona + elsif ($model =~ /^(6)$/){ + $arch = 'Netburst Presler'} + else { + $arch = 'Netburst'} } # this is not going to e accurate, WhiskyL or Kaby L can ID as Skylake # but if it's a new cpu microarch not handled yet, it may give better @@ -10223,8 +10368,8 @@ sub drive_data { foreach my $row (@partitions){ # don't count remote used, also, some cases mount # panfs is parallel NAS volume manager, need more data - # null is hammer fs slice - next if ($row->{'fs'} && $row->{'fs'} =~ /^(cifs|iso9660|nfs|null|overlay|panfs|sshfs|smbfs|unionfs)$/); + # null is hammer fs slice; nfs, nfs4 + next if ($row->{'fs'} && $row->{'fs'} =~ /^(cifs|iso9660|nfs\d{0,2}|null|overlay|panfs|sshfs|smbfs|unionfs)$/); # don't count zfs or file type swap next if ($row->{'swap-type'} && $row->{'swap-type'} ne 'partition'); # in some cases, like redhat, mounted cdrom/dvds show up in partition data @@ -11218,15 +11363,15 @@ sub set_vendors { # 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}$|^G[CD][1-9][QS]|^M[AB]G[0-9][FG]|SV[0-9]|[BE][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]|^SEM[1-9]|^U3\b|^SU[0-9]|^DX[1-9]|^S[CD][0-9]{2}G|ULTRA\s(FIT|trek)|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]|^S[CD][0-9]{2}G|ULTRA\s(FIT|trek)|Clip Sport|Cruzer|^Extreme|iXpand|SSD (Plus|U100) [1-9])','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) ; possible usb: 24AS # ST[numbers] excludes other ST starting devices - ['(^ST[0-9]{2}|[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',''], + ['(^(ATA\s)?ST[0-9]{2}|[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}|EZRX)','(^WDC|Western\s?Digital)','Western Digital',''], # rare cases WDC is in middle of string - ['(\bWDC\b)','','Western Digital',''], + ['(\bWDC\b|1002FAEX)','','Western Digital',''], ## THEN BETTER KNOWN ONESs ## # A-Data can be in middle of string ['^(.*\bA-?DATA|ASP[0-9]|AX[MN]|CH11|HV[1-9]|IM2|HD[1-9]|HDD\s?CH|IUM)','A-?DATA','A-Data',''], @@ -11242,7 +11387,7 @@ sub set_vendors { ['^(HGST|Touro|54[15]0|7250)','^HGST','HGST (Hitachi)',''], # HGST HUA ['^((ATA\s)?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}|c350|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]$|VK0)','^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',''], @@ -11251,8 +11396,8 @@ sub set_vendors { ['^PIONEER','^PIONEER','Pioneer',''], ['^(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|^SA[0-9]{2}G$)','[S]?TOSHIBA','Toshiba',''], # scsi-STOSHIBA_STOR.E_EDITION_ + # note: seen: KXG50ZNV512G NVMe TOSHIBA 512GB | THNSN51T02DUK NVMe TOSHIBA 1024GB + ['(^[S]?TOS|^THN|TOSHIBA|TransMemory|^M[GKQ][0-9]|KBG4|^HDW|^SA[0-9]{2}G$|^(008|016|032|064|128)G[379E][0-9A]$)','[S]?TOSHIBA','Toshiba',''], # scsi-STOSHIBA_STOR.E_EDITION_ ## LAST: THEY ARE SHORT AND COULD LEAD TO FALSE ID, OR ARE UNLIKELY ## # unknown: AL25744_12345678; ADP may be usb 2.5" adapter; udisk unknown: Z1E6FTKJ 00AAKS # SSD2SC240G726A10 MRS020A128GTS25C EHSAJM0016GB @@ -11285,14 +11430,15 @@ sub set_vendors { ['^(ASM|2115)','^ASM','ASMedia',''],#asm1153e ['^(AVEXIR|AVSSD)','^AVEXIR','Avexir',''], ['^Axiom','^Axiom','Axiom',''], + ['^Bamba','^Bamba','Bamba',''], ['^Bell\b','^Bell','Packard Bell',''], ['^(BelovedkaiAE|GhostPen)','^BelovedkaiAE','BelovedkaiAE',''], ['^BHT','^BHT','BHT',''], - ['^(Big\s?Reservoir|BG\b)','^Big\s?Reservoir','Big Reservoir',''], + ['^(Big\s?Reservoir|B[RG][_\s-])','^Big\s?Reservoir','Big Reservoir',''], ['^BIOSTAR','^BIOSTAR','Biostar',''], ['^BIWIN','^BIWIN','BIWIN',''], ['^Blackpcs','^Blackpcs','Blackpcs',''], - ['^(MyDigitalSSD|BP4)','^MyDigitalSSD','MyDigitalSSD',''], # BP4 = BulletProof4 + ['^Bory','^Bory','Bory',''], ['^Braveeagle','^Braveeagle','BraveEagle',''], ['^(BUFFALO|BSC)','^BUFFALO','Buffalo',''], # usb: BSCR05TU2 ['^Bulldozer','^Bulldozer','Bulldozer',''], @@ -11301,6 +11447,7 @@ sub set_vendors { ['^(Canon|MP49)','^Canon','Canon',''], ['^Centerm','^Centerm','Centerm',''], ['^(Centon|DS pro)','^Centon','Centon',''], + ['^(CFD|CSSD)','^CFD','CFD',''], ['^(Chipsbank|CHIPSBNK)','^Chipsbank','Chipsbank',''], ['^CHN\b','','Zheino',''], ['^Clover','^Clover','Clover',''], @@ -11323,11 +11470,15 @@ sub set_vendors { ['^DGM','^DGM\b','DGM',''], ['^Digifast','^Digifast','Digifast',''], ['^DIGITAL\s?FILM','DIGITAL\s?FILM','Digital Film',''], + ['^Dikom','^Dikom','Dikom',''], + ['^Disain','^Disain','Disain',''], ['^(Disney|PIX[\s]?JR)','^Disney','Disney',''], ['^(Doggo|DQ-|Sendisk|Shenchu)','^(doggo|Sendisk(.?Shenchu)?|Shenchu(.?Sendisk)?)','Doggo (SENDISK/Shenchu)',''], ['^(Dogfish|Shark)','^Dogfish(\s*Technology)?','Dogfish Technology',''], ['^DragonDiamond','^DragonDiamond','DragonDiamond',''], ['^DREVO\b','^DREVO','Drevo',''], + ['^DREVO\b','^DREVO','Drevo',''], + ['^(Dynabook|AE[1-3]00)','^Dynabook','Dynabook',''], # DX1100 is probably sandisk, but could be HP, or it could be hp branded sandisk ['^(Eaget|V8$)','^Eaget','Eaget',''], ['^EDGE','^EDGE','EDGE Tech',''], @@ -11363,6 +11514,7 @@ sub set_vendors { ['^Getrich','^Getrich','Getrich',''], ['^Gigabyte','^Gigabyte','Gigabyte',''], # SSD ['^Gigastone','^Gigastone','Gigastone',''], + ['^Gigaware','^Gigaware','Gigaware',''], ['^Gloway','^Gloway','Gloway',''], ['^Goldendisk','^Goldendisk','Goldendisk',''], ['^Goldenfir','^Goldenfir','Goldenfir',''], @@ -11371,6 +11523,7 @@ sub set_vendors { # supertalent also has FM: |FM ['^(G[\.]?SKILL)','^G[\.]?SKILL','G.SKILL',''], ['^G[\s-]*Tech','^G[\s-]*Technology','G-Technology',''], + ['^(Haajan|HS[1-9])','^Haajan','Haajan',''], ['^Haizhide','^Haizhide','Haizhide',''], ['^(Hama|FlashPen\s?Fancy)','^Hama','Hama',''], ['^HDC','^HDC\b','HDC',''], @@ -11384,13 +11537,14 @@ sub set_vendors { ['^(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 + ['^(Inateck|FE20)','^Inateck','Inateck',''], ['^(Inca\b|Npenterprise)','^Inca','Inca',''], ['^(Indilinx|IND-)','^Indilinx','Indilinx',''], ['^INDMEM','^INDMEM','INDMEM',''], ['^Inland','^Inland','Inland',''], - ['^(InnoDisk|Innolite)','^InnoDisk( Corp.)?','InnoDisk',''], + ['^(InnoDisk|Innolite|SATA\s?Slim)','^InnoDisk( Corp.)?','InnoDisk',''], ['Innostor','Innostor','Innostor',''], - ['^Innovation','^Innovation(\s*IT)?','Innovation IT',''], + ['(^Innovation|Innovation\s?IT)','Innovation(\s*IT)?','Innovation IT',''], ['^Innovera','^Innovera','Innovera',''], ['^Intaiel','^Intaiel','Intaiel',''], ['^(INM|Integral|V\s?Series)','^Integral(\s?Memory)?','Integral Memory',''], @@ -11408,11 +11562,12 @@ sub set_vendors { ['^Kingfast','^Kingfast','Kingfast',''], ['^KingMAX','^KingMAX','KingMAX',''], ['^Kingrich','^Kingrich','KingrSU04Gich',''], - ['^KING\s?SHA\s?RE','^KING\s?SHA\s?RE','KingShare',''], - ['^(KingSpec|ACSC|KS[DQ]|N[ET]-[0-9]|P4\b|PA18)','^KingSpec','KingSpec',''], + ['KING\s?SHA\s?RE','KING\s?SHA\s?RE','KingShare',''], + ['^(KingSpec|ACSC|KS[DQ]|N[ET]-[0-9]|P4\b|PA18|T-(3260|64|128))','^KingSpec','KingSpec',''], ['^KingSSD','^KingSSD','KingSSD',''], # kingwin docking, not actual drive ['^(EZD|EZ-Dock)','','Kingwin Docking Station',''], + ['^Kingwin','^Kingwin','Kingwin',''], ['(KIOXIA|^K[BX]G[0-9])','KIOXIA','KIOXIA',''], # company name comes after product ID ['^KLEVV','^KLEVV','KLEVV',''], ['^Kodak','^Kodak','Kodak',''], @@ -11421,6 +11576,7 @@ sub set_vendors { ['^(Lacie|P92|itsaKey|iamaKey)','^Lacie','LaCie',''], ['^LANBO','^LANBO','LANBO',''], ['^LANTIC','^LANTIC','Lantic',''], + ['^(Lazos|L-?ISS)','^Lazos','Lazos',''], ['^LDLC','^LDLC','LDLC',''], # LENSE30512GMSP34MEAT3TA / UMIS RPITJ256PED2MWX ['^(LEN|UMIS)','^Lenovo','Lenovo',''], @@ -11433,7 +11589,8 @@ sub set_vendors { ['^(M-Systems|DiskOnKey)','^M-Systems','M-Systems',''], ['^(Mach\s*Xtreme|MXSSD|MXU)','^Mach\s*Xtreme','Mach Xtreme',''], ['^Maximus','^Maximus','Maximus',''], - ['^(MAXTOR|Atlas|TM[0-9]{4}|[KL]0[1-9]|Y[0-9]{3}[A-Z]|STM[0-9])','^MAXTOR','Maxtor',''], # note M2 M3 is usually maxtor, but can be samsung + ['^Maxone','^Maxone','Maxone',''], + ['^(MAXTOR|Atlas|TM[0-9]{4}|[KL]0[1-9]|Y[0-9]{3}[A-Z]|STM[0-9]|F[0-9]{3}L)','^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 @@ -11460,17 +11617,19 @@ sub set_vendors { ['^Moweek','^Moweek','Moweek',''], #MRMAD4B128GC9M2C ['^(MRMA|Memoright)','^Memoright','Memoright',''], - ['^MTASE','^MTASE','MTASE',''], ['^MSI\b','^MSI\b','MSI',''], + ['^MTASE','^MTASE','MTASE',''], ['^MTRON','^MTRON','MTRON',''], + ['^(MyDigitalSSD|BP4)','^MyDigitalSSD','MyDigitalSSD',''], # BP4 = BulletProof4 ['^(Neo\s*Forza|NFS[0-9])','^Neo\s*Forza','Neo Forza',''], ['^Netac','^Netac','Netac',''], # NGFF is a type, like msata, sata ['^Nik','^Nikimi','Nikimi',''], ['^NOREL','^NOREL(SYS)?','NorelSys',''], + ['^Olympus','^Olympus','Olympus',''], ['^Orico','^Orico','Orico',''], ['^OSC','^OSC\b','OSC',''], - ['^OWC','^OWC\b','OWC',''], + ['^(OWC|Aura)','^OWC\b','OWC',''], ['^oyunkey','^oyunkey','Oyunkey',''], ['^PALIT','PALIT','Palit',''], # ssd ['^Panram','^Panram','Panram',''], # ssd @@ -11478,7 +11637,7 @@ sub set_vendors { ['^(Pasoul|OASD)','^Pasoul','Pasoul',''], ['^(Patriot|PS[8F]|VPN|Viper)','^Patriot([-\s]?Memory)?','Patriot',''],#Viper M.2 VPN100 ['^PERC\b','','Dell PowerEdge RAID Card',''], # ssd - ['PHISON[\s-]?','PHISON[\s-]?','Phison',''],# E12-256G-PHISON-SSD-B3-BB1 + ['(PHISON[\s-]?|ESR[0-9])','PHISON[\s-]?','Phison',''],# E12-256G-PHISON-SSD-B3-BB1 ['^Pioneer','Pioneer','Pioneer',''], ['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''], ['^(PQI|Intelligent\s?Stick|Cool\s?Drive)','^PQI','PQI',''], @@ -11488,8 +11647,10 @@ sub set_vendors { ['QEMU','^[0-9]*QEMU( QEMU)?','QEMU',''], # 0QUEMU QEMU HARDDISK ['(^Quantum|Fireball)','^Quantum','Quantum',''], ['^QUMO','^QUMO','Qumo',''], - ['^(R3|AMD\s?(RADEON)?)','AMD\s?(RADEON)?','AMD Radeon',''], # ssd + ['^(R[3-9]|AMD\s?(RADEON)?|Radeon)','AMD\s?(RADEON)?','AMD Radeon',''], # ssd ['^(Ramaxel|RT|RM|RPF|RDM)','^Ramaxel','Ramaxel',''], + ['^(Ramsta|R[1-9])','^Ramsta','Ramsta',''], + ['^(Realtek|RTL)','^Realtek','Realtek',''], ['^RENICE','^RENICE','Renice',''], ['^RevuAhn','^RevuAhn','RevuAhn',''], ['^(Ricoh|R5)','^Ricoh','Ricoh',''], @@ -11550,9 +11711,10 @@ sub set_vendors { ['^TopSunligt','^TopSunligt','TopSunligt',''], # is this a typo? hard to know ['^TopSunlight','^TopSunlight','TopSunlight',''], ['^TOROSUS','^TOROSUS','Torosus',''], - ['^([F]?TS|Transcend|JetDrive|JetFlash|USDU)','^Transcend','Transcend',''], + ['^([F]?TS|Transcend|JetDrive|JetFlash|USDU|EZEX)','^Transcend','Transcend',''], ['^(TrekStor|DS (maxi|pocket)|DataStation)','^TrekStor','TrekStor',''], ['^(TwinMOS|TW[0-9])','^TwinMOS','TwinMOS',''], + # note: udisk means usb disk, it's not a vendor ID ['^UDinfo','^UDinfo','UDinfo',''], ['^USBTech','^USBTech','USBTech',''], ['^(UNIC2)','^UNIC2','UNIC2',''], @@ -11577,6 +11739,7 @@ sub set_vendors { ['^Xintor','^Xintor','Xintor',''], ['^XPG','^XPG','XPG',''], ['^XrayDisk','^XrayDisk','XrayDisk',''], + ['^Xstar','^Xstar','Xstar',''], ['^(XUM|HX[0-9])','^XUM','XUM',''], ['^XUNZHE','^XUNZHE','XUNZHE',''], ['^(Yeyian|valk)','^Yeyian','Yeyian',''], @@ -12743,6 +12906,7 @@ sub display_compositor { ['mir','mir','','mir'], ['moblin','moblin','','moblin'], ['motorcar','motorcar','','motorcar'], + ['monsterwm','monsterwm','','monsterwm'], ['orbital','orbital','','orbital'], ['papyros','papyros','','papyros'], ['perceptia','perceptia','','perceptia'], @@ -12760,6 +12924,9 @@ sub display_compositor { ['wayhouse','wayhouse','','wayhouse'], ['westford','westford','','westford'], ['xcompmgr','xcompmgr','','xcompmgr'], + ['xfwm4','xfwm4','','xfwm4'], + ['xfwm5','xfwm5','','xfwm5'], + ['xfwm','xfwm','','xfwm'], ); foreach my $item (@compositors){ # no need to use check program with short list of ps_gui @@ -15953,10 +16120,10 @@ sub zfs_output { main::key($num++,0,2,'type') => $row->{'type'}, main::key($num++,0,2,'status') => $row->{'status'}, }); - $size = ($row->{'size'}) ? main::get_size($row->{'size'},'string') : ''; - $available = main::get_size($row->{'free'},'string',''); # could be zero free + $size = ($row->{'raw-size'}) ? main::get_size($row->{'raw-size'},'string') : ''; + $available = main::get_size($row->{'raw-free'},'string',''); # could be zero free if ($extra > 2){ - $allocated = ($row->{'allocated'}) ? main::get_size($row->{'allocated'},'string') : ''; + $allocated = ($row->{'raw-allocated'}) ? main::get_size($row->{'raw-allocated'},'string') : ''; } @arrays = @{$row->{'arrays'}}; @arrays = grep {defined $_} @arrays; @@ -15969,47 +16136,57 @@ sub zfs_output { elsif ($count < 2 && $arrays[0]->{'level'}){ $rows[$j]->{main::key($num++,0,2,'level')} = $arrays[0]->{'level'}; } - if ($size){ - # print "here 0\n"; - $rows[$j]->{main::key($num++,0,2,'size')} = $size; - $size = ''; - $b_row_1_sizes = 1; + if ($size || $available || $allocated){ + $rows[$j]->{main::key($num++,1,2,'raw')} = ''; + if ($size){ + # print "here 0\n"; + $rows[$j]->{main::key($num++,0,3,'size')} = $size; + $size = ''; + $b_row_1_sizes = 1; + } + if ($available){ + $rows[$j]->{main::key($num++,0,3,'free')} = $available; + $available = ''; + $b_row_1_sizes = 1; + } + if ($allocated){ + $rows[$j]->{main::key($num++,0,3,'allocated')} = $allocated; + $allocated = ''; + } } - if ($available){ - $rows[$j]->{main::key($num++,0,2,'free')} = $available; - $available = ''; - $b_row_1_sizes = 1; - } - if ($allocated){ - $rows[$j]->{main::key($num++,0,2,'allocated')} = $allocated; - $allocated = ''; + if ($row->{'zfs-size'}){ + $rows[$j]->{main::key($num++,1,2,'zfs-fs')} = ''; + $rows[$j]->{main::key($num++,0,3,'size')} = main::get_size($row->{'zfs-size'},'string'); + $rows[$j]->{main::key($num++,0,3,'free')} = main::get_size($row->{'zfs-free'},'string'); } foreach my $row2 (@arrays){ if ($count > 1){ $j = scalar @rows; $num = 1; - $size = ($row2->{'size'}) ? main::get_size($row2->{'size'},'string') : 'N/A'; - $available = ($row2->{'free'}) ? main::get_size($row2->{'free'},'string') : 'N/A'; + $size = ($row2->{'raw-size'}) ? main::get_size($row2->{'raw-size'},'string') : 'N/A'; + $available = ($row2->{'raw-free'}) ? main::get_size($row2->{'raw-free'},'string') : 'N/A'; $level = (defined $row2->{'level'}) ? $row2->{'level'}: 'linear'; $status = ($row2->{'status'}) ? $row2->{'status'}: 'N/A'; push(@rows, { main::key($num++,1,2,'Array') => $level, main::key($num++,0,3,'status') => $status, - main::key($num++,0,3,'size') => $size, - main::key($num++,0,3,'free') => $available, + main::key($num++,1,3,'raw') => '', + main::key($num++,0,4,'size') => $size, + main::key($num++,0,4,'free') => $available, }); } # items like cache may have one component, with a size on that component elsif (!$b_row_1_sizes){ # print "here $count\n"; - $size = ($row2->{'size'}) ? main::get_size($row2->{'size'},'string') : 'N/A'; - $available = ($row2->{'free'}) ? main::get_size($row2->{'free'},'string') : 'N/A'; - $rows[$j]->{main::key($num++,0,2,'size')} = $size; - $rows[$j]->{main::key($num++,0,2,'free')} = $available; + $size = ($row2->{'raw-size'}) ? main::get_size($row2->{'raw-size'},'string') : 'N/A'; + $available = ($row2->{'raw-free'}) ? main::get_size($row2->{'raw-free'},'string') : 'N/A'; + $rows[$j]->{main::key($num++,1,2,'raw')} = ''; + $rows[$j]->{main::key($num++,0,3,'size')} = $size; + $rows[$j]->{main::key($num++,0,3,'free')} = $available; if ($extra > 2){ - $allocated = ($row->{'allocated'}) ? main::get_size($row2->{'allocated'},'string') : ''; + $allocated = ($row->{'raw-allocated'}) ? main::get_size($row2->{'allocated'},'string') : ''; if ($allocated){ - $rows[$j]->{main::key($num++,0,2,'allocated')} = $allocated; + $rows[$j]->{main::key($num++,0,3,'allocated')} = $allocated; } } } @@ -16519,7 +16696,8 @@ sub zfs_data { eval $start if $b_log; my ($zpool) = @_; my (@components,@zfs); - my ($allocated,$free,$size,$size_holder,$size_logical,$status,@working); + my ($allocated,$free,$size,$size_holder,$status,$zfs_used,$zfs_avail, + $zfs_size,@working); my $b_v = 1; my ($i,$j,$k) = (0,0,0); if ($fake{'raid-zfs'}){ @@ -16539,6 +16717,7 @@ sub zfs_data { @working = main::grabber("$zpool list 2>/dev/null"); $b_v = 0; } + my $zfs_path = main::check_program('zfs'); # print Data::Dumper::Dumper \@working; main::log_data('dump','@working',\@working) if $b_log; if (!@working){ @@ -16560,36 +16739,50 @@ sub zfs_data { if (/^[\S]+/){ @components = (); $i = 0; - $raw_logical[0] += $size_holder if $size_holder; - $size_holder = $size = ($row[1] && $row[1] ne '-')? main::translate_size($row[1]): ''; + $size = ($row[1] && $row[1] ne '-') ? main::translate_size($row[1]): ''; $allocated = ($row[2] && $row[2] ne '-')? main::translate_size($row[2]): ''; $free = ($row[3] && $row[3] ne '-')? main::translate_size($row[3]): ''; + ($zfs_used,$zfs_avail) = zfs_fs_sizes($zfs_path,$row[0]) if $zfs_path; + if (defined $zfs_used && defined $zfs_avail){ + $zfs_size = $zfs_used + $zfs_avail; + $raw_logical[0] += $zfs_size; + } + else { + # must be BEFORE '$size_holder =' because only used if hits a new device + # AND unassigned via raid/mirror arrays. Corner case for > 1 device systems. + $raw_logical[0] += $size_holder if $size_holder; + $size_holder = $size; + } $status = (defined $row[$status_i] && $row[$status_i] ne '') ? $row[$status_i]: 'no-status'; $j = scalar @zfs; push(@zfs, { 'id' => $row[0], - 'allocated' => $allocated, 'arrays' => ([],), - 'free' => $free, - 'size' => $size, + 'raw-allocated' => $allocated, + 'raw-free' => $free, + 'raw-size' => $size, + 'zfs-free' => $zfs_avail, + 'zfs-size' => $zfs_size, 'status' => $status, 'type' => 'zfs', }); } # print Data::Dumper::Dumper \@zfs; # raid level is the second item in the output, unless it is not, sometimes it is absent - if ($row[1] =~ /raid|mirror/){ + elsif ($row[1] =~ /raid|mirror/){ $row[1] =~ s/^raid1/mirror/; #$row[1] =~ s/^raid/raid-/; # need to match in zpool status $k = scalar @{$zfs[$j]->{'arrays'}}; $zfs[$j]->{'arrays'}[$k]{'level'} = $row[1]; $i = 0; - $size_logical = $size = ($row[2] && $row[2] ne '-') ? main::translate_size($row[2]) : ''; - $size_holder = 0; - $raw_logical[0] += $size if $size; - $zfs[$j]->{'arrays'}[$k]{'size'} = $size; - $zfs[$j]->{'arrays'}[$k]{'allocated'} = ($row[3] && $row[3] ne '-') ? main::translate_size($row[3]) : ''; - $zfs[$j]->{'arrays'}[$k]{'free'} = ($row[4] && $row[4] ne '-') ? main::translate_size($row[4]) : ''; + $size = ($row[2] && $row[2] ne '-') ? main::translate_size($row[2]) : ''; + if (!defined $zfs_used || !defined $zfs_avail){ + $size_holder = 0; + $raw_logical[0] += $size if $size; + } + $zfs[$j]->{'arrays'}[$k]{'raw-allocated'} = ($row[3] && $row[3] ne '-') ? main::translate_size($row[3]) : ''; + $zfs[$j]->{'arrays'}[$k]{'raw-free'} = ($row[4] && $row[4] ne '-') ? main::translate_size($row[4]) : ''; + $zfs[$j]->{'arrays'}[$k]{'raw-size'} = $size; } # https://blogs.oracle.com/eschrock/entry/zfs_hot_spares elsif ($row[1] =~ /spares/){ @@ -16600,21 +16793,35 @@ sub zfs_data { # this second is a single device not in an array # ada0s2 25.9G 14.6G 11.3G - 0% 56% # gptid/3838f796-5c46-11e6-a931-d05099ac4dc2 - - - - - - - elsif ($row[1] =~ /^(sd[a-z]+|[a-z0-9]+[0-9]+|([\S]+)\/.*)$/ && - ($row[2] eq '-' || $row[2] =~ /^[0-9\.]+[MGTP]$/ )){ - $row[1] =~ /^(sd[a-z]+|[a-z0-9]+[0-9]+|([\S]+)\/.*)\s*(DEGRADED|FAULTED|OFFLINE)?$/; + # third is using /dev/disk/by-id + # ata-VBOX_HARDDISK_VB5b6350cd-06618d58 - - - - - - - - ONLINE + elsif ($row[1] =~ /^(sd[a-z]+|[a-z0-9]+[0-9]+|([\S]+)\/.*|(ata|mmc|nvme|pci|scsi|wwn)-\S+)$/ && + ($row[2] eq '-' || $row[2] =~ /^[0-9\.]+[MGTP]$/)){ + #print "r1:$row[1]",' :: ', Cwd::abs_path('/dev/disk/by-id/'.$row[1]), "\n"; + $row[1] =~ /^(sd[a-z]+|[a-z0-9]+[0-9]+|([\S]+)\/.*|(ata|mmc|nvme|pci|scsi|wwn)-\S+)\s.*?(DEGRADED|FAULTED|OFFLINE)?$/; + #my $working = ''; my $working = ($1) ? $1 : ''; # note: the negative case can never happen - my $state = ($3) ? $3 : ''; - my ($maj_min,$part_size); + my $state = ($4) ? $4 : ''; + my ($maj_min,$real,$part_size); if ($bsd_type && $working =~ /[\S]+\//){ $working = GlabelData::get($working); } + elsif (!$bsd_type && $row[1] =~ /^(ata|mmc|nvme|scsi|wwn)-/ && + -e "/dev/disk/by-id/$row[1]" && ($real = Cwd::abs_path('/dev/disk/by-id/'.$row[1]))){ + $real =~ s|/dev/||; + $working = $real; + } + elsif (!$bsd_type && $row[1] =~ /^(pci)-/ && + -e "/dev/disk/by-path/$row[1]" && ($real = Cwd::abs_path('/dev/disk/by-path/'.$row[1]))){ + $real =~ s|/dev/||; + $working = $real; + } # kind of a hack, things like cache may not show size/free # data since they have no array row, but they might show it in # component row: # ada0s2 25.9G 19.6G 6.25G - 0% 75% if (!$zfs[$j]->{'size'} && $row[2] && $row[2] ne '-') { - $size_logical = $size = ($row[2])? main::translate_size($row[2]): ''; + $size = ($row[2])? main::translate_size($row[2]): ''; $size_holder = 0; $zfs[$j]->{'arrays'}[$k]{'size'} = $size; $raw_logical[0] += $size if $size; @@ -16663,6 +16870,18 @@ sub zfs_data { eval $end if $b_log; return @zfs; } +sub zfs_fs_sizes { + my ($path,$id) = @_; + eval $start if $b_log; + my @result = main::grabber("$path list -pH $id 2>/dev/null",'','strip'); + main::log_data('dump','zfs list @result',\@result) if $b_log; + print Data::Dumper::Dumper \@result if $dbg[37]; + my @working = split(/\s+/,$result[0]); + eval $end if $b_log; + $working[1] = $working[1]/1024 if $working[1]; + $working[2] = $working[2]/1024 if $working[2]; + return ($working[1],$working[2]); +} sub zfs_status { eval $start if $b_log; my ($zpool,$zfs) = @_; @@ -16735,7 +16954,7 @@ sub check_zfs_status { ## RamItem { package RamItem; -my (@vendors); +my (@vendors,%vendor_ids); sub get { my (@data,@rows,$key1,@ram,$val1); my $num = 0; @@ -17135,10 +17354,19 @@ sub dmidecode_data { $data_width = $total_width; $total_width = $temp_width; } - if ((!$manufacturer || $manufacturer =~ /^([a-f0-9]{4})$/i) && $part_number){ + if ($manufacturer && $manufacturer =~ /^([a-f0-9]{4})$/i){ $vendor_id = lc($1) if $1; - ($manufacturer,$part_number) = ram_vendor($part_number); - $manufacturer = $vendor_id if !$manufacturer && $vendor_id; + } + if ((!$manufacturer || $vendor_id) && $part_number){ + my @result = ram_vendor($part_number); + $manufacturer = $result[0] if $result[0]; + $part_number = $result[1] if $result[1]; + } + if ($vendor_id && !$manufacturer){ + set_vendor_ids() if !%vendor_ids; + if ($vendor_ids{$vendor_id}){ + $manufacturer = $vendor_ids{$vendor_id}; + } } $ram[$handle]->{'derived-module-size'} = $derived_module_size; $ram[$handle]->{'modules'}[$i]{'configured-clock-speed'} = $configured_speed; @@ -17538,6 +17766,7 @@ sub set_vendors { ['^(CY|Cypress)','Cypress','Cypress',''], ['^(SNP|Dell)','Dell','Dell',''], ['^(PE[\d]{4}|Edge)','Edge','Edge',''], + ['^(Elpida|EB)','^Elpida','Elpida',''], ['^(GVT|Galvantech)','Galvantech','Galvantech',''], # if we get more G starters, make rules tighter ['^(G[A-Z]|Geil)','Geil','Geil',''], @@ -17545,10 +17774,13 @@ sub set_vendors { ['^(F4|G[\s\.-]?Skill)','G[\s\.-]?Skill','G.Skill',''], ['^(HP)','','HP',''], # no IDs found ['^(HX|HyperX)','HyperX','HyperX',''], + # qimonda spun out of infineon, same ids + # ['^(HYS]|Qimonda)','Qimonda','Qimonda',''], ['^(HY|Infineon)','Infineon','Infineon',''],#HY[A-Z]\d ['^(KSM|KVR|Kingston)','Kingston','Kingston',''], ['^(MT|Micron)','Micron','Micron',''], - ['^(M[BLERS][A-Z][1-7]|Mushkin)','Mushkin','Mushkin',''], + # seen: 992069 991434 997110S + ['^(M[BLERS][A-Z][1-7]|99[0-9]{3}|Mushkin)','Mushkin','Mushkin',''], ['^(OCZ)','^OCZ\b','OCZ',''], ['^([MN]D\d|OLOy)','OLOy','OLOy',''], ['^(M[ERS]\d|Nemix)','Nemix','Nemix',''], @@ -17566,6 +17798,40 @@ sub set_vendors { ['^(VK\d|Vaseky)','Vaseky','Vaseky',''], ); } +# note: many of these are pci ids, not confirmed valid for ram +sub set_vendor_ids { + %vendor_ids = { + '01f4' => 'Transcend',# confirmed + '02fe' => 'Elpida',# confirmed + '0314' => 'Mushkin',# confirmed + '1014' => 'IBM', + '1099' => 'Samsung', + '10c3' => 'Samsung', + '11e2' => 'Samsung', + '1249' => 'Samsung', + '144d' => 'Samsung', + '15d1' => 'Infineon', + '167d' => 'Samsung', + '196e' => 'PNY', + '1b1c' => 'Corsair', + '1b85' => 'OCZ', + '1c5c' => 'SK-Hynix', + '1cc1' => 'A-Data', + '0215' => 'Corsair',# confirmed + '2646' => 'Kingston', + '2c00' => 'Micron',# confirmed + '5105' => 'Qimonda',# confirmed + '802c' => 'Micron',# confirmed + '80ad' => 'SK-Hynix',# confirmed + '80ce' => 'Samsung',# confirmed + '8551' => 'Qimonda',# confirmed + '8564' => 'Transcend', + 'ad00' => 'SK-Hynix',# confirmed + 'c0a9' => 'Crucial', + 'ce00' => 'Samsung',# confirmed + # '' => '', + } +} sub ram_vendor { eval $end if $b_log; my ($id) = $_[0]; @@ -17605,7 +17871,7 @@ sub get { eval $start if $b_log; ($debugger_dir) = @_; my (@data,@rows,@rows_p,@rows_r); - if ($extra > 0 && !$loaded{'packages'}){ + if ($extra > 0 && !$loaded{'package-data'}){ my %packages = PackageData::get('main',\$num); my @data; for (keys %packages){ @@ -17626,10 +17892,14 @@ sub get { } else { if (!@rows_r){ - my $pm = (!$bsd_type) ? 'package manager': 'OS type'; - @data = ( - {main::key($num++,0,1,'Alert') => "No repo data detected. Does $self_name support your $pm?"}, - ); + my $pm_missing; + if ($bsd_type){ + $pm_missing = main::row_defaults('repo-data-bsd',$uname[0]); + } + else { + $pm_missing = main::row_defaults('repo-data'); + } + @data = ({main::key($num++,0,1,'Alert') => $pm_missing}); } @rows = (@rows_p,@rows_r,@data); } @@ -17645,6 +17915,8 @@ sub get_repos_linux { my $apt_termux = '/data/data/com.termux/files/usr' . $apt; $apt = $apt_termux if -e $apt_termux; # for android termux my $cards = '/etc/cards.conf'; + my $dnf_conf = '/etc/dnf/dnf.conf'; + my $dnf_repo_dir = '/etc/dnf.repos.d/'; my $eopkg_dir = '/var/lib/eopkg/'; my $nix = '/etc/nix/nix.conf'; my $pacman = '/etc/pacman.conf'; @@ -17860,23 +18132,31 @@ sub get_repos_linux { } } # redhat/suse - if (-d $yum_repo_dir || -f $yum_conf || -d $zypp_repo_dir){ - if (-d $yum_repo_dir || -f $yum_conf){ - @files = main::globber("$yum_repo_dir*.repo"); - push(@files, $yum_conf) if -f $yum_conf; - $repo = 'yum'; - } - elsif (-d $zypp_repo_dir){ - @files = main::globber("$zypp_repo_dir*.repo"); + if (-f $dnf_conf ||-d $dnf_repo_dir|| -d $yum_repo_dir || -f $yum_conf || + -d $zypp_repo_dir){ + @files = (); + push(@files, $dnf_conf) if -f $dnf_conf; + push(@files, main::globber("$dnf_repo_dir*.repo")) if -d $dnf_repo_dir; + push(@files, $yum_conf) if -f $yum_conf; + push(@files, main::globber("$yum_repo_dir*.repo")) if -d $yum_repo_dir; + if (-d $zypp_repo_dir){ + push(@files, main::globber("$zypp_repo_dir*.repo")); main::log_data('data',"zypp repo files:\n" . main::joiner(\@files, "\n", 'unset')) if $b_log; - $repo = 'zypp'; } - #$repo = 'yum'; # push(@files, "$ENV{'HOME'}/bin/scripts/inxi/data/repo/yum/rpmfusion-nonfree-1.repo"); if (@files){ foreach (sort @files){ @data2 = main::reader($_); push(@dbg_files, $_) if $debugger_dir; + if (/yum/){ + $repo = 'yum'; + } + elsif (/dnf/){ + $repo = 'dnf'; + } + elsif(/zypp/){ + $repo = 'zypp'; + } my ($enabled,$url,$title) = (undef,'',''); foreach my $line (@data2){ # this is a hack, assuming that each item has these fields listed, we collect the 3 @@ -17917,6 +18197,7 @@ sub get_repos_linux { if ($url && $title && $enabled){ push(@content, "$title ~ $url"); } + if (! @content){ $key = repo_data('missing',$repo); } @@ -18308,6 +18589,8 @@ sub repo_data { 'bsd-package-missing' => 'No enabled BSD pkg servers in', 'cards-active' => 'Active CARDS collections in', 'cards-missing' => 'No active CARDS collections in', + 'dnf-active' => 'Active dnf repos in', + 'dnf-missing' => 'No active dnf repos in', 'eopkg-active' => 'Active eopkg repo', 'eopkg-missing' => 'No active eopkg repos found', 'files-missing' => 'No repo files found in', @@ -19829,14 +20112,19 @@ sub proc_data { # note: $working[2] != 1 is wrong, it's not related # note: for zfs using /dev/sda no partitions, previous rule would have removed # the unmounted report because sdb was found in sdb1, but match of eg sdb1 and sdb12 - # makes this a problem, so usinig zfs_member test instead to filter out zfs members. - # in arm/android seen /dev/block/mmcblk0p12 + # makes this a problem, so using zfs_member test instead to filter out zfs members. + # For zfs using entire disk, ie, sda, in that case, all partitions sda1 sda9 (8BiB) + # belong to zfs, and aren't unmmounted, so if sda and partition sda9, + # remove from list. this only works for sdxx drives, but is better than no fix + # This logic may also end up working for btrfs partitions, and maybe hammer? + # In arm/android seen /dev/block/mmcblk0p12 # print "mount: $row->[-1]\n"; - if ( $row->[-1] !~ /^(nvme[0-9]+n|mmcblk|mtdblk|mtdblock)[0-9]+$/ && - $row->[-1] =~ /[a-z][0-9]+$|dm-[0-9]+$/ && - $row->[-1] !~ /\bloop/ && - !(grep {$row->[-1] =~ /$_$/} (@filters,@mounted)) && - !(grep {$_ =~ /(block\/)?$row->[-1]$/} @mounted)){ + if ($row->[-1] !~ /^(nvme[0-9]+n|mmcblk|mtdblk|mtdblock)[0-9]+$/ && + $row->[-1] =~ /[a-z][0-9]+$|dm-[0-9]+$/ && + $row->[-1] !~ /\bloop/ && + !(grep {$row->[-1] =~ /$_$/} (@filters,@mounted)) && + !(grep {$_ =~ /(block\/)?$row->[-1]$/} @mounted) && + !(grep {$_ =~ /^sd[a-z]+$/ && $row->[-1] =~ /^$_[0-9]+/} @mounted)){ $dev_mapped = $dmmapper{$row->[-1]} if $dmmapper{$row->[-1]}; if (@lsblk){ my $id = ($dev_mapped) ? $dev_mapped: $row->[-1]; @@ -19852,7 +20140,7 @@ sub proc_data { $size ||= $row->[2]; $fs = unmounted_filesystem($row->[-1]) if !$fs; # seen: (zfs|lvm2|linux_raid)_member; crypto_luks - # no te: lvm, raid members are neverm ounted. luks member is never mounted. + # no te: lvm, raid members are never mounted. luks member is never mounted. next if $fs && $fs =~ /(bcache|crypto|luks|_member)$/i; # these components of lvm raid will show as partitions byt are reserved private lvm member # See man lvm for all current reserved private volume names @@ -21136,8 +21424,17 @@ sub prep_desktop_value { } sub get_kde_trinity_data { eval $start if $b_log; - my ($program,@version_data,@version_data2); + my ($kded,$kded_name,$program,@version_data,@version_data2); my $kde_full_session = ($ENV{'KDE_FULL_SESSION'}) ? $ENV{'KDE_FULL_SESSION'} : ''; + # we can't rely on 3 using kded3, it could be kded + if ($kde_full_session && ($program = main::check_program('kded' . $kde_full_session))){ + $kded = $program; + $kded_name = 'kded' . $kde_full_session; + } + elsif ($program = main::check_program('kded')){ + $kded = $program; + $kded_name = 'kded'; + } if ($desktop_session eq 'trinity' || $xdg_desktop eq 'trinity' || (grep {/^tde/} @ps_gui) ){ $desktop[0] = 'Trinity'; if ($program = main::check_program('kdesktop')){ @@ -21155,13 +21452,13 @@ sub get_kde_trinity_data { # actual desktop data, so once that's in debian/ubuntu, if it gets in, add that test elsif ($xdg_desktop eq 'kde' || $kde_session_version){ if ($kde_session_version && $kde_session_version <= 4){ - @data = main::program_values("kded$kde_session_version"); + @data = ($kded_name) ? main::program_values($kded_name) : (); if (@data){ $desktop[0] = $data[3]; - $desktop[1] = main::program_version("kded$kde_session_version",$data[0],$data[1],$data[2],$data[5],$data[6]); + $desktop[1] = main::program_version($kded,$data[0],$data[1],$data[2],$data[5],$data[6]); # kded exists, so we can now get the qt data string as well - if ($desktop[1] && ($program = main::check_program("kded$kde_session_version")) ){ - @version_data = main::grabber("$program --version 2>/dev/null"); + if ($desktop[1] && $kded){ + @version_data = main::grabber("$kded --version 2>/dev/null"); } } $desktop[0] = 'KDE' if !$desktop[0]; @@ -21177,9 +21474,13 @@ sub get_kde_trinity_data { if (!@version_data && ($program = main::check_program("kf$kde_session_version-config") )){ @version_data = main::grabber("$program --version 2>/dev/null"); } - if (!@version_data && ($program = main::check_program("kded$kde_session_version"))){ + if (!@version_data && ($program = main::check_program("kf-config") )){ @version_data = main::grabber("$program --version 2>/dev/null"); } + # hope we don't use this fallback, not the same version as kde always + if (!@version_data && $kded){ + @version_data = main::grabber("$kded --version 2>/dev/null"); + } if ($program = main::check_program("plasmashell")){ @version_data2 = main::grabber("$program --version 2>/dev/null"); $desktop[1] = main::awk(\@version_data2,'^plasmashell',-1,'\s+'); @@ -21206,7 +21507,7 @@ sub get_kde_trinity_data { } # KDE_FULL_SESSION property is only available since KDE 3.5.5. elsif ($kde_full_session eq 'true'){ - @version_data = main::grabber("kded --version 2>/dev/null"); + @version_data = ($kded) ? main::grabber("$kded --version 2>/dev/null") : (); $desktop[0] = 'KDE'; $desktop[1] = main::awk(\@version_data,'^KDE:',2,'\s+') if @version_data; if (!$desktop[1]){ @@ -21240,7 +21541,9 @@ sub get_env_de_data { [0,'cinnamon','cinnamon',1,0], # these so far have no cli version data [1,'deepin','deepin',0,1], # version comes from file read + [1,'leftwm','leftwm',0,0], [1,'pantheon','pantheon',0,0], + [1,'penrose','penrose',0,0],# unknown, just guessing [1,'lumina','lumina-desktop',0,1], [0,'manokwari','manokwari',1,0], [1,'ukui','ukui-session',0,1], @@ -21348,7 +21651,6 @@ sub check_gnome { $detection = 'xprop-root'; $b_gnome = 1; } - main::log_data('data','$detection:$b_gnome>>' . $detection . ":$b_gnome") if $b_log; eval $end if $b_log; return $b_gnome; @@ -21381,7 +21683,7 @@ sub get_env_xprop_non_gnome_based_data { # out of x, this error goes to stderr, so it's an empty result $desktop[1] = main::awk(\@version_data,$data[0],$data[1],'\s+'); #$desktop[1] = main::program_version('xfdesktop',$data[0],$data[1],$data[2],$data[5],$data[6]); - if ( !$desktop[1] ){ + if (!$desktop[1]){ @data = main::program_values("xfce${version}-panel"); # print Data::Dumper::Dumper \@data; # this returns an error message to stdout in x, which breaks the version @@ -21456,6 +21758,7 @@ sub get_ps_de_data { my @desktops =( ['icewm','icewm','icewm'], ['WindowMaker','WindowMaker','wmaker',''], + ['2bwm','2bwm','2bwm',''],# unverified ['9wm','9wm','9wm',''], ['afterstep','afterstep','afterstep',''], ['aewm++','aewm\+\+','aewm++',''], @@ -21467,6 +21770,7 @@ sub get_ps_de_data { ['bspwm','bspwm','bspwm',''], ['cagebreak','cagebreak','cagebreak',''], ['calmwm','calmwm','calmwm',''], + ['catwm','catwm','catwm',''],# unverified ['clfswm','.*(sh|c?lisp)?.*clfswm','clfswm',''], ['ctwm','ctwm','ctwm',''], ['cwm','(openbsd-)?cwm','cwm',''], @@ -21492,7 +21796,9 @@ sub get_ps_de_data { ['jbwm','jbwm','jbwm',''], ['jwm','jwm','jwm',''], ['larswm','larswm','larswm',''], + ['leftwm','leftwm','leftwm',''], ['lwm','lwm','lwm',''], + ['mcwm','mcwm','mcwm',''],# unverified ['mini','mini','mini',''], ['musca','musca','musca',''], ['mvwm','mvwm','mvwm',''], @@ -21503,11 +21809,13 @@ sub get_ps_de_data { ['orbital','orbital','orbital',''], ['pekwm','pekwm','pekwm',''], ['perceptia','perceptia','perceptia',''], + ['penrose','penrose','penrose',''],# unverified ['qtile','.*(python.*)?qtile','qtile',''], ['qvwm','qvwm','qvwm',''], ['ratpoison','ratpoison','ratpoison',''], ['sawfish','sawfish','sawfish',''], ['scrotwm','scrotwm','scrotwm',''], + ['snapwm','snapwm','snapwm',''],# unverified ['spectrwm','spectrwm','spectrwm',''], ['stumpwm','(sh|c?lisp)?.*stumpwm','stumpwm',''], ['sway','sway','sway',''], @@ -21515,9 +21823,13 @@ sub get_ps_de_data { ['tinywm','tinywm','tinywm',''], ['tvtwm','tvtwm','tvtwm',''], ['twm','twm','twm',''], + ['uwm','uwm','uwm',''],# unverified ['waycooler','waycooler','way-cooler',''], ['way-cooler','way-cooler','way-cooler',''], ['windowlab','windowlab','windowlab',''], + ['wmfs','wmfs','wmfs',''],# unverified + ['wmfs2','wmfs2','wmfs2',''],# unverified + ['wingo','wingo','wingo',''],# unverified # not in debian apt, current is wmii, version 3 ['wmii2','wmii2','wmii2',''], ['wmii','wmii','wmii',''], @@ -21613,19 +21925,19 @@ sub get_wm_main { main::set_ps_gui() if ! $loaded{'ps-gui'}; # order matters, see above logic # due to lisp/python starters, clfswm/stumpwm/qtile will not detect here - $wms = '9wm|aewm\+\+|aewm|afterstep|amiwm|antiwm|awesome|blackbox|bspwm|budgie-wm|'; - $wms .= 'cagebreak|calmwm|clfswm|compiz|ctwm|(openbsd-)?cwm|fluxbox|'; - $wms .= 'deepin-wm|dwm|echinus|evilwm|'; + $wms = '2bwm|9wm|aewm\+\+|aewm|afterstep|amiwm|antiwm|awesome|blackbox|'; + $wms .= 'cagebreak|calmwm|catwm|clfswm|compiz|ctwm|(openbsd-)?cwm|fluxbox'; + $wms .= '|bspwm|budgie-wm|deepin-wm|dwm|echinus|evilwm|'; $wms .= 'fireplace|flwm|fvwm-crystal|fvwm1|fvwm2|fvwm3|fvwm95|fvwm|'; $wms .= 'gala|glass|gnome-shell|hackedbox|i3|instantwm|ion3|jbwm|jwm|'; - $wms .= 'twin|kwin_wayland|kwin_x11|kwin|larswm|lwm|'; - $wms .= 'matchbox-window-manager|marco|mini|muffin|'; + $wms .= 'twin|kwin_wayland|kwin_x11|kwin|larswm|leftwm|lwm|'; + $wms .= 'matchbox-window-manager|marco|mcwm|mini|muffin|'; $wms .= 'musca|deepin-mutter|mutter|deepin-metacity|metacity|mvwm|mwm|'; $wms .= 'nawm|notion|openbox|orbital|perceptia|qtile|qvwm|'; - $wms .= 'ratpoison|sawfish|scrotwm|spectrwm|'; + $wms .= 'penrose|ratpoison|sawfish|scrotwm|snapwm|spectrwm|'; $wms .= 'stumpwm|sway|tinywm|tvtwm|twm|ukwm|'; - $wms .= 'way-?cooler|windowlab|WindowMaker|wm2|wmii2|wmii|wmx|'; - $wms .= 'xfwm4|xfwm5|xmonad|yeahwm'; + $wms .= 'way-?cooler|windowlab|WindowMaker|wingo|wm2|wmfs2?|wmii2?|wmx|'; + $wms .= 'xfwm[45]?|xmonad|yeahwm'; foreach (@ps_gui){ if (/^($wms)$/){ $working = $1; @@ -22725,7 +23037,7 @@ sub get_display_manager { # ldm - LTSP display manager. Note that sddm does not appear to have a .pid # extension in Arch note: to avoid positives with directories, test for -f # explicitly, not -e. Guessing on cdm.pid. pcdm uses vt, PCDM-vt9.pid - my @dms = qw(cdm.pid entranced.pid gdm.pid gdm3.pid kdm.pid ldm.pid + my @dms = qw(cdm.pid entranced.pid gdm.pid gdm3.pid kdm.pid kdm3.pid ldm.pid lightdm.pid lxdm.pid mdm.pid nodm.pid pcdm.pid sddm.pid slim.lock slim.pid tdm.pid udm.pid wdm.pid xdm.pid xenodm.pid); # these are the only one I know of so far that have version info @@ -22746,11 +23058,11 @@ sub get_display_manager { $working = $id; $working =~ s/\.\S+$//; # note: there were issues with duplicated dm's in inxi, checking @found corrects it - if ( ( ( $b_run && ( -f "/run/$id" || -d "/run/$working" ) ) || - ( $b_vrun && ( -f "/var/run/$id" || -d "/var/run/$working" ) ) || - ( $b_vrunrc && ( -f "/var/run/rc.d/$working" || -d "/var/run/rc.d/$id" ) ) ) && - ! grep {/$working/} @found ){ - if ($extra > 2 && awk( \@dms_version, $working) && ($path = check_program($working)) ){} + if ((( $b_run && ( -f "/run/$id" || -d "/run/$working" )) || + ($b_vrun && ( -f "/var/run/$id" || -d "/var/run/$working")) || + ($b_vrunrc && ( -f "/var/run/rc.d/$working" || -d "/var/run/rc.d/$id"))) && + !grep {/$working/} @found ){ + if ($extra > 2 && awk( \@dms_version, $working) && ($path = check_program($working))){} else {$path = $working;} # print "$path $extra\n"; @data = program_data($working,$path,3); @@ -22880,7 +23192,7 @@ sub get_linux_distro { @osr = main::reader($os_release) if -r $os_release; if ($etc_issue){ $lc_issue = lc($etc_issue); - if ($lc_issue =~ /(antergos|grml|linux lite)/){ + if ($lc_issue =~ /(antergos|grml|linux lite|openmediavault)/){ $distro_id = $1; $b_skip_issue = 1; } @@ -23121,11 +23433,16 @@ sub system_base { $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 - my $base_issue = 'bunsen'; # base only found in issue - my $base_manual = 'blankon|deepin|kali'; # synthesize, no direct data available - my $base_osr = 'aptosid|grml|q4os|siduction|bodhi'; # osr base, distro id in list of distro files - my $base_osr_issue = 'grml|linux lite'; # osr base, distro id in issue + # osr has base ids + my $base_default = 'antix-version|mx-version'; + # base only found in issue + my $base_issue = 'bunsen'; + # synthesize, no direct data available + my $base_manual = 'blankon|deepin|kali'; + # osr base, distro id in list of distro files + my $base_osr = 'aptosid|grml|q4os|siduction|bodhi'; + # osr base, distro id in issue + my $base_osr_issue = 'grml|linux lite|openmediavault'; # osr has distro name but has ubuntu ID_LIKE/UBUNTU_CODENAME my $base_osr_ubuntu = 'mint|neon|nitrux|pop!_os|zorin'; my $base_upstream_lsb = '/etc/upstream-release/lsb-release'; @@ -23152,26 +23469,27 @@ sub system_base { $system_base = $etc_issue; } # more tests added here for other ubuntu derived distros - elsif ( @distro_files && (grep {/($base_default)/} @distro_files) ){ + elsif (@distro_files && (grep {/($base_default)/} @distro_files)){ $base_type = 'default'; } # must go before base_osr_ubuntu test - elsif ( grep {/($base_debian_version_osr)/i} @osr ){ + elsif (grep {/($base_debian_version_osr)/i} @osr){ $system_base = debian_id(); } - elsif ( grep {/($base_osr_ubuntu)/i} @osr ){ + elsif (grep {/($base_osr_ubuntu)/i} @osr){ $base_type = 'ubuntu'; } - elsif ( ( ($distro_id && $distro_id =~ /($base_osr_issue)/ ) || - (@distro_files && (grep {/($base_osr)/} @distro_files) ) ) && - !(grep {/($base_osr)/i} @osr)){ + elsif ((($distro_id && $distro_id =~ /($base_osr_issue)/) || + (@distro_files && (grep {/($base_osr)/} @distro_files))) && + !(grep {/($base_osr)/i} @osr)){ $system_base = get_os_release(); } if (!$system_base && $base_type){ $system_base = get_os_release($base_type); } } - if (!$system_base && @distro_files && ( grep {/($base_debian_version_distro)/i} @distro_files ) ){ + if (!$system_base && @distro_files && + (grep {/($base_debian_version_distro)/i} @distro_files)){ $system_base = debian_id(); } if (!$system_base && $lc_issue && $lc_issue =~ /($base_manual)/){ @@ -23429,8 +23747,9 @@ sub generate_data { # $file = "$ENV{'HOME'}/bin/scripts/inxi/data/dmidecode/dmidecode-tyan-4408.txt"; # $file = "$ENV{'HOME'}/bin/scripts/inxi/data/ram/dmidecode-speed-configured-1.txt"; # $file = "$ENV{'HOME'}/bin/scripts/inxi/data/ram/dmidecode-speed-configured-2.txt"; + # $file = "$ENV{'HOME'}/bin/scripts/inxi/data/ram/00srv-dmidecode-mushkin-1.txt"; # open(my $fh, '<', $file) or die "can't open $file: $!"; - #chomp(@data = <$fh>); + # chomp(@data = <$fh>); } else { $content = qx($alerts{'dmidecode'}->{'path'} 2>/dev/null); @@ -24301,13 +24620,18 @@ sub create_output { $total = $counts{'total'}; } else { - if ($type eq 'inner'){$total = 'N/A';} - else {$total = main::row_defaults('packages','');} + if ($type eq 'inner' || $counts{'note'}){ + $total = 'N/A'; + } + else { + $total = main::row_defaults('package-data'); + } } if ($counts{'total'} && $extra > 1){ delete $counts{'total'}; my $b_mismatch; foreach (keys %counts){ + next if $_ eq 'note'; if ($counts{$_}->[0] && $counts{$_}->[0] != $total){ $b_mismatch = 1; last; @@ -24316,6 +24640,10 @@ sub create_output { $total = '' if !$b_mismatch; } $output{main::key($$num++,1,1,'Packages')} = $total; + # if blocked pm secondary, only show if admin + if ($counts{'note'} && (!$counts{'total'} || $b_admin || $total < 100)){ + $output{main::key($$num++,0,2,'note')} = $counts{'note'}; + } if ($extra > 1 && %counts){ foreach (sort keys %counts){ my ($cont,$ind) = (1,2); @@ -24371,8 +24699,10 @@ sub package_counts { '-d \'/var/lib/pkgtools/packages\''], ['pkgtool','pkgtool','d','/var/log/packages/',1,5,'\\/', '! -d \'/var/lib/pkgtools/packages\' && -d \'/var/log/packages/\''], - # way too slow without nodigest/sig!! confirms packages exist - ['rpm','rpm','p','-qa --nodigest --nosignature',1,0,''], + # rpm way too slow without nodigest/sig!! confirms packages exist + # but even with, MASSIVELY slow in some cases, > 20, 30 seconds!!!! + # find another way to get rpm package counts or don't show this feature for rpm!! + ['rpm','rpm','pkg','-qa --nodigest --nosignature',1,0,''], # scratch is a programming language too, with software called scratch ['scratch','pkgbuild','d','/var/lib/scratchpkg/index/*/.pkginfo',1,5,'\\/', '-d \'/var/lib/scratchpkg\''], @@ -24391,20 +24721,30 @@ sub package_counts { foreach (@pkg_managers){ if ($program = main::check_program($_->[1])){ next if $_->[7] && !eval $_->[7]; - if ($_->[2] eq 'p'){ + my $error; + if ($_->[2] eq 'p' || ($_->[2] eq 'pkg' && $force{'pkg'})){ chomp(@list = qx($program $_->[3] 2>/dev/null)); } - else { + elsif ($_->[2] eq 'd') { @list = main::globber($_->[3]); } - $libs = undef; - $count = scalar @list; - # print Data::Dumper::Dumper \@list; - if ($b_admin && $count && $_->[4]){ - $libs = count_libs(\@list,$_->[5],$_->[6]); + else { + @list = undef; + $error = main::row_defaults('pm-disabled'); + } + $libs = undef; + # print Data::Dumper::Dumper \@list; + if (!$error){ + $count = scalar @list; + if ($b_admin && $count && $_->[4]){ + $libs = count_libs(\@list,$_->[5],$_->[6]); + } + $counts{$_->[0]} = [$count,$libs]; + $counts{'total'} += $count; + } + else { + $counts{'note'} = $error; } - $counts{$_->[0]} = [$count,$libs]; - $counts{'total'} += $count; # print Data::Dumper::Dumper \%counts; } } @@ -24550,16 +24890,17 @@ sub set_ps_gui { @temp=qw(razor-desktop razor-session lxsession lxqt-session tdelauncher tdeinit_phase1); push(@match,@temp); - @temp=qw(3dwm 9wm afterstep aewm aewm\+\+ amiwm antiwm awesome + @temp=qw(2bwm 3dwm 9wm afterstep aewm aewm\+\+ amiwm antiwm awesome blackbox bspwm - cagebreak calmwm (sh|c?lisp).*clfswm ctwm (openbsd-)?cwm dwm evilwm + cagebreak calmwm catwm (sh|c?lisp).*clfswm ctwm (openbsd-)?cwm dwm evilwm fluxbox flwm flwm_topside fvwm.*-crystal fvwm1 fvwm2 fvwm3 fvwm95 fvwm - herbstluftwm i3 icewm instantwm ion3 jbwm jwm larswm lwm - matchbox-window-manager mini musca mwm nawm notion - openbox orbital pekwm perceptia python.*qtile qtile qvwm ratpoison - sawfish scrotwm spectrwm (sh|c?lisp).*stumpwm sway - tinywm tvtwm twm - waycooler way-cooler windowlab WindowMaker wm2 wmii2 wmii wmx + herbstluftwm i3 icewm instantwm ion3 jbwm jwm larswm leftwm lwm + matchbox-window-manager mcwm mini monsterwm musca mwm nawm notion + openbox orbital pekwm penrose perceptia python.*qtile qtile qvwm ratpoison + sawfish scrotwm snapwm spectrwm (sh|c?lisp).*stumpwm sway + tinywm tvtwm twm uwm + waycooler way-cooler windowlab WindowMaker wingo wm2 wmfs wmfs2 wmii2 wmii + wmx xfdesktop xmonad yeahwm); push(@match,@temp); } @@ -24568,7 +24909,7 @@ sub set_ps_gui { @temp=qw(budgie-wm compiz deepin-wm gala gnome-shell twin kwin_wayland kwin_x11 kwin marco deepin-metacity metacity metisse mir muffin deepin-mutter mutter - ukwm xfwm4 xfwm5); + ukwm xfwm[45]?); push(@match,@temp); # startx: /bin/sh /usr/bin/startx @temp=qw(ly .*startx xinit); # possible dm values @@ -24584,7 +24925,7 @@ sub set_ps_gui { perlpanel plank plasma-desktop plasma-netbook polybar pypanel razor-panel razorqt-panel stalonetray swaybar taskbar tint2 trayer ukui-panel vala-panel wbar wharf wingpanel witray - xfce4-panel xfce5-panel xmobar yabar); + xfce[45]?-panel xmobar yabar); push(@match,@temp); } # compositors (for wayland these are also the server, note. @@ -24595,7 +24936,8 @@ sub set_ps_gui { liri marco metisse mir moblin motorcar muffin mutter orbital papyros perceptia picom rustland sommelier sway swc ukwm unagi unity-system-compositor - wavy waycooler way-cooler wayfire wayhouse westford weston xcompmgr); + wavy waycooler way-cooler wayfire wayhouse westford weston xcompmgr + xfwm[45]?); push(@match,@temp); } uniq(\@match); @@ -25252,7 +25594,7 @@ sub set_sysctl_data { sub get_uptime { eval $start if $b_log; - my ($days,$hours,$minutes,$seconds,$uptime) = ('','','','',''); + my ($days,$hours,$minutes,$seconds,$sys_time,$uptime) = ('','','','','',''); if (check_program('uptime')){ $uptime = qx(uptime); $uptime = trimmer($uptime); @@ -25266,21 +25608,35 @@ sub get_uptime { # $uptime = '9:51 PM up 2 mins, 1 user, load average: 0:58, 0.27, 0.11'; # $uptime = '05:36:47 up 3 min, 4 users, load average: 1,88, 0,98, 0,62'; # $uptime = '9:51 PM up 49 secs, 1 user, load average: 0:58, 0.27, 0.11'; + # $uptime = '04:11am up 0:00, 1 user, load average: 0.08, 0.03, 0.01'; # openSUSE 13.1 (Bottle) + # $uptime = '11:21:43 up 1 day 5:53, 4 users, load average: 0.48, 0.62, 0.48'; # openSUSE Tumbleweed 20210515 } - if ($uptime && - $uptime =~ /[\S]+\s+up\s+(([0-9]+)\s+day[s]?,\s+)?(([0-9]{1,2}):([0-9]{1,2})|([0-9]+)\smin[s]?|([0-9]+)\ssec[s]?),\s+([0-9]+\s+user|load average)/){ - $days = $2 . 'd' if $2; - $days .= ' ' if ($days && ($4 || $6)); - if ($4 && $5){ - $hours = $4 . 'h '; - $minutes = $5 . 'm'; + if ($uptime){ + # trim off and store system time and up, and cut off user/load data + $uptime =~ s/^([0-9:])\s*([AP]M)?.+up\s+|,?\s*([0-9]+\suser|load).*$//gi; + # print "ut: $uptime\n"; + if ($1){ + $sys_time = $1; + $sys_time .= lc($2) if $2; } - elsif ($6){ - $minutes = $6 . 'm'; + if ($uptime =~ /\b([0-9]+)\s+day[s]?\b/){ + $days = ($1 + 0) . 'd'; } - elsif ($7){ - $seconds = $7 . 's'; + if ($uptime =~ /\b([0-9]{1,2}):([0-9]{1,2})\b/){ + $hours =( $1 + 0) . 'h'; + $minutes = ($2 + 0) . 'm'; } + else { + if ($uptime =~ /\b([0-9]+)\smin[s]?\b/){ + $minutes = ($1 + 0) . 'm'; + } + if ($uptime =~ /\b([0-9]+)\ssec[s]?\b/){ + $seconds = ($1 + 0) . 's'; + } + } + $days .= ' ' if $days && ($hours || $minutes || $seconds); + $hours .= ' ' if $hours && $minutes; + $minutes .= ' ' if $minutes && $seconds; $uptime = $days . $hours . $minutes . $seconds; } } diff --git a/inxi.1 b/inxi.1 index 879715e..baf9d2a 100644 --- a/inxi.1 +++ b/inxi.1 @@ -1,4 +1,21 @@ -.TH INXI 1 "2021\-04\-16" inxi "inxi manual" +.\" inxi.1 - manpage for inxi system information tool +.\" Copyright (C) 2021 Harald Hope +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 3 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License along +.\" with this program; if not, write to the Free Software Foundation, Inc., +.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +.\" +.TH INXI 1 "2021\-07\-11" "inxi" "inxi manual" .SH NAME inxi \- Command line system information script for console and IRC @@ -756,10 +773,10 @@ Adds weather line. To get weather for an alternate location, use Please note that your distribution's maintainer may chose to disable this feature. -DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! You will be blocked -from any further access. This feature is not meant for widget type weather -monitoring, or Conky type use. It is meant to get weather when you need to -see it, for example, on a remote server. +DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! Automated or excessive +use will lead to your being blocked from any further access. This feature is not +meant for widget type weather monitoring, or Conky type use. It is meant to get +weather when you need to see it, for example, on a remote server. .TP .B \-W\fR, \fB\-\-weather\-location \fR @@ -1691,7 +1708,7 @@ Shortcut, legacy. See \fB\-\-force dmidecode\fR. Force inxi to use Curl, Fetch, Perl, or Wget for downloads. .TP -.B \-\-force [dmidecode|hddtemp|lsusb|usb-sys|vmstat|wmctl]\fR +.B \-\-force [dmidecode|hddtemp|lsusb|pkg|usb-sys|vmstat|wmctl]\fR Various force options to allow users to override defaults. Values be given as a comma separated list: @@ -1705,6 +1722,17 @@ as a comma separated list: \- \fBlsusb\fR \- Forces the USB data generator to use \fBlsusb\fR as data source (default). Overrides \fBUSB_SYS\fR in user configuration file(s). +\- \fBpkg\fR \- Force override of disabled package counts. Known package +managers with non\-resolvable issues: + +rpm: Due to up to 30 seconds delays executing +.nf +\fBrpm \-qa \-\-nodigest \-\-nosignature\fR +.fi +on older hardware (and over 1 second on new hardware with some rpm versions) +package counts are disabled by default because of the unacceptable slowdowns +to execute a simple package list command. + \- \fBusb-sys\fR \- Forces the USB data generator to use \fB/sys\fR as data source instead of \fBlsusb\fR (Linux only). @@ -1837,6 +1865,10 @@ sort will be random. \fBused\fR \- KiB used of partition. +.TP +.B \-\-pkg\fR +Shortcut. See \fB\-\-force pkg\fR. + .TP .B \-\-pm\-type [package manager name]\fR For distro package maintainers only, and only for non apt, rpm, or pacman diff --git a/inxi.changelog b/inxi.changelog index 8399203..a95e264 100644 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,144 @@ +================================================================================ +Version: 3.3.05 +Patch: 00 +Date: 2021-07-11 +-------------------------------------------------------------------------------- +CHANGES: +-------------------------------------------------------------------------------- + +Many small updates, enhancements, bug fixes!!! We've been saving them up!! Here +they are!! Don't wait!! + +Thanks mr. mazda for many issue finds, and suggestions. + +-------------------------------------------------------------------------------- +KNOWN ISSUES BUT CAN'T OR WON'T BE FIXED: + +1. Due to unfixable rpm slowdowns, removed package counts for default output for +rpm based systems. We were seeing delays of up to 30+ seconds just to list the +rpm package count, which is absurd, even after the rpm optimizations inxi +already runs. To allow rpm users to get excluded by default for rpm package list +counts, added --pkg flag plus a short message telling them to use that flag to +get the installed package count if they want it. + +Changes like this are very unfortunate, but in 2021 for a package manager at +times to require over 30 seconds to generate a trivial installed package list is +just not acceptable. One of the reasons this release was delayed was this was +not an easy decision to make, it's very rare support for a feature is removed +for specific tools due to how badly the tools may perform. Note that whatever +higher level tool is used, like dnf, zypp, it's still the same speed, they all +appear to use the same core engine. + +Basically this decision was forced since either inxi looks really bad and slow, +when it's not, or the actual cause was removed from default outputs. + +-------------------------------------------------------------------------------- +BUGS: + +1. Small bug in nfs blacklist for disk used led to nfs used being added, which +leads to silly used percents. This is corrected. + +2. If ram vendor ID failed, inxi would delete the part number. Oops. This was +related to the Mushkin failures. + +3. Close to a bug, though not one internally, but to users would appear as one: +ZFS does not act as expected, zpool list did not in fact return the pool size, +which I had always assumed to be the case, but in a very strange decision, does +return something very close to the pool size for mirrors, but NOT for z1 or z2 +pools, then it returns the total size of the drives that make up the pool. To +call this strange behavior would be an understatement. The fix was to modify the +logic to use zfs list instead to get the size data. This also makes the drive +total report far more accurate, since it lists usable space now for ZFS as was +always intended. The cause of this was simply that I'd always had access to zfs +mirrors, not z1 or z2 arrays. + +-------------------------------------------------------------------------------- +FIXES: + +1. OpenSuse and maybe others use kdm3 for Trinity, not kdm, so dm was failing. + +2. Going along with fix 1, made kde version detection more robust so may catch +more fringe / corner cases for kde desktops. These were mainly added to correct +Trinity desktop version detections. + +3. Mushkin ram vendor ID was failing, that is or should be corrected. + +4. Added in /dev/disk/by-id handlers for zpool components, there are several +variants, wwn-, pci-, scsi-, ata-, but they all map to the real /dev drive IDs. +Failure to unmap these led to failing to match components and get size info +etc for zfs. + +5. See DOCUMENTATION: 2, language changes for weather feature abuse. + +-------------------------------------------------------------------------------- +ENHANCEMENTS: + +1. Going along with the rpm issues, added dnf.conf support to yum/dnf repo +types. Not sure how that one was missed, but there it is. This should tighten +repo reports for dnf/yum/zypp types. + +2. Added LeftWM. LeftWM confirmed working. Added unverifed detections for: +penrose, 2bwm, 5dwm, catwm, mcwm, monsterwm, snapwm, uwm, wingo, wmfs, wmfs2. + +3. Added xfwm as a compositor type, that had bee left out, somewhat on purpose, +since xfwm can run in compositing or non compositing mode. But should show +since many users use compositing mode now. + +4. Added OpenMediaVault distro ID and systembase handlers. + +5. Going along with zfs bug fix 3, using zfs list data for free, size, +allocated. Trying to understand how zfs developers actually thought about this +is nearly impossible so just used what seems to correspond to reality most. +Also shows raw values for zfs data in RAID along with regular ones to make +clear which is which value. + +6. Added more CPU architecture ID matches for AMD Zen and a variety of Intel. +Both vendors finally released some new CPUs and the data became available, +which doesn't always happen quickly. + +7. A bunch of new disk vendors and vendor IDs added. Never stops, like the +sands of time, like the ocean waves, like the scuttling crabs scrounding around +in the seaweed in the foam where the outgoing wave left its mark... + +-------------------------------------------------------------------------------- +DOCUMENTATION: + +1. Added leftwm keybindinigs to inxi-data.txt desktop/wm section. Updated more +wm in that section as well, and list more info on wms for future reference etc. +Also reorganized and more more readable wm section. + +2. Help/Man now make more clear that automated requests or excessive use of the +inxi weather feature are not under any circumstance permitted. There had been +some ambiguity and lack of clarity about what abuse is, now it should be more +clear. + +-------------------------------------------------------------------------------- +CODE CHANGES: + +1. Refactored uptime parser logic, the code and regex was just getting too +messy and difficult to work with and debug, now it works similar to how the +revised BSD parsers run, the regex are pulled apart and made more granular so +a small syntax change ideally won't break the detections as easily. + +2. Cleaned up sub cpu_arch() and made all the arch values line up nicely, over +time I notice that almost invariably stuff done to save lines of code makes +code harder to read as the feature expands, so it's generally worth just +unravelling it so it all stacks and is easy to scan/read. Also removed extra +white space in parens, which is something I'm leaning more towards but it's +not worth fixing all at once so it's just done where it's noticed. + +That's using: +if ( /test/ ){ +rather than: +if (/test){ + +I believe using more white space helped with Perl comprehension in the +intermediate stages, but is not required anymore and just looks like extra +whitespace now. + +-------------------------------------------------------------------------------- +-- Harald Hope - Sun, 11 Jul 2021 18:36:42 -0700 + ================================================================================ Version: 3.3.04 Patch: 00