Update dependencies

This commit is contained in:
bluepython508
2025-04-09 01:00:12 +01:00
parent f0641ffd6e
commit 5a9cfc022c
882 changed files with 68930 additions and 24201 deletions

View File

@@ -6,13 +6,12 @@ package distro
import (
"bytes"
"io"
"os"
"runtime"
"strconv"
"tailscale.com/types/lazy"
"tailscale.com/util/lineread"
"tailscale.com/util/lineiter"
)
type Distro string
@@ -31,6 +30,7 @@ const (
WDMyCloud = Distro("wdmycloud")
Unraid = Distro("unraid")
Alpine = Distro("alpine")
UBNT = Distro("ubnt") // Ubiquiti Networks
)
var distro lazy.SyncValue[Distro]
@@ -76,6 +76,12 @@ func linuxDistro() Distro {
case have("/usr/local/bin/freenas-debug"):
// TrueNAS Scale runs on debian
return TrueNAS
case have("/usr/bin/ubnt-device-info"):
// UBNT runs on Debian-based systems. This MUST be checked before Debian.
//
// Currently supported product families:
// - UDM (UniFi Dream Machine, UDM-Pro)
return UBNT
case have("/etc/debian_version"):
return Debian
case have("/etc/arch-release"):
@@ -132,18 +138,19 @@ func DSMVersion() int {
return v
}
// But when run from the command line, we have to read it from the file:
lineread.File("/etc/VERSION", func(line []byte) error {
for lr := range lineiter.File("/etc/VERSION") {
line, err := lr.Value()
if err != nil {
break // but otherwise ignore
}
line = bytes.TrimSpace(line)
if string(line) == `majorversion="7"` {
v = 7
return io.EOF
return 7
}
if string(line) == `majorversion="6"` {
v = 6
return io.EOF
return 6
}
return nil
})
return v
}
return 0
})
}