live-image: install stage tools and fail loudly if any are missing
The live image was still carrying the Phase 2 package list, so SMART, CPUStress, and Network each hit a LookPath miss and returned pass-with-skip. A run that skipped every real check still ended in "completed" — nothing on the report said the image was broken. Add smartmontools, stress-ng, fio, iperf3, lshw, lm-sensors, e2fsprogs, and util-linux to mkosi.conf. Flip the three stages from skip-pass to fail when their binary is missing so any future packaging regression blocks the run instead of whispering past it. Legitimate "no hardware" skips (no GPU, no hwmon, no disks, non-destructive) are untouched. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,21 @@ import (
|
||||
// surfaces as a per-disk "skipped" entry; the stage only fails if at
|
||||
// least one disk reports !passed.
|
||||
func SMART(ctx context.Context, d Deps) Outcome {
|
||||
// smartctl absence is a packaging defect, not a per-disk skip. The
|
||||
// per-disk `err != nil` path below catches "this device doesn't
|
||||
// support SMART" (virtio-blk, exit 4); pre-checking the binary up
|
||||
// front keeps that skip legitimate and fails the stage loudly if
|
||||
// the live image lost its smartmontools package.
|
||||
if _, err := exec.LookPath("smartctl"); err != nil {
|
||||
d.Error("SMART: smartctl not found — live image is missing required tool")
|
||||
return Outcome{
|
||||
Passed: false,
|
||||
Message: "smartctl binary missing from live image",
|
||||
Summary: "failed (smartctl missing)",
|
||||
Extras: map[string]any{"reason": "smartctl_missing"},
|
||||
}
|
||||
}
|
||||
|
||||
disks, err := listBlockDisks()
|
||||
if err != nil {
|
||||
d.Warn("SMART: failed to enumerate /sys/class/block: " + err.Error())
|
||||
|
||||
Reference in New Issue
Block a user