mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
version, hostinfo: recognize gokrazy as a distro
Now: /tmp/breakglass3929186798 # /user/tailscale debug hostinfo { "IPNVersion": "1.23.0-date.20220107", "OS": "linux", "OSVersion": "Gokrazy; kernel=5.16.11", "DeviceModel": "Raspberry Pi 4 Model B Rev 1.2", "Hostname": "gokrazy", "GoArch": "arm64" } Also, cache the distro lookup. It doesn't change while the program is running: name old time/op new time/op delta Get-6 5.21µs ± 5% 0.00µs ± 3% -99.91% (p=0.008 n=5+5) name old alloc/op new alloc/op delta Get-6 792B ± 0% 0B -100.00% (p=0.008 n=5+5) name old allocs/op new allocs/op delta Get-6 8.00 ± 0% 0.00 -100.00% (p=0.008 n=5+5) Updates #1866 Change-Id: Ifb9a63b94287010d3f4c8bfeb6b78119e8a9b203 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
6a2e94cbeb
commit
58a6c9b2b8
@@ -113,6 +113,8 @@ func osVersionLinux() string {
|
||||
return fmt.Sprintf("Synology %s%s", m["productversion"], attr)
|
||||
case distro.OpenWrt:
|
||||
return fmt.Sprintf("OpenWrt %s%s", m["DISTRIB_RELEASE"], attr)
|
||||
case distro.Gokrazy:
|
||||
return fmt.Sprintf("Gokrazy%s", attr)
|
||||
}
|
||||
return fmt.Sprintf("Other%s", attr)
|
||||
}
|
||||
|
Reference in New Issue
Block a user