systeminformation 5.21.12 → 5.21.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/audio.js CHANGED
@@ -59,7 +59,7 @@ function getLinuxAudioPci() {
59
59
  let cmd = 'lspci -v 2>/dev/null';
60
60
  let result = [];
61
61
  try {
62
- const parts = execSync(cmd).toString().split('\n\n');
62
+ const parts = execSync(cmd, { encoding: 'utf8' }).toString().split('\n\n');
63
63
  parts.forEach(element => {
64
64
  const lines = element.split('\n');
65
65
  if (lines && lines.length && lines[0].toLowerCase().indexOf('audio') >= 0) {
package/lib/bluetooth.js CHANGED
@@ -129,7 +129,7 @@ function bluetoothDevices(callback) {
129
129
  });
130
130
  // determine "connected" with hcitool con
131
131
  try {
132
- const hdicon = execSync('hcitool con').toString().toLowerCase();
132
+ const hdicon = execSync('hcitool con', { encoding: 'utf8' }).toString().toLowerCase();
133
133
  for (let i = 0; i < result.length; i++) {
134
134
  if (result[i].macDevice && result[i].macDevice.length > 10 && hdicon.indexOf(result[i].macDevice.toLowerCase()) >= 0) {
135
135
  result[i].connected = true;
package/lib/cpu.js CHANGED
@@ -456,6 +456,20 @@ const AMDBaseFrequencies = {
456
456
  '5800X': '3.8',
457
457
  '5900X': '3.7',
458
458
  '5950X': '3.4',
459
+ '5945WX': '4.1',
460
+ '5955WX': '4.0',
461
+ '5965WX': '3.8',
462
+ '5975WX': '3.6',
463
+ '5995WX': '2.7',
464
+
465
+ '7960X': '4.2',
466
+ '7970X': '4.0',
467
+ '7980X': '3.2',
468
+
469
+ '7965WX': '4.2',
470
+ '7975WX': '4.0',
471
+ '7985WX': '3.2',
472
+ '7995WX': '2.5',
459
473
 
460
474
  // ZEN4
461
475
  '9754': '2.25',
@@ -688,7 +702,7 @@ function getCpu() {
688
702
  if (os.arch() === 'arm64') {
689
703
  result.socket = 'SOC';
690
704
  try {
691
- const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\n');
705
+ const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type', { encoding: 'utf8' }).toString().split('\n');
692
706
  const efficiencyCores = clusters.filter(line => line.indexOf('"E"') >= 0).length;
693
707
  const performanceCores = clusters.filter(line => line.indexOf('"P"') >= 0).length;
694
708
  result.efficiencyCores = efficiencyCores;
@@ -1034,7 +1048,7 @@ function cpuTemperature(callback) {
1034
1048
  // CPU Chipset, Socket
1035
1049
  try {
1036
1050
  const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;';
1037
- const parts = execSync(cmd).toString().split('-----\n');
1051
+ const parts = execSync(cmd, { encoding: 'utf8' }).toString().split('-----\n');
1038
1052
  if (parts.length === 2) {
1039
1053
  const lines = parts[0].split('\n');
1040
1054
  const lines2 = parts[1].split('\n');
@@ -1590,7 +1604,7 @@ function getLoad() {
1590
1604
  // linux: try to get other cpu stats
1591
1605
  if (_linux) {
1592
1606
  try {
1593
- const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu').split('\n');
1607
+ const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu', { encoding: 'utf8' }).split('\n');
1594
1608
  if (lines.length > 1) {
1595
1609
  lines.shift();
1596
1610
  if (lines.length === cpus.length) {
package/lib/filesystem.js CHANGED
@@ -139,7 +139,7 @@ function fsSize(drive, callback) {
139
139
  if (_linux) {
140
140
  try {
141
141
  cmd = 'export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL';
142
- execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
142
+ execSync('cat /proc/mounts 2>/dev/null', { encoding: 'utf8' }).toString().split('\n').filter(line => {
143
143
  return line.startsWith('/');
144
144
  }).forEach((line) => {
145
145
  osMounts[line.split(' ')[0]] = osMounts[line.split(' ')[0]] || false;
@@ -426,7 +426,7 @@ function raidMatchLinux(data) {
426
426
  try {
427
427
  data.forEach(element => {
428
428
  if (element.type.startsWith('raid')) {
429
- const lines = execSync(`mdadm --export --detail /dev/${element.name}`).toString().split('\n');
429
+ const lines = execSync(`mdadm --export --detail /dev/${element.name}`, { encoding: 'utf8' }).toString().split('\n');
430
430
  const mdData = decodeMdabmData(lines);
431
431
 
432
432
  element.label = mdData.label; // <- assign label info
@@ -1087,7 +1087,7 @@ function diskLayout(callback) {
1087
1087
  } catch (e) {
1088
1088
  // fallback to older version of lsblk
1089
1089
  try {
1090
- const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL').toString();
1090
+ const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL', { encoding: 'utf8' }).toString();
1091
1091
  let lines = blkStdoutToObject(out2).split('\n');
1092
1092
  const data = parseBlk(lines);
1093
1093
  devices = data.filter(item => { return (item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mount === '' && item.label === '' && item.fsType === '')); });
@@ -1100,7 +1100,7 @@ function diskLayout(callback) {
1100
1100
  const BSDName = '/dev/' + device.name;
1101
1101
  const logical = device.name;
1102
1102
  try {
1103
- mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null').toString().split('\n')[0];
1103
+ mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null', { encoding: 'utf8' }).toString().split('\n')[0];
1104
1104
  } catch (e) {
1105
1105
  util.noop();
1106
1106
  }
package/lib/graphics.js CHANGED
@@ -216,7 +216,7 @@ function graphics(callback) {
216
216
  // PCI bus IDs
217
217
  let pciIDs = [];
218
218
  try {
219
- pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "').toString().split('\n');
219
+ pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "', { encoding: 'utf8' }).toString().split('\n');
220
220
  for (let i = 0; i < pciIDs.length; i++) {
221
221
  pciIDs[i] = pciIDs[i].replace('Bus Address:', '').replace('0000:', '').trim();
222
222
  }
@@ -759,7 +759,7 @@ function graphics(callback) {
759
759
  if (lines.length > 1 && stdout.toString().indexOf('gpu=') >= -1) {
760
760
  result.controllers.push({
761
761
  vendor: 'Broadcom',
762
- model: 'VideoCore IV',
762
+ model: util.getRpiGpu(),
763
763
  bus: '',
764
764
  vram: util.getValue(lines, 'gpu', '=').replace('M', ''),
765
765
  vramDynamic: true
package/lib/memory.js CHANGED
@@ -399,7 +399,7 @@ function memLayout(callback) {
399
399
 
400
400
  // Try Raspberry PI
401
401
  try {
402
- let stdout = execSync('cat /proc/cpuinfo 2>/dev/null');
402
+ let stdout = execSync('cat /proc/cpuinfo 2>/dev/null', { encoding: 'utf8' });
403
403
  let lines = stdout.toString().split('\n');
404
404
  let model = util.getValue(lines, 'hardware', ':', true).toUpperCase();
405
405
  let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
@@ -419,14 +419,14 @@ function memLayout(callback) {
419
419
  result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;
420
420
  result[0].formFactor = 'SoC';
421
421
 
422
- stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null');
422
+ stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null', { encoding: 'utf8' });
423
423
  lines = stdout.toString().split('\n');
424
424
  let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;
425
425
  if (freq) {
426
426
  result[0].clockSpeed = freq;
427
427
  }
428
428
 
429
- stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null');
429
+ stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null', { encoding: 'utf8' });
430
430
  lines = stdout.toString().split('\n');
431
431
  let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0;
432
432
  if (voltage) {
package/lib/network.js CHANGED
@@ -91,7 +91,7 @@ function getDefaultNetworkInterface() {
91
91
  }
92
92
  if (_linux) {
93
93
  let cmd = 'ip route 2> /dev/null | grep default';
94
- let result = execSync(cmd);
94
+ let result = execSync(cmd, { encoding: 'utf8' });
95
95
  let parts = result.toString().split('\n')[0].split(/\s+/);
96
96
  if (parts[0] === 'none' && parts[5]) {
97
97
  ifacename = parts[5];
@@ -108,7 +108,7 @@ function getDefaultNetworkInterface() {
108
108
  if (_linux) { cmd = 'ip route 2> /dev/null | grep default | awk \'{print $5}\''; }
109
109
  if (_darwin) { cmd = 'route -n get default 2>/dev/null | grep interface: | awk \'{print $2}\''; }
110
110
  if (_freebsd || _openbsd || _netbsd || _sunos) { cmd = 'route get 0.0.0.0 | grep interface:'; }
111
- let result = execSync(cmd);
111
+ let result = execSync(cmd, { encoding: 'utf8' });
112
112
  ifacename = result.toString().split('\n')[0];
113
113
  if (ifacename.indexOf(':') > -1) {
114
114
  ifacename = ifacename.split(':')[1].trim();
@@ -130,7 +130,7 @@ function getMacAddresses() {
130
130
  if (_linux || _freebsd || _openbsd || _netbsd) {
131
131
  if (typeof pathToIp === 'undefined') {
132
132
  try {
133
- const lines = execSync('which ip').toString().split('\n');
133
+ const lines = execSync('which ip', { encoding: 'utf8' }).toString().split('\n');
134
134
  if (lines.length && lines[0].indexOf(':') === -1 && lines[0].indexOf('/') === 0) {
135
135
  pathToIp = lines[0];
136
136
  } else {
@@ -142,7 +142,7 @@ function getMacAddresses() {
142
142
  }
143
143
  try {
144
144
  const cmd = 'export LC_ALL=C; ' + ((pathToIp) ? pathToIp + ' link show up' : '/sbin/ifconfig') + '; unset LC_ALL';
145
- let res = execSync(cmd);
145
+ let res = execSync(cmd, { encoding: 'utf8' });
146
146
  const lines = res.toString().split('\n');
147
147
  for (let i = 0; i < lines.length; i++) {
148
148
  if (lines[i] && lines[i][0] !== ' ') {
@@ -172,7 +172,7 @@ function getMacAddresses() {
172
172
  if (_darwin) {
173
173
  try {
174
174
  const cmd = '/sbin/ifconfig';
175
- let res = execSync(cmd);
175
+ let res = execSync(cmd, { encoding: 'utf8' });
176
176
  const lines = res.toString().split('\n');
177
177
  for (let i = 0; i < lines.length; i++) {
178
178
  if (lines[i] && lines[i][0] !== '\t' && lines[i].indexOf(':') > 0) {
@@ -511,7 +511,7 @@ function getLinuxIfaceConnectionName(interfaceName) {
511
511
  const cmd = `nmcli device status 2>/dev/null | grep ${interfaceName}`;
512
512
 
513
513
  try {
514
- const result = execSync(cmd).toString();
514
+ const result = execSync(cmd, { encoding: 'utf8' }).toString();
515
515
  const resultFormat = result.replace(/\s+/g, ' ').trim();
516
516
  const connectionNameLines = resultFormat.split(' ').slice(3);
517
517
  const connectionName = connectionNameLines.join(' ');
@@ -525,7 +525,7 @@ function checkLinuxDCHPInterfaces(file) {
525
525
  let result = [];
526
526
  try {
527
527
  let cmd = `cat ${file} 2> /dev/null | grep 'iface\\|source'`;
528
- const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
528
+ const lines = execSync(cmd, { maxBuffer: 1024 * 20000, encoding: 'utf8' }).toString().split('\n');
529
529
 
530
530
  lines.forEach(line => {
531
531
  const parts = line.replace(/\s+/g, ' ').trim().split(' ');
@@ -550,7 +550,7 @@ function getLinuxDHCPNics() {
550
550
  let cmd = 'ip a 2> /dev/null';
551
551
  let result = [];
552
552
  try {
553
- const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
553
+ const lines = execSync(cmd, { maxBuffer: 1024 * 20000, encoding: 'utf8' }).toString().split('\n');
554
554
  const nsections = splitSectionsNics(lines);
555
555
  result = (parseLinuxDHCPNics(nsections));
556
556
  } catch (e) {
@@ -591,7 +591,7 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
591
591
  if (connectionName) {
592
592
  const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.method;`;
593
593
  try {
594
- const lines = execSync(cmd).toString();
594
+ const lines = execSync(cmd, { encoding: 'utf8' }).toString();
595
595
  const resultFormat = lines.replace(/\s+/g, ' ').trim();
596
596
 
597
597
  let dhcStatus = resultFormat.split(' ').slice(1).toString();
@@ -631,7 +631,7 @@ function getLinuxIfaceDNSsuffix(connectionName) {
631
631
  if (connectionName) {
632
632
  const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.dns-search;`;
633
633
  try {
634
- const result = execSync(cmd).toString();
634
+ const result = execSync(cmd, { encoding: 'utf8' }).toString();
635
635
  const resultFormat = result.replace(/\s+/g, ' ').trim();
636
636
  const dnsSuffix = resultFormat.split(' ').slice(1).toString();
637
637
  return dnsSuffix == '--' ? 'Not defined' : dnsSuffix;
@@ -647,7 +647,7 @@ function getLinuxIfaceIEEE8021xAuth(connectionName) {
647
647
  if (connectionName) {
648
648
  const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep 802-1x.eap;`;
649
649
  try {
650
- const result = execSync(cmd).toString();
650
+ const result = execSync(cmd, { encoding: 'utf8' }).toString();
651
651
  const resultFormat = result.replace(/\s+/g, ' ').trim();
652
652
  const authenticationProtocol = resultFormat.split(' ').slice(1).toString();
653
653
 
@@ -875,7 +875,7 @@ function networkInterfaces(callback, rescan, defaultString) {
875
875
 
876
876
  let lines = [];
877
877
  try {
878
- lines = execSync(cmd).toString().split('\n');
878
+ lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
879
879
  const connectionName = getLinuxIfaceConnectionName(ifaceSanitized);
880
880
  dhcp = getLinuxIfaceDHCPstatus(ifaceSanitized, connectionName, _dhcpNics);
881
881
  dnsSuffix = getLinuxIfaceDNSsuffix(connectionName);
package/lib/osinfo.js CHANGED
@@ -168,13 +168,13 @@ function getFQDN() {
168
168
  let fqdn = os.hostname;
169
169
  if (_linux || _darwin) {
170
170
  try {
171
- const stdout = execSync('hostnamectl --json short 2>/dev/null');
171
+ const stdout = execSync('hostnamectl --json short 2>/dev/null', { encoding: 'utf8' });
172
172
  const json = JSON.parse(stdout.toString());
173
173
 
174
174
  fqdn = json['StaticHostname'];
175
175
  } catch (e) {
176
176
  try {
177
- const stdout = execSync('hostname -f 2>/dev/null');
177
+ const stdout = execSync('hostname -f 2>/dev/null', { encoding: 'utf8' });
178
178
  fqdn = stdout.toString().split(os.EOL)[0];
179
179
  } catch (e) {
180
180
  util.noop();
package/lib/processes.js CHANGED
@@ -152,7 +152,7 @@ function services(srv, callback) {
152
152
  if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
153
153
  if ((_linux || _freebsd || _openbsd || _netbsd) && srvString === '*') {
154
154
  try {
155
- const tmpsrv = execSync('systemctl --all --type=service --no-legend 2> /dev/null').toString().split('\n');
155
+ const tmpsrv = execSync('systemctl --all --type=service --no-legend 2> /dev/null', { encoding: 'utf8' }).toString().split('\n');
156
156
  srvs = [];
157
157
  for (const s of tmpsrv) {
158
158
  const name = s.split('.service')[0];
@@ -164,7 +164,7 @@ function services(srv, callback) {
164
164
  } catch (d) {
165
165
  try {
166
166
  srvString = '';
167
- const tmpsrv = execSync('service --status-all 2> /dev/null').toString().split('\n');
167
+ const tmpsrv = execSync('service --status-all 2> /dev/null', { encoding: 'utf8' }).toString().split('\n');
168
168
  for (const s of tmpsrv) {
169
169
  const parts = s.split(']');
170
170
  if (parts.length === 2) {
@@ -174,7 +174,7 @@ function services(srv, callback) {
174
174
  srvs = srvString.split('|');
175
175
  } catch (e) {
176
176
  try {
177
- const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null').toString().split('\n').join('');
177
+ const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null', { encoding: 'utf8' }).toString().split('\n').join('');
178
178
  srvString = '';
179
179
  if (srvStr) {
180
180
  const tmpsrv = srvStr.split(',');
package/lib/system.js CHANGED
@@ -61,7 +61,7 @@ function system(callback) {
61
61
  echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;
62
62
  echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;
63
63
  try {
64
- lines = execSync(cmd).toString().split('\n');
64
+ lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
65
65
  result.manufacturer = result.manufacturer === '' ? util.getValue(lines, 'sys_vendor') : result.manufacturer;
66
66
  result.model = result.model === '' ? util.getValue(lines, 'product_name') : result.model;
67
67
  result.version = result.version === '' ? util.getValue(lines, 'product_version') : result.version;
@@ -107,7 +107,7 @@ function system(callback) {
107
107
  }
108
108
  if (!result.virtual) {
109
109
  try {
110
- const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null').toString();
110
+ const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null', { encoding: 'utf8' }).toString();
111
111
  if (disksById.indexOf('_QEMU_') >= 0) {
112
112
  result.virtual = true;
113
113
  result.virtualHost = 'QEMU';
@@ -129,7 +129,7 @@ function system(callback) {
129
129
  }
130
130
  if ((_freebsd || _openbsd || _netbsd) && !result.virtualHost) {
131
131
  try {
132
- const procInfo = execSync('dmidecode -t 4');
132
+ const procInfo = execSync('dmidecode -t 4', { encoding: 'utf8' });
133
133
  const procLines = procInfo.toString().split('\n');
134
134
  const procManufacturer = util.getValue(procLines, 'manufacturer', ':', true);
135
135
  switch (procManufacturer.toLowerCase()) {
@@ -155,7 +155,7 @@ function system(callback) {
155
155
  result.model = 'Docker Container';
156
156
  }
157
157
  try {
158
- const stdout = execSync('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');
158
+ const stdout = execSync('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"', { encoding: 'utf8' });
159
159
  // detect virtual machines
160
160
  let lines = stdout.toString().split('\n');
161
161
  if (lines.length > 0) {
@@ -369,7 +369,7 @@ function bios(callback) {
369
369
  echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;
370
370
  echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;
371
371
  try {
372
- lines = execSync(cmd).toString().split('\n');
372
+ lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
373
373
  result.vendor = !result.vendor ? util.getValue(lines, 'bios_vendor') : result.vendor;
374
374
  result.version = !result.version ? util.getValue(lines, 'bios_version') : result.version;
375
375
  datetime = util.getValue(lines, 'bios_date');
@@ -483,7 +483,7 @@ function baseboard(callback) {
483
483
  echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;
484
484
  echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;
485
485
  try {
486
- lines = execSync(cmd).toString().split('\n');
486
+ lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
487
487
  result.manufacturer = !result.manufacturer ? util.getValue(lines, 'board_vendor') : result.manufacturer;
488
488
  result.model = !result.model ? util.getValue(lines, 'board_name') : result.model;
489
489
  result.version = !result.version ? util.getValue(lines, 'board_version') : result.version;
package/lib/util.js CHANGED
@@ -33,6 +33,7 @@ let _cores = 0;
33
33
  let wmicPath = '';
34
34
  let codepage = '';
35
35
  let _smartMonToolsInstalled = null;
36
+ let _rpi_cpuinfo = null;
36
37
 
37
38
  const WINDIR = process.env.WINDIR || 'C:\\Windows';
38
39
 
@@ -602,17 +603,25 @@ function isRaspberry() {
602
603
  'BCM2709',
603
604
  'BCM2710',
604
605
  'BCM2711',
606
+ 'BCM2712',
605
607
  'BCM2835',
606
608
  'BCM2836',
607
609
  'BCM2837',
608
610
  'BCM2837B0'
609
611
  ];
610
612
  let cpuinfo = [];
611
- try {
612
- cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\n');
613
- } catch (e) {
614
- return false;
613
+
614
+ if (_rpi_cpuinfo !== null) {
615
+ cpuinfo = _rpi_cpuinfo;
616
+ } else {
617
+ try {
618
+ cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\n');
619
+ _rpi_cpuinfo = cpuinfo;
620
+ } catch (e) {
621
+ return false;
622
+ }
615
623
  }
624
+
616
625
  const hardware = getValue(cpuinfo, 'hardware');
617
626
  return (hardware && PI_MODEL_NO.indexOf(hardware) > -1);
618
627
  }
@@ -819,6 +828,10 @@ function getFilesInPath(source) {
819
828
 
820
829
  function decodePiCpuinfo(lines) {
821
830
 
831
+ if (_rpi_cpuinfo === null) {
832
+ _rpi_cpuinfo = lines;
833
+ }
834
+
822
835
  // https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
823
836
 
824
837
  const oldRevisionCodes = {
@@ -948,6 +961,7 @@ function decodePiCpuinfo(lines) {
948
961
  'BCM2836',
949
962
  'BCM2837',
950
963
  'BCM2711',
964
+ 'BCM2712',
951
965
  ];
952
966
  const manufacturerList = [
953
967
  'Sony UK',
@@ -977,7 +991,8 @@ function decodePiCpuinfo(lines) {
977
991
  '12': 'Zero 2 W',
978
992
  '13': '400',
979
993
  '14': 'CM4',
980
- '15': 'CM4S'
994
+ '15': 'CM4S',
995
+ '17': '5B',
981
996
  };
982
997
 
983
998
  const revisionCode = getValue(lines, 'revision', ':', true);
@@ -1021,6 +1036,25 @@ function decodePiCpuinfo(lines) {
1021
1036
  return result;
1022
1037
  }
1023
1038
 
1039
+ function getRpiGpu() {
1040
+ let cpuinfo = null;
1041
+ if (_rpi_cpuinfo !== null) {
1042
+ cpuinfo = _rpi_cpuinfo;
1043
+ } else {
1044
+ try {
1045
+ cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }).toString().split('\n');
1046
+ _rpi_cpuinfo = cpuinfo;
1047
+ } catch (e) {
1048
+ return false;
1049
+ }
1050
+ }
1051
+
1052
+ const rpi = decodePiCpuinfo(cpuinfo);
1053
+ if (rpi.type === '4B' || rpi.type === 'CM4' || rpi.type === 'CM4S' || rpi.type === '400') { return 'VideoCore VI'; }
1054
+ if (rpi.type === '5B') { return 'VideoCore VII'; }
1055
+ return 'VideoCore IV';
1056
+ }
1057
+
1024
1058
  function promiseAll(promises) {
1025
1059
  const resolvingPromises = promises.map(function (promise) {
1026
1060
  return new Promise(function (resolve) {
@@ -1291,6 +1325,7 @@ exports.isRaspbian = isRaspbian;
1291
1325
  exports.sanitizeShellString = sanitizeShellString;
1292
1326
  exports.isPrototypePolluted = isPrototypePolluted;
1293
1327
  exports.decodePiCpuinfo = decodePiCpuinfo;
1328
+ exports.getRpiGpu = getRpiGpu;
1294
1329
  exports.promiseAll = promiseAll;
1295
1330
  exports.promisify = promisify;
1296
1331
  exports.promisifySave = promisifySave;
package/lib/wifi.js CHANGED
@@ -127,7 +127,7 @@ function ifaceListLinux() {
127
127
  const result = [];
128
128
  const cmd = 'iw dev 2>/dev/null';
129
129
  try {
130
- const all = execSync(cmd).toString().split('\n').map(line => line.trim()).join('\n');
130
+ const all = execSync(cmd, { encoding: 'utf8' }).toString().split('\n').map(line => line.trim()).join('\n');
131
131
  const parts = all.split('\nInterface ');
132
132
  parts.shift();
133
133
  parts.forEach(ifaceDetails => {
@@ -146,7 +146,7 @@ function ifaceListLinux() {
146
146
  return result;
147
147
  } catch (e) {
148
148
  try {
149
- const all = execSync('nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null').toString();
149
+ const all = execSync('nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null', { encoding: 'utf8' }).toString();
150
150
  const parts = all.split('\nGENERAL.DEVICE:');
151
151
  let i = 1;
152
152
  parts.forEach(ifaceDetails => {
@@ -175,7 +175,7 @@ function ifaceListLinux() {
175
175
  function nmiDeviceLinux(iface) {
176
176
  const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2>/dev/null`;
177
177
  try {
178
- const lines = execSync(cmd).toString().split('\n');
178
+ const lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
179
179
  const ssid = util.getValue(lines, 'GENERAL.CONNECTION');
180
180
  return {
181
181
  iface,
@@ -193,7 +193,7 @@ function nmiDeviceLinux(iface) {
193
193
  function nmiConnectionLinux(ssid) {
194
194
  const cmd = `nmcli -t --show-secrets connection show ${ssid} 2>/dev/null`;
195
195
  try {
196
- const lines = execSync(cmd).toString().split('\n');
196
+ const lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
197
197
  const bssid = util.getValue(lines, '802-11-wireless.seen-bssids').toLowerCase();
198
198
  return {
199
199
  ssid: ssid !== '--' ? ssid : null,
@@ -211,7 +211,7 @@ function nmiConnectionLinux(ssid) {
211
211
  function wpaConnectionLinux(iface) {
212
212
  const cmd = `wpa_cli -i ${iface} status 2>&1`;
213
213
  try {
214
- const lines = execSync(cmd).toString().split('\n');
214
+ const lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
215
215
  const freq = util.toInt(util.getValue(lines, 'freq', '='));
216
216
  return {
217
217
  ssid: util.getValue(lines, 'ssid', '='),
@@ -230,7 +230,7 @@ function getWifiNetworkListNmi() {
230
230
  const result = [];
231
231
  const cmd = 'nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null';
232
232
  try {
233
- const stdout = execSync(cmd, { maxBuffer: 1024 * 20000 });
233
+ const stdout = execSync(cmd, { maxBuffer: 1024 * 20000, encoding: 'utf8' });
234
234
  const parts = stdout.toString().split('ACTIVE:');
235
235
  parts.shift();
236
236
  parts.forEach(part => {
@@ -263,7 +263,7 @@ function getWifiNetworkListNmi() {
263
263
  function getWifiNetworkListIw(iface) {
264
264
  const result = [];
265
265
  try {
266
- let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`).toString().split(' Cell ');
266
+ let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`, { encoding: 'utf8' }).toString().split(' Cell ');
267
267
  if (iwlistParts[0].indexOf('resource busy') >= 0) { return -1; }
268
268
  if (iwlistParts.length > 1) {
269
269
  iwlistParts.shift();
@@ -397,7 +397,7 @@ function wifiNetworks(callback) {
397
397
  result = getWifiNetworkListNmi();
398
398
  if (result.length === 0) {
399
399
  try {
400
- const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL').toString().split('\n\n');
400
+ const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL', { encoding: 'utf8' }).toString().split('\n\n');
401
401
  let iface = '';
402
402
  iwconfigParts.forEach(element => {
403
403
  if (element.indexOf('no wireless') === -1 && element.trim() !== '') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.21.12",
3
+ "version": "5.21.14",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",