hostinfo: set DeviceModel from Linux devicetree model
"bytes"
"fmt"
"io/ioutil"
+ "os"
"strings"
"syscall"
func init() {
osVersion = osVersionLinux
+
+ if v, _ := os.ReadFile("/sys/firmware/devicetree/base/model"); len(v) > 0 {
+ // Look up "Raspberry Pi 4 Model B Rev 1.2",
+ // etc. Usually set on ARM SBCs.
+ SetDeviceModel(strings.Trim(string(v), "\x00\r\n\t "))
+ }
}
func osVersionLinux() string {
