76 lines
2.7 KiB
Markdown
76 lines
2.7 KiB
Markdown
# bootvine
|
|
|
|
A live tree of systemd jobs on the boot console, in the spirit of
|
|
nix-output-monitor. It replaces the scrolling kernel and systemd lines with the
|
|
units still pending and a timeline of the ones that ran.
|
|
|
|

|
|

|
|

|
|
|
|
It needs systemd ≥ 246 as PID 1, libdbus and a virtual terminal (it draws on
|
|
tty12). With a systemd initrd it starts about a second after the kernel and
|
|
follows the boot through the switch to the real root; without one it starts in
|
|
stage 2. While it runs it quiets the kernel console and systemd's status
|
|
output, and restores both when it hands the console back. Kernel messages from
|
|
before it starts still reach the screen; boot with `quiet`, or set
|
|
`boot.consoleLogLevel = 3` on NixOS, to keep those to errors.
|
|
|
|
It also follows shutdowns and reboots: the units being stopped, nested under
|
|
the units that have to stop first, until systemd hands over to
|
|
`systemd-shutdown`.
|
|
|
|
## Try
|
|
|
|
```sh
|
|
cargo run --example demo
|
|
```
|
|
|
|
plays a scripted boot without systemd; `q` quits. `nix run .#vm` boots a demo
|
|
VM in a window.
|
|
|
|
## Install
|
|
|
|
On NixOS, import `nixosModules.default` from the flake and set
|
|
`services.bootvine.enable = true`. With `boot.initrd.systemd.enable` the unit
|
|
goes into the initrd as well.
|
|
|
|
Elsewhere, install the binary to `/usr/bin` and the package's `lib/` under
|
|
`/usr/lib`, then `systemctl enable bootvine.service bootvine-shutdown.service`.
|
|
To start it in the
|
|
initrd, add `bootvine` to `add_dracutmodules` (dracut) or `sd-bootvine` after
|
|
`systemd` in `HOOKS` (mkinitcpio), and rebuild the initramfs.
|
|
|
|
## Configure
|
|
|
|
`/etc/bootvine.toml`, or `services.bootvine.palette` and
|
|
`services.bootvine.timing` on NixOS. Every key is optional; these are the
|
|
defaults:
|
|
|
|
```toml
|
|
[palette]
|
|
text = "white"
|
|
muted = "dark-gray"
|
|
waiting = "gray"
|
|
running = "yellow"
|
|
done = "green"
|
|
failed = "light-red"
|
|
target = "cyan"
|
|
|
|
[timing]
|
|
keep_finished_units_for = "2s"
|
|
hide_runs_shorter_than = "1s"
|
|
keep_final_frame_for = "1s"
|
|
```
|
|
|
|
Palette values are the 16 console colour names. To change how those look, set
|
|
the console palette: `console.colors` on NixOS, or the `vt.default_red`, `_grn`
|
|
and `_blu` kernel parameters elsewhere.
|
|
|
|
`keep_finished_units_for` is how long a finished unit stays in the tree, faded,
|
|
before it leaves. Runs shorter than `hide_runs_shorter_than` get no timer and no
|
|
timeline bar. `keep_final_frame_for` is how long the last frame stays before the
|
|
console is handed back; `--hold` overrides it.
|
|
|
|
The initrd hooks copy the file into the initramfs, so rebuild it after editing.
|