Skip to content

feat: capture early-boot logs to a configurable path - #13

Merged
keskad merged 1 commit into
mainfrom
feat/early-boot-log-capture
Aug 24, 2026
Merged

feat: capture early-boot logs to a configurable path#13
keskad merged 1 commit into
mainfrom
feat/early-boot-log-capture

Conversation

@keskad

@keskad keskad commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add earlyBoot.captureLogs / earlyBoot.logsPath to microinit.json; buffer script stdout+stderr in RAM and truncate-write after early-boot exits (safe for NVMe /data remount).
  • Harden capture: byte/line bounds, invalid UTF-8 must not deadlock PID 1, raw-byte console tee, fsync, signal number in header.
  • Best-effort persist on fatal early-boot via --early-boot-logs-path or peeking an existing live/image config.

Test plan

  • cargo fmt, cargo clippy --all-targets -D warnings (default + --no-default-features + --features init)
  • cargo test for all three feature combos
  • make man
  • Boot hub image with earlyBoot.captureLogs: true and verify /data/early-boot.log after reboot

Made with Cursor

Buffer early-boot stdout/stderr in RAM with byte and line limits, tee raw
bytes to the console, and flush to earlyBoot.logsPath after the script exits
so NVMe /data migration still lands on the final mount. Harden the reader
against invalid UTF-8 and unterminated lines, fsync the log file, record
terminating signals in the header, and best-effort persist on fatal early-boot
via --early-boot-logs-path or an existing config peek.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keskad
keskad merged commit 6c041dd into main Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant