We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cab0611 commit ea2812bCopy full SHA for ea2812b
stat.go
@@ -3,6 +3,7 @@ package main
3
import (
4
"bufio"
5
"io/ioutil"
6
+ "log"
7
"os"
8
"runtime"
9
"strconv"
@@ -117,7 +118,10 @@ func GetGPUCores() int32 {
117
118
func GetHardwareType() string {
119
data, err := ioutil.ReadFile("/proc/device-tree/model")
120
if err != nil {
- return "unknown"
121
+ if data, err = ioutil.ReadFile("/var/device-tree/model"); err != nil {
122
+ log.Printf("file does not exist, %s", "/var/device-tree/model")
123
+ return "unknown"
124
+ }
125
}
126
127
version := string(data)
@@ -137,6 +141,7 @@ func GetHardwareType() string {
137
141
return "pi0"
138
142
139
143
144
+ log.Printf("Device info = %s, unknown", version)
140
145
return "unknown"
146
147
0 commit comments