m/n/core: add pstore handling
Adds a one-shot runnable which dumps all kmsg dumps to the system log
and then clears the pstore. This makes sure that there is always space
for new pstore entries and gives administrators the option of reading
crash logs without booting another operating system. It also helps some
broken EFI firmware to not fail to boot.
Change-Id: Icbf30c0a0898e0e660910a80637d544f022a97cd
Reviewed-on: https://review.monogon.dev/c/monogon/+/770
Reviewed-by: Sergiusz Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/node/core/main.go b/metropolis/node/core/main.go
index 0af18e9..eb674ae 100644
--- a/metropolis/node/core/main.go
+++ b/metropolis/node/core/main.go
@@ -132,6 +132,9 @@
if err := supervisor.Run(ctx, "time", timeSvc.Run); err != nil {
return fmt.Errorf("when starting time: %w", err)
}
+ if err := supervisor.Run(ctx, "pstore", dumpAndCleanPstore); err != nil {
+ return fmt.Errorf("when starting pstore: %w", err)
+ }
// Start the role service. The role service connects to the curator and runs
// all node-specific role code (eg. Kubernetes services).