From c1d26c9a00b204e4fe8b4c45f08d7f6eeed3c0a4 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Thu, 19 Jun 2025 10:58:27 +0200 Subject: [PATCH] system() added uuid freebsd --- lib/system.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/system.js b/lib/system.js index f2650f6..ea933f1 100644 --- a/lib/system.js +++ b/lib/system.js @@ -120,6 +120,14 @@ function system(callback) { util.noop(); } } + if (!result.uuid && (_freebsd || _openbsd || _netbsd)) { + try { + const disksById = execSync('sysctl -i kern.hostid kern.hostuuid', util.execOptsLinux).toString(); + result.uuid = util.getValue(lines, 'kern.hostid', ':').toLowerCase(); + } catch (e) { + util.noop(); + } + } if (!result.virtual && (os.release().toLowerCase().indexOf('microsoft') >= 0 || os.release().toLowerCase().endsWith('wsl2'))) { const kernelVersion = parseFloat(os.release().toLowerCase()); result.virtual = true;