MCPcopy Index your code
hub / github.com/tailscale/tailscale / deviceModelLinux

Function deviceModelLinux

hostinfo/hostinfo_linux.go:50–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50func deviceModelLinux() string {
51 for _, path := range []string{
52 // First try the Synology-specific location.
53 // Example: "DS916+-j"
54 "/proc/sys/kernel/syno_hw_version",
55
56 // Otherwise, try the Devicetree model, usually set on
57 // ARM SBCs, etc.
58 // Example: "Raspberry Pi 4 Model B Rev 1.2"
59 // Example: "WD My Cloud Gen2: Marvell Armada 375"
60 "/sys/firmware/devicetree/base/model", // Raspberry Pi 4 Model B Rev 1.2"
61 } {
62 b, _ := os.ReadFile(path)
63 if s := strings.Trim(string(b), "\x00\r\n\t "); s != "" {
64 return s
65 }
66 }
67 return ""
68}
69
70func getQnapQtsVersion(versionInfo string) string {
71 for field := range strings.FieldsSeq(versionInfo) {

Callers

nothing calls this directly

Calls 1

ReadFileMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…