blob: 3ab43ed0b4bf0745e5d4efe66ea588bb2225bd0d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#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) {
ffCleanUpSmbiosValue(&bios->date);
}
if (ffSysctlGetString("machdep.dmi.bios-version", &bios->version) == NULL) {
ffCleanUpSmbiosValue(&bios->version);
}
if (ffSysctlGetString("machdep.dmi.bios-vendor", &bios->vendor) == NULL) {
ffCleanUpSmbiosValue(&bios->vendor);
}
if (ffSysctlGetString("machdep.bootmethod", &bios->type) != NULL) {
ffStrbufSetStatic(&bios->type, ffPathExists("/dev/efi", FF_PATHTYPE_FILE) ? "UEFI" : "BIOS");
}
return NULL;
}
|