Skip to content

Commit

Permalink
add bios mode
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Smith <[email protected]>
  • Loading branch information
si458 committed Oct 8, 2023
1 parent 78ef26e commit 1a34cba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions agents/meshcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1829,11 +1829,22 @@ function getSystemInformation(func) {
var values = require('win-wmi').query('ROOT\\CIMV2', "SELECT * FROM Win32_Bios", ['SerialNumber']);
results.hardware.identifiers['bios_serial'] = values[0]['SerialNumber'];
} catch (ex) { }
try {
results.hardware.identifiers['bios_mode'] = 'Legacy';
for (var i in results.hardware.windows.partitions) {
if (results.hardware.windows.partitions[i].Description=='GPT: System') {
results.hardware.identifiers['bios_mode'] = 'UEFI';
}
}
} catch (ex) { results.hardware.identifiers['bios_mode'] = 'Legacy'; }
}
if(results.hardware && results.hardware.linux) {
if (require('fs').statSync('/sys/class/dmi/id/product_serial').isFile()){
results.hardware.identifiers['bios_serial'] = require('fs').readFileSync('/sys/class/dmi/id/product_serial').toString().trim();
}
try {
results.hardware.identifiers['bios_mode'] = (require('fs').statSync('/sys/firmware/efi').isDirectory() ? 'UEFI': 'Legacy');
} catch (ex) { results.hardware.identifiers['bios_mode'] = 'Legacy'; }
}
results.hardware.agentvers = process.versions;
replaceSpacesWithUnderscoresRec(results);
Expand Down
1 change: 1 addition & 0 deletions views/default.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -11670,6 +11670,7 @@
if (ident.bios_vendor) { x += addDetailItem("Vendor", EscapeHtml(ident.bios_vendor), s); }
if (ident.bios_version) { x += addDetailItem("Version", EscapeHtml(ident.bios_version), s); }
if (ident.bios_serial) { x += addDetailItem("Serial", EscapeHtml(ident.bios_serial), s); }
if (ident.bios_mode) { x += addDetailItem("Mode", EscapeHtml(ident.bios_mode), s); }
if (x != '') { sections.push({ name: "BIOS", html: x, img: 'chip64.png' }); }

// Motherboard
Expand Down

0 comments on commit 1a34cba

Please sign in to comment.