bugfix system() and flags() Raspberry Pi
This commit is contained in:
parent
0a40b9d160
commit
b4bdc820d7
@ -100,6 +100,7 @@ Other changes
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 3.41.2 | 2018-05-13 | bugfix `system()` and `flags()` Raspberry Pi |
|
||||||
| 3.41.1 | 2018-05-11 | updated docs |
|
| 3.41.1 | 2018-05-11 | updated docs |
|
||||||
| 3.41.0 | 2018-05-11 | `system()` Raspberry Pi bugfix and extended detection, added partial `SunOS` support |
|
| 3.41.0 | 2018-05-11 | `system()` Raspberry Pi bugfix and extended detection, added partial `SunOS` support |
|
||||||
| 3.40.1 | 2018-05-10 | bugfix `system().sku` (windows) |
|
| 3.40.1 | 2018-05-10 | bugfix `system().sku` (windows) |
|
||||||
|
|||||||
@ -226,7 +226,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (
|
|||||||
| | release | X | X | X | X | X | |
|
| | release | X | X | X | X | X | |
|
||||||
| | codename | | | X | | | |
|
| | codename | | | X | | | |
|
||||||
| | kernel | X | X | X | X | X | kernel release - same as os.release() |
|
| | kernel | X | X | X | X | X | kernel release - same as os.release() |
|
||||||
| | arch | X | X | X | X | | X | same as os.arch() |
|
| | arch | X | X | X | X | X | same as os.arch() |
|
||||||
| | hostname | X | X | X | X | X | same as os.hostname() |
|
| | hostname | X | X | X | X | X | same as os.hostname() |
|
||||||
| | logofile | X | X | X | X | X | e.g. 'apple', 'debian', 'fedora', ... |
|
| | logofile | X | X | X | X | X | e.g. 'apple', 'debian', 'fedora', ... |
|
||||||
| si.versions(cb) | {...} | X | X | X | X | X | version information (kernel, ssl, node, ...) |
|
| si.versions(cb) | {...} | X | X | X | X | X | version information (kernel, ssl, node, ...) |
|
||||||
|
|||||||
30
lib/cpu.js
30
lib/cpu.js
@ -613,8 +613,19 @@ function cpuFlags(callback) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (callback) { callback(result); }
|
if (!result) {
|
||||||
resolve(result);
|
exec('cat /proc/cpuinfo', function (error, stdout) {
|
||||||
|
if (!error) {
|
||||||
|
let lines = stdout.toString().split('\n');
|
||||||
|
result = util.getValue(lines, 'features', ':', true).toLowerCase();
|
||||||
|
}
|
||||||
|
if (callback) { callback(result); }
|
||||||
|
resolve(result);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (callback) { callback(result); }
|
||||||
|
resolve(result);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_freebsd || _openbsd) {
|
if (_freebsd || _openbsd) {
|
||||||
@ -631,19 +642,8 @@ function cpuFlags(callback) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
result = flags.join(' ').trim();
|
result = flags.join(' ').trim();
|
||||||
if (!result) {
|
if (callback) { callback(result); }
|
||||||
exec('cat /proc/cpuinfo', function (error, stdout) {
|
resolve(result);
|
||||||
if (!error) {
|
|
||||||
let lines = stdout.toString().split('\n');
|
|
||||||
result = util.getValue(lines, 'features', ':', true).toLowerCase();
|
|
||||||
}
|
|
||||||
if (callback) { callback(result); }
|
|
||||||
resolve(result);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (callback) { callback(result); }
|
|
||||||
resolve(result);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
|
|||||||
@ -63,7 +63,7 @@ function system(callback) {
|
|||||||
if (fs.existsSync('/.dockerenv') || fs.existsSync('/.dockerinit')) {
|
if (fs.existsSync('/.dockerenv') || fs.existsSync('/.dockerinit')) {
|
||||||
result.model = 'Docker Container';
|
result.model = 'Docker Container';
|
||||||
}
|
}
|
||||||
if (result.manufacturer === '' && result.model === 'Computer' && result.version === '-') { // still default values
|
if (result.manufacturer === '' && result.model === 'Computer' && result.version === '') { // still default values
|
||||||
exec('dmesg | grep -i virtual | grep -iE "vmware|qemu|kvm|xen"', function (error, stdout) {
|
exec('dmesg | grep -i virtual | grep -iE "vmware|qemu|kvm|xen"', function (error, stdout) {
|
||||||
// detect virtual machines
|
// detect virtual machines
|
||||||
if (!error) {
|
if (!error) {
|
||||||
@ -162,6 +162,9 @@ function system(callback) {
|
|||||||
resolve(result);
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
if (callback) { callback(result); }
|
||||||
|
resolve(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user