From 4a2b221d9e39f6a77ee7481abd2077c8c4ef7661 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Wed, 27 Jan 2021 11:43:30 +0100 Subject: [PATCH] cpu() fix virtualization, wifi() fix raspberry --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 2 +- lib/cpu.js | 8 ++++++++ lib/wifi.js | 2 +- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7cc43b..0db3dc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 5.0.3 | 2020-01-27 | `cpu()` fix virtualization, `wifi()` fix raspberry | | 5.0.2 | 2020-01-26 | updated typescript typings | | 5.0.1 | 2020-01-26 | code cleanup | | 5.0.0 | 2020-01-26 | new major version 5 release | diff --git a/docs/history.html b/docs/history.html index fe62f44..9a46b13 100644 --- a/docs/history.html +++ b/docs/history.html @@ -56,6 +56,11 @@ + + 5.0.3 + 2020-01-27 + cpu() fix virtualization, wifi() fix raspberry + 5.0.2 2020-01-26 diff --git a/docs/index.html b/docs/index.html index 8fe9cc1..158dedf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.0.2
+
New Version: 5.0.3
diff --git a/lib/cpu.js b/lib/cpu.js index 4b3014f..0a7f1b7 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -550,6 +550,14 @@ function getCpu() { cpuFlags().then(flags => { result.flags = flags; result.virtualization = flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1; + if (_windows) { + try { + const systeminfo = execSync('systeminfo').toString(); + result.virtualization = result.virtualization || (systeminfo.indexOf('Virtualization Enabled In Firmware: Yes') !== -1) || (systeminfo.indexOf('Virtualisierung in Firmware aktiviert: Ja') !== -1) || (systeminfo.indexOf('Virtualisation activée dans le microprogramme : Qiu') !== -1); + } catch (e) { + util.noop(); + } + } if (_darwin) { exec('sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily', function (error, stdout) { let lines = stdout.toString().split('\n'); diff --git a/lib/wifi.js b/lib/wifi.js index d501c70..b76d3ad 100644 --- a/lib/wifi.js +++ b/lib/wifi.js @@ -147,7 +147,7 @@ function getWifiNetworkAlt(iface) { } const parts = l.split(':'); if (parts.length > 1) { - wpaFlag = parts[1].trim(); + wpaFlag = parts[1].trim().toUpperCase(); } } if (l.indexOf('pairwise cipher') >= 0) {