Bios (NetBSD): adds fall back method

This commit is contained in:
Carter Li
2026-04-03 10:25:04 +08:00
parent 77c916f747
commit 31a35cf845
+4 -1
View File
@@ -1,6 +1,7 @@
#include "bios.h"
#include "common/sysctl.h"
#include "common/smbios.h"
#include "common/io.h"
const char* ffDetectBios(FFBiosResult* bios) {
if (ffSysctlGetString("machdep.dmi.bios-date", &bios->date) == NULL) {
@@ -12,6 +13,8 @@ const char* ffDetectBios(FFBiosResult* bios) {
if (ffSysctlGetString("machdep.dmi.bios-vendor", &bios->vendor) == NULL) {
ffCleanUpSmbiosValue(&bios->vendor);
}
ffSysctlGetString("machdep.bootmethod", &bios->type);
if (ffSysctlGetString("machdep.bootmethod", &bios->type) != NULL) {
ffStrbufSetStatic(&bios->type, ffPathExists("/dev/efi", FF_PATHTYPE_FILE) ? "UEFI" : "BIOS");
}
return NULL;
}