From f32595a0c230de98a50591808725c3c8f2e2c044 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 19 Sep 2022 13:17:15 +0100 Subject: [PATCH] Fix "getCPUInfo for OS freebsd: not implemented" on FreeBSD/arm64 Signed-off-by: Kate --- platforms/cpuinfo.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/platforms/cpuinfo.go b/platforms/cpuinfo.go index 046e0356d..23b6f180b 100644 --- a/platforms/cpuinfo.go +++ b/platforms/cpuinfo.go @@ -94,6 +94,19 @@ func getCPUVariant() string { return variant } + if runtime.GOOS == "freebsd" { + // FreeBSD supports ARMv6 and ARMv7 as well as ARMv4 and ARMv5 (though deprecated) + // detecting those variants is currently unimplemented + var variant string + switch runtime.GOARCH { + case "arm64": + variant = "v8" + default: + variant = "unknown" + } + + return variant + } variant, err := getCPUInfo("Cpu architecture") if err != nil {