osInfo() improved parsing (FreeBSD)

This commit is contained in:
Sebastian Hildebrandt 2022-11-20 09:34:51 +01:00
parent 00d67ceee6
commit 1af7ee408b
4 changed files with 21 additions and 11 deletions

View File

@ -42,6 +42,7 @@ We had to make **several interface changes** to keep systeminformation as consis
- `baseboard()`: added memMax, memSlots - `baseboard()`: added memMax, memSlots
- `bios()`: added language and features (linux) - `bios()`: added language and features (linux)
- `blockDevices()` added raid group member (linux)
- `cpu()`: extended AMD processor list - `cpu()`: extended AMD processor list
- `cpu()`: extended socket list (win) - `cpu()`: extended socket list (win)
- `cpu()`: added virtualization if cpu supports virtualization - `cpu()`: added virtualization if cpu supports virtualization
@ -81,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- | | ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.14.2 | 2022-11-20 | `osInfo()` improved parsing (FreeBSD) |
| 5.14.1 | 2022-11-20 | `memLayout()` bank descriptor cleanup (linux) | | 5.14.1 | 2022-11-20 | `memLayout()` bank descriptor cleanup (linux) |
| 5.14.0 | 2022-11-19 | `blockDevices()` added raid group member (linux) | | 5.14.0 | 2022-11-19 | `blockDevices()` added raid group member (linux) |
| 5.13.5 | 2022-11-18 | `users()` fix parsing issue (windows) | | 5.13.5 | 2022-11-18 | `users()` fix parsing issue (windows) |

View File

@ -57,6 +57,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">5.14.2</th>
<td>2022-11-20</td>
<td><span class="code">osInfo()</span> improved parsing (FreeBSD)</td>
</tr>
<tr> <tr>
<th scope="row">5.14.1</th> <th scope="row">5.14.1</th>
<td>2022-11-20</td> <td>2022-11-20</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo"> <img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.14.1</span></div> <div class="version">New Version: <span id="version">5.14.2</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button> <button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div> </div>
<div class="down"> <div class="down">

View File

@ -263,16 +263,19 @@ function osInfo(callback) {
if (_freebsd || _openbsd || _netbsd) { if (_freebsd || _openbsd || _netbsd) {
exec('sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod', function (error, stdout) { exec('sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod', function (error, stdout) {
if (!error) { let lines = stdout.toString().split('\n');
let lines = stdout.toString().split('\n'); const distro = util.getValue(lines, 'kern.ostype');
result.distro = util.getValue(lines, 'kern.ostype'); const logofile = util.getValue(lines, 'kern.ostype');
result.logofile = getLogoFile(result.distro); const release = util.getValue(lines, 'kern.osrelease').split('-')[0];
result.release = util.getValue(lines, 'kern.osrelease').split('-')[0]; const serial = util.getValue(lines, 'kern.uuid');
result.serial = util.getValue(lines, 'kern.uuid'); const uefi = util.getValue(lines, 'machdep.bootmethod').toLowerCase().indexOf('uefi') >= 0;
result.codename = ''; result.distro = distro || result.distro;
result.codepage = util.getCodepage(); result.logofile = logofile || result.logofile;
result.uefi = util.getValue(lines, 'machdep.bootmethod').toLowerCase().indexOf('uefi') >= 0; result.release = release || result.release;
} result.serial = serial || result.serial;
result.codename = '';
result.codepage = util.getCodepage();
result.uefi = uefi || result.uefi;
if (callback) { if (callback) {
callback(result); callback(result);
} }