| 1 | package guestos |
| 2 | |
| 3 | import ( |
| 4 | "bytes" |
| 5 | "context" |
| 6 | "runtime" |
| 7 | "strings" |
| 8 | |
| 9 | "github.com/sylvinus/agent-vm/internal/host" |
| 10 | ) |
| 11 | |
| 12 | func Inspect(_ context.Context) Inspection { |
| 13 | r := Inspection{Guest: Debian13, WorkbenchSupport: "supported"} |
| 14 | if runtime.GOARCH != "amd64" { |
| 15 | r.WorkbenchSupport = "unsupported-host" |
| 16 | r.Detail = "Linux 桌面发行包面向 x86_64 主机。" |
| 17 | return r |
| 18 | } |
| 19 | var details bytes.Buffer |
| 20 | r.HostCheckPassed = host.LinuxPrereqs(&details) |
| 21 | r.Detail = strings.TrimSpace(details.String()) |
| 22 | if r.HostCheckPassed { |
| 23 | r.Detail = "已检测到 Debian 工作台所需的 Linux 虚拟化组件。" |
| 24 | } |
| 25 | return r |
| 26 | } |