diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d6c7a710b..4ff4da1319 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Notable Changes: Features: * Windows (7 and newer) is officially and fully supported -* FreeBSD support is improved greatly (Cpu Temp, Cpu Usage, Disk, Host, Processes, Swap, Terminal / Shell, Uptime) +* FreeBSD support is improved greatly (Bios, Cpu Temp, Cpu Usage, Disk, Host, Processes, Swap, Terminal / Shell, Uptime) * Adds a new flag `--stat`, which prints time usage for individual modules * Adds Wifi module which supports Windows and macOS * Adds data source option for logo printing diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d654b9d80..a20b980bca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 1.7.5 + VERSION 1.8.0 LANGUAGES C DESCRIPTION "Fast system information tool" HOMEPAGE_URL "https://github.com/LinusDierheimer/fastfetch" @@ -380,7 +380,7 @@ elseif(BSD) src/common/processing_linux.c src/common/sysctl.c src/detection/battery/battery_nosupport.c - src/detection/bios/bios_nosupport.c + src/detection/bios/bios_bsd.c src/detection/board/board_nosupport.c src/detection/chassis/chassis_nosupport.c src/detection/cpu/cpu_bsd.c diff --git a/src/detection/bios/bios_bsd.c b/src/detection/bios/bios_bsd.c new file mode 100644 index 0000000000..8c993f0a95 --- /dev/null +++ b/src/detection/bios/bios_bsd.c @@ -0,0 +1,26 @@ +#include "bios.h" + +#include + +static void kenvLookup(const char* name, FFstrbuf* result) +{ + ffStrbufEnsureFree(result, 255); + int len = kenv(KENV_GET, name, result->chars, 256); + if(len > 0) + result->length = (uint32_t) len; +} + +void ffDetectBios(FFBiosResult* bios) +{ + ffStrbufInit(&bios->error); + ffStrbufInit(&bios->biosDate); + ffStrbufInit(&bios->biosRelease); + ffStrbufInit(&bios->biosVendor); + ffStrbufInit(&bios->biosVersion); + + //https://wiki.ghostbsd.org/index.php/Kenv + kenvLookup("smbios.bios.reldate", &bios->biosDate); + kenvLookup("smbios.system.product", &bios->biosRelease); + kenvLookup("smbios.bios.vendor", &bios->biosVendor); + kenvLookup("smbios.bios.version", &bios->biosVersion); +}