From 89de113de9aedce0f41126c83c08ba9d3c6df0f1 Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Tue, 11 Feb 2020 15:46:36 -0500 Subject: [PATCH] Support 32-bit userspace on 64-bit ARM cores Don't rely on /proc/cpuinfo denoting a 64-bit ARMv8 processor if the runtime detected GOARCH == arm. This allows aarch64 32-bit userspace distros to run containers properly via a 32-bit runtime. Signed-off-by: Phil Estes --- platforms/cpuinfo.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platforms/cpuinfo.go b/platforms/cpuinfo.go index c4c9c9df9..ffa8970a8 100644 --- a/platforms/cpuinfo.go +++ b/platforms/cpuinfo.go @@ -98,7 +98,12 @@ func getCPUVariant() string { switch strings.ToLower(variant) { case "8", "aarch64": - variant = "v8" + // special case: if running a 32-bit userspace on aarch64, the variant should be "v7" + if runtime.GOARCH == "arm" { + variant = "v7" + } else { + variant = "v8" + } case "7", "7m", "?(12)", "?(13)", "?(14)", "?(15)", "?(16)", "?(17)": variant = "v7" case "6", "6tej":