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 <estesp@linux.vnet.ibm.com>
This commit is contained in:
Phil Estes 2020-02-11 15:46:36 -05:00
parent cbf3ee0e22
commit 89de113de9
No known key found for this signature in database
GPG Key ID: 0F386284C03A1162

View File

@ -98,7 +98,12 @@ func getCPUVariant() string {
switch strings.ToLower(variant) { switch strings.ToLower(variant) {
case "8", "aarch64": 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)": case "7", "7m", "?(12)", "?(13)", "?(14)", "?(15)", "?(16)", "?(17)":
variant = "v7" variant = "v7"
case "6", "6tej": case "6", "6tej":