From 10a39b88d7f40e4ca84cfcb9293d18c364db9867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 15 Jun 2023 10:15:31 +0800 Subject: [PATCH] Chassis (FreeBSD): add support --- CMakeLists.txt | 2 +- src/detection/chassis/chassis_bsd.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/detection/chassis/chassis_bsd.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 37797921b..d0168ed4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -431,7 +431,7 @@ elseif(BSD) src/detection/bluetooth/bluetooth_linux.c src/detection/board/board_bsd.c src/detection/brightness/brightness_nosupport.c - src/detection/chassis/chassis_nosupport.c + src/detection/chassis/chassis_bsd.c src/detection/cpu/cpu_bsd.c src/detection/cpuusage/cpuusage_bsd.c src/detection/cursor/cursor_linux.c diff --git a/src/detection/chassis/chassis_bsd.c b/src/detection/chassis/chassis_bsd.c new file mode 100644 index 000000000..e6475c2eb --- /dev/null +++ b/src/detection/chassis/chassis_bsd.c @@ -0,0 +1,13 @@ +#include "chassis.h" +#include "common/settings.h" + +void ffDetectChassis(FFChassisResult* result) +{ + ffStrbufInit(&result->error); + ffStrbufInit(&result->chassisType); + ffStrbufInit(&result->chassisVendor); + ffStrbufInit(&result->chassisVersion); + ffSettingsGetFreeBSDKenv("smbios.chassis.type", &result->chassisType); + ffSettingsGetFreeBSDKenv("smbios.chassis.maker", &result->chassisVendor); + ffSettingsGetFreeBSDKenv("smbios.chassis.version", &result->chassisVersion); +}