feat(machine): add OS and kernel version information to machine info, show in 'machine ls'

This commit is contained in:
Pasha Sviderski
2026-06-24 17:57:20 +10:00
parent 9ea30e6ee9
commit ad43569fe5
8 changed files with 574 additions and 230 deletions
+12
View File
@@ -0,0 +1,12 @@
package osinfo
import "golang.org/x/sys/unix"
// KernelVersion returns the running Linux kernel release, e.g. "6.8.0-31-generic".
func KernelVersion() string {
var un unix.Utsname
if err := unix.Uname(&un); err != nil {
return ""
}
return unix.ByteSliceToString(un.Release[:])
}