Documentation
¶
Overview ¶
Package facts holds the system facts used for module selection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KernelRelease = func() (string, error) { out, err := exec.Command("uname", "-r").Output() if err != nil { return "", fmt.Errorf("query kernel release: %w", err) } return strings.TrimSpace(string(out)), nil }
KernelRelease returns the running kernel release (`uname -r`). It is a package-level var so tests can stub the lookup.
Functions ¶
func CheckKernelConstraint ¶ added in v0.9.0
CheckKernelConstraint validates one "<op> <version>" kernel constraint expression (the when.kernel grammar), with <op> one of < <= > >= == !=. Empty or malformed expressions are rejected loudly; callers treating an empty expression as "unset" must check for it first.
func CompareKernel ¶ added in v0.9.0
CompareKernel compares a running kernel release against one constraint ("<", "<=", ">", ">=", "==", "!=" and a dotted-numeric version). Version comparison is numeric per dotted segment (7.10 > 7.1), with missing segments treated as zero; a distro suffix on the release ("6.12.1-arch1-1") is ignored.