This commit is contained in:
2026-02-19 10:07:43 +00:00
parent 007438e372
commit 6e637ecf77
1763 changed files with 60820 additions and 279516 deletions

View File

@@ -9,6 +9,7 @@ import (
"os"
"runtime"
"strconv"
"strings"
"tailscale.com/types/lazy"
"tailscale.com/util/lineiter"
@@ -31,6 +32,7 @@ const (
Unraid = Distro("unraid")
Alpine = Distro("alpine")
UBNT = Distro("ubnt") // Ubiquiti Networks
JetKVM = Distro("jetkvm")
)
var distro lazy.SyncValue[Distro]
@@ -102,10 +104,20 @@ func linuxDistro() Distro {
return Unraid
case have("/etc/alpine-release"):
return Alpine
case runtime.GOARCH == "arm" && isDeviceModel("JetKVM"):
return JetKVM
}
return ""
}
func isDeviceModel(want string) bool {
if runtime.GOOS != "linux" {
return false
}
v, _ := os.ReadFile("/sys/firmware/devicetree/base/model")
return want == strings.Trim(string(v), "\x00\r\n\t ")
}
func freebsdDistro() Distro {
switch {
case have("/etc/pfSense-rc"):