2.1 KiB
2.1 KiB
Contributing
Workflow
Work inside the dev shell (direnv allow once). Run cargo clippy --all-targets before committing (the crate warns on clippy pedantic plus
absolute_paths) and cargo fmt, which needs the nightly toolchain for
rustfmt.toml. Version control is jj, not the git CLI.
Testing
cargo test: model and render snapshot tests.nix run .#demo-units -- start, thencargo run -- --user --target bootvine-demo.target --hold 3s: live against your user manager.nix build .#checks.x86_64-linux.<name>: eachtests/<name>.nixboots a VM and runstests/console.pyfollowed bytests/<name>.py.bootfollows the initrd, stage 2 and a poweroff;luksanswers a passphrase prompt in the initrd. They read tty12 as text from/dev/vcsu12, hold the boot with the initrd backdoor and gate files under/runinstead of sleeping. Run one by hand withnix run .#checks.x86_64-linux.boot.driverInteractive, thentest_script().nix run .#docs, from the repository root: rendersdocs/boot.tapeanddocs/shutdown.tapewith VHS against the scripted examples into the README GIFs, and copies the passphrase screenshot from thelukscheck.
Prefix the VM commands with env -u LD_LIBRARY_PATH when the shell exports
libraries that clash with QEMU's.
Conventions
- No comments or doc comments; intent lives in names and call flow.
- Pub fields instead of getters,
Durationinstead of raw integers, crates instead of hand-written formatting. - One thread: the loop sleeps in one
poll(2)on the terminal, the bus and an inotify watch on/run/systemd/ask-password, with the next frame as timeout, then draws. - Ratatui views are built declaratively from iterators.
systemd's private socket
- zbus rejects it: PID 1 sends as
org.freedesktop.systemd1, not a unique name. libdbus works. - libdbus pipelines
BEGINwith the first message and sd-bus leaves it unread, so a no-replyPinggoes out right after connecting. - Surviving switch-root needs
argv[0]starting with@,IgnoreOnIsolate, and a chroot through an fd to/sysroottaken wheninitrd-switch-root.serviceis queued.