feat: capture early-boot logs to a configurable path - #13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
earlyBoot.captureLogs/earlyBoot.logsPathtomicroinit.json; buffer script stdout+stderr in RAM and truncate-write after early-boot exits (safe for NVMe/dataremount).fsync, signal number in header.--early-boot-logs-pathor peeking an existing live/image config.Test plan
cargo fmt,cargo clippy --all-targets -D warnings(default +--no-default-features+--features init)cargo testfor all three feature combosmake manearlyBoot.captureLogs: trueand verify/data/early-boot.logafter rebootMade with Cursor