diff --git a/cmd/earlyinit/main.go b/cmd/earlyinit/main.go index d1652e5f..987faeab 100644 --- a/cmd/earlyinit/main.go +++ b/cmd/earlyinit/main.go @@ -7,6 +7,7 @@ package main import ( "context" "crypto/rand" + "io" "log" "os" "os/signal" @@ -51,13 +52,14 @@ func init() { func fatal(v ...any) { log.Println(v...) log.Println("unable to continue, please reboot and resolve the problem manually") + log.SetOutput(io.Discard) select {} } // must calls fatal with err if it is non-nil. func must(err error) { if err != nil { - log.Println(err) + fatal(err) select {} } } diff --git a/cmd/earlyinit/modprobe.go b/cmd/earlyinit/modprobe.go index 8addf973..8194c150 100644 --- a/cmd/earlyinit/modprobe.go +++ b/cmd/earlyinit/modprobe.go @@ -26,8 +26,9 @@ var _ report.RepresentableError = ModprobeError{} func (ModprobeError) Representable() {} func (e ModprobeError) Error() string { return fmt.Sprintf( - "modprobe exit status %d: %s", - e.ExitCode, strings.TrimSpace(e.Stderr), + "%s (exit status %d)", + strings.TrimPrefix(strings.TrimSpace(e.Stderr), "modprobe: "), + e.ExitCode, ) }