c/agent: include EFI support in hardware report
Adds firmware EFI support status to the hardware report.
It is represented as an enum which is populated based on two different
data sources. The ENABLED state is set if Linux has EFI runtime
services available. The SUPPORTED/UNSUPPORTED states depend on the
SMBIOS tables provided by the firmware
and are used if EFI runtime services are not available.
If neither are available, UNKNOWN is used.
Change-Id: I7642ccda14d5494294a7463755de18e73a8a9c53
Reviewed-on: https://review.monogon.dev/c/monogon/+/1571
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/pkg/smbios/smbios.go b/metropolis/pkg/smbios/smbios.go
index 1c8ae69..0080278 100644
--- a/metropolis/pkg/smbios/smbios.go
+++ b/metropolis/pkg/smbios/smbios.go
@@ -160,7 +160,10 @@
// AtLeast returns true if the version in v is at least the given version.
func (v *Version) AtLeast(major, minor uint8) bool {
- return v.Major >= major && v.Minor >= minor
+ if v.Major > major {
+ return true
+ }
+ return v.Major == major && v.Minor >= minor
}
// UnmarshalStructureRaw unmarshals a SMBIOS structure into a Go struct which