Skip to content

Commit fabebe5

Browse files
authored
Merge pull request #4530 from tianon/rpi-armv6
Add RPi1/RPi0 workaround
2 parents 7ce2386 + 2055e12 commit fabebe5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

platforms/cpuinfo.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ func getCPUVariant() string {
9696
return ""
9797
}
9898

99+
// handle edge case for Raspberry Pi ARMv6 devices (which due to a kernel quirk, report "CPU architecture: 7")
100+
// https://www.raspberrypi.org/forums/viewtopic.php?t=12614
101+
if runtime.GOARCH == "arm" && variant == "7" {
102+
model, err := getCPUInfo("model name")
103+
if err == nil && strings.HasPrefix(strings.ToLower(model), "armv6-compatible") {
104+
variant = "6"
105+
}
106+
}
107+
99108
switch strings.ToLower(variant) {
100109
case "8", "aarch64":
101110
// special case: if running a 32-bit userspace on aarch64, the variant should be "v7"

0 commit comments

Comments
 (0)