3 Commits
13 changed files with 149 additions and 88 deletions

No files matched your search

+1
View File
@@ -1,2 +1,3 @@
target
result*
/recordings/
+7
View File
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.1.1](https://codeberg.org/wvhulle/bootvine/compare/v0.1.0...v0.1.1) - 2026-10-30
### Changed
- read the release environment from the crate build and generate the sample machine apps
- keep recordings on an orphan branch
## [0.1.0](https://codeberg.org/wvhulle/bootvine/releases/tag/v0.1.0) - 2026-10-25
### Added
Generated
+1 -1
View File
@@ -144,7 +144,7 @@ dependencies = [
[[package]]
name = "bootvine"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"clap",
"crossterm 0.29.0",
+1 -1
View File
@@ -9,7 +9,7 @@ I started bootvine out of frustration with the boot screen of most Linux
distributions: a wall of log lines scrolling past too fast to read, which never
gave me any idea of what was going on.
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/main/recordings/boot.gif" width="691" alt="A boot through the initrd into stage 2, with one failed unit">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/boot.gif" width="691" alt="A boot through the initrd into stage 2, with one failed unit">
It also follows shutdowns, answers passphrase prompts such as a
[LUKS](https://gitlab.com/cryptsetup/cryptsetup) unlock in place, and shows why
+1 -1
View File
@@ -9,7 +9,7 @@ name = "bootvine"
readme = "../README.md"
repository = "https://codeberg.org/wvhulle/bootvine"
rust-version = "1.91"
version = "0.1.0"
version = "0.1.1"
[lints]
workspace = true
+5 -1
View File
@@ -9,7 +9,7 @@
| `xtask/` | repository tasks run with `cargo xtask` |
| `vm-tests/` | the sample NixOS machines, one folder each with its VM check |
| `nix/` | the crane builds and the NixOS module |
| `recordings/` | the scripted demo GIFs and the sample machine WebP recordings the README and the [guide](guide.md) show |
| `recordings/` | ignored output of `record-screencasts`: the scripted demo GIFs and the sample machine WebP recordings, published on the `recordings` branch for the README and the [guide](guide.md) |
`cargo build` and `cargo test` act on every crate. `cargo run` needs the binary:
`--bin bootvine`, `--bin scripted-boot` and so on.
@@ -109,6 +109,10 @@ exports libraries that clash with [QEMU](https://www.qemu.org) or Chromium.
- `nix run .#record-screencasts` re-records the animations from the scripted
demos and turns the frames each VM check captured into
`recordings/<machine>.webp`, for the README and the [guide](guide.md).
- `nix run .#publish-recordings` force-pushes `recordings/` as the single,
parentless commit of the `recordings` branch, which the README and the guide
link to. Keeping the recordings off `main` keeps them out of every clone and
flake fetch.
- `cargo xtask sync-default-config` rewrites the defaults block in
[configuration](configuration.md#defaults) from `bootvine defaults`.
- `cargo run --bin bootvine -- install --destdir <dir> --initrd dracut` stages an install
+7 -7
View File
@@ -7,7 +7,7 @@ by their [VM checks](development.md#testing).
## Reading the screen
<img src="../recordings/boot.gif" width="691" alt="A boot through the initrd into stage 2, with one failed unit">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/boot.gif" width="691" alt="A boot through the initrd into stage 2, with one failed unit">
From top to bottom:
@@ -47,7 +47,7 @@ From top to bottom:
## Booting through the initrd
<img src="../recordings/slow-services.webp" width="640" alt="A NixOS machine booting through the initrd into stage 2, handing over to a greetd login, then powering off">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/slow-services.webp" width="640" alt="A NixOS machine booting through the initrd into stage 2, handing over to a greetd login, then powering off">
The `slow-services` machine boots with a held hardware probe in the initrd,
slow units in stage 2 and one failing unit, hands over to its greetd login
@@ -69,7 +69,7 @@ How bootvine gets in that early and survives the switch is in
### Without a display manager
<img src="../recordings/text-console.webp" width="640" alt="The same boot on a machine without a display manager, ending at a text login">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/text-console.webp" width="640" alt="The same boot on a machine without a display manager, ending at a text login">
The `text-console` machine boots the same units without greetd. With no
display manager to wait for, bootvine hands the console back as soon as the
@@ -77,7 +77,7 @@ default target is reached, and the text login on `tty1` comes forward.
### Without a systemd initrd
<img src="../recordings/scripted-initrd.webp" width="640" alt="The same boot with NixOS's scripted initrd: the kernel and initrd lines scroll past before bootvine starts in stage 2">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/scripted-initrd.webp" width="640" alt="The same boot with NixOS's scripted initrd: the kernel and initrd lines scroll past before bootvine starts in stage 2">
The `scripted-initrd` machine uses NixOS's older scripted initrd, which has no
systemd. The initrd's lines scroll past as usual, and bootvine starts in
@@ -85,7 +85,7 @@ stage 2, from `sysinit.target` on.
## Shutdown
<img src="../recordings/shutdown.gif" width="691" alt="A poweroff: units stopping under the targets waiting on them">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/shutdown.gif" width="691" alt="A poweroff: units stopping under the targets waiting on them">
On a poweroff, reboot or halt the tree turns around:
@@ -97,7 +97,7 @@ On a poweroff, reboot or halt the tree turns around:
## Passphrase prompts
<img src="../recordings/encrypted-volume.webp" width="640" alt="A LUKS passphrase prompt floating over the initrd tree, a wrong answer, then the unlock">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/encrypted-volume.webp" width="640" alt="A LUKS passphrase prompt floating over the initrd tree, a wrong answer, then the unlock">
The `encrypted-volume` machine asks for a LUKS passphrase in the initrd; its
recording shows a wrong answer, then the right one.
@@ -118,7 +118,7 @@ bootvine started, bootvine waits behind it.
## Failures
<img src="../recordings/failures.webp" width="640" alt="Units failing one after another, each landing in the failure panel with its reason and last journal lines">
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/failures.webp" width="640" alt="Units failing one after another, each landing in the failure panel with its reason and last journal lines">
A unit that broke or timed out gets an entry in the failure panel, newest
first:
+63 -65
View File
@@ -86,51 +86,46 @@
...
}:
let
runSampleMachine = machineName: description: {
type = "app";
meta.description = "Boot the ${machineName} sample machine in QEMU: ${description}";
program = lib.getExe (vmTests.nixosSystemFor system machineName).config.system.build.vm;
};
runReleasePlzOnCodeberg = subcommand: description: {
shellScriptApp = name: description: scriptArgs: {
type = "app";
meta.description = description;
program = lib.getExe (
pkgs.writeShellApplication {
name = "release-plz-${subcommand}";
runtimeInputs = [
pkgs.release-plz
pkgs.gitMinimal
pkgs.pkg-config
pkgs.stdenv.cc
rustToolchain
];
text = ''
export PKG_CONFIG_PATH="${
lib.makeSearchPathOutput "dev" "lib/pkgconfig" [
pkgs.dbus
pkgs.systemd
]
}"
exec release-plz ${subcommand} --forge gitea --git-token "$CODEBERG_TOKEN"
'';
}
);
program = lib.getExe (pkgs.writeShellApplication ({ inherit name; } // scriptArgs));
};
sampleMachineApps = lib.mapAttrs' (
machineName: machineDescription:
lib.nameValuePair "sample-vm-${machineName}" {
type = "app";
meta.description = "Boot the ${machineName} sample machine in QEMU: ${machineDescription}";
program = lib.getExe (vmTests.nixosSystemFor system machineName).config.system.build.vm;
}
) vmTests.machineDescriptions;
releasePlzOnCodeberg =
subcommand: description:
shellScriptApp "release-plz-${subcommand}" description {
runtimeInputs = [
pkgs.release-plz
pkgs.gitMinimal
pkgs.pkg-config
pkgs.stdenv.cc
rustToolchain
];
runtimeEnv.PKG_CONFIG_PATH =
lib.makeSearchPathOutput "dev" "lib/pkgconfig"
builds.bootvine.buildInputs;
text = ''exec release-plz ${subcommand} --forge gitea --git-token "$CODEBERG_TOKEN"'';
};
in
{
release-plz-release = runReleasePlzOnCodeberg "release" "Publish unpublished versions to crates.io and tag them with a Codeberg release";
release-plz-release-pr = runReleasePlzOnCodeberg "release-pr" "Open or update the Codeberg pull request that bumps the version and changelog";
sample-vm-slow-services = runSampleMachine "slow-services" "slow and failing units, a held initrd probe and a greetd login";
sample-vm-text-console = runSampleMachine "text-console" "the slow units without a display manager, handing over at the default target";
sample-vm-scripted-initrd = runSampleMachine "scripted-initrd" "the slow units with the scripted initrd, so bootvine starts in stage 2";
sample-vm-encrypted-volume = runSampleMachine "encrypted-volume" "a LUKS volume unlocked in the initrd with the passphrase 'sample passphrase'";
sample-vm-failures = runSampleMachine "failures" "units that fail in every way systemd reports, each with journal messages";
record-screencasts = {
type = "app";
meta.description = "Re-record the scripted demo animations and the sample machine recordings into recordings/";
program = lib.getExe (
pkgs.writeShellApplication {
name = "record-screencasts";
sampleMachineApps
// {
release-plz-release = releasePlzOnCodeberg "release" "Publish unpublished versions to crates.io and tag them with a Codeberg release";
release-plz-release-pr = releasePlzOnCodeberg "release-pr" "Open or update the Codeberg pull request that bumps the version and changelog";
record-screencasts =
shellScriptApp "record-screencasts"
"Re-record the scripted demo animations and the sample machine recordings into recordings/; publish them with publish-recordings"
{
runtimeInputs = [
pkgs.vhs
pkgs.libwebp
@@ -142,34 +137,37 @@
lib.mapAttrs (machineName: _: self.checks.${system}."vm-${machineName}") vmTests.machines
)
}";
}
);
};
build-and-push-to-cachix = {
type = "app";
meta.description = "Build flake outputs and push everything built to the wvhulle Cachix cache";
program = lib.getExe (
pkgs.writeShellApplication {
name = "build-and-push-to-cachix";
};
publish-recordings =
shellScriptApp "publish-recordings"
"Replace the recordings branch on origin with a single commit holding recordings/"
{
runtimeInputs = [
pkgs.gitMinimal
builds.repo-tasks
];
text = "exec xtask publish-recordings";
};
build-and-push-to-cachix =
shellScriptApp "build-and-push-to-cachix"
"Build flake outputs and push everything built to the wvhulle Cachix cache"
{
runtimeInputs = [ pkgs.cachix ];
text = ''exec cachix watch-exec wvhulle -- nix build --print-build-logs "$@"'';
}
);
};
check-conventional-commits = {
type = "app";
meta.description = "Check that the commit messages in a git revision range are conventional commits";
program = lib.getExe (
pkgs.writeShellApplication {
name = "check-conventional-commits";
};
check-conventional-commits =
shellScriptApp "check-conventional-commits"
"Check that the commit messages in a git revision range are conventional commits"
{
runtimeInputs = [
pkgs.convco
pkgs.gitMinimal
];
text = ''exec convco check "$@"'';
}
);
};
};
}
);
@@ -180,9 +178,9 @@
bootvine-build = builds.bootvine;
repo-tasks-build = builds.repo-tasks;
}
// lib.mapAttrs' (
machineName: check: lib.nameValuePair "vm-${machineName}" check
) (vmTests.checksFor pkgs)
// lib.mapAttrs' (machineName: check: lib.nameValuePair "vm-${machineName}" check) (
vmTests.checksFor pkgs
)
);
devShells = forEachSystem (
+9 -9
View File
@@ -9,18 +9,18 @@ let
networking.hostName = "bootvine-${machineName}";
};
machineNames = [
"slow-services"
"text-console"
"scripted-initrd"
"encrypted-volume"
"failures"
];
machineDescriptions = {
slow-services = "slow and failing units, a held initrd probe and a greetd login";
text-console = "the slow units without a display manager, handing over at the default target";
scripted-initrd = "the slow units with the scripted initrd, so bootvine starts in stage 2";
encrypted-volume = "a LUKS volume unlocked in the initrd with the passphrase 'sample passphrase'";
failures = "units that fail in every way systemd reports, each with journal messages";
};
machines = lib.genAttrs machineNames machineModule;
machines = lib.mapAttrs (machineName: _: machineModule machineName) machineDescriptions;
in
{
inherit machines;
inherit machines machineDescriptions;
sampleUnits = import ./slow-services/sample-units.nix;
+6
View File
@@ -1,3 +1,4 @@
mod publish_recordings;
mod record_screencasts;
mod sync_default_config;
mod task_error;
@@ -20,6 +21,10 @@ enum Task {
screenshots to WebP in recordings/"
)]
RecordScreencasts(RecordScreencastsOptions),
#[command(
about = "Replace the recordings branch on origin with a single commit holding recordings/"
)]
PublishRecordings,
#[command(
about = "Rewrite the defaults block in docs/configuration.md from `bootvine defaults`"
)]
@@ -41,6 +46,7 @@ fn main() -> ExitCode {
Task::RecordScreencasts(options) => {
record_screencasts::record_screencasts(&options.vm_check_outputs)
}
Task::PublishRecordings => publish_recordings::publish_recordings(),
Task::SyncDefaultConfig => sync_default_config::sync_default_config(),
};
match outcome {
+38
View File
@@ -0,0 +1,38 @@
use std::path::Path;
use xshell::{Shell, cmd};
use crate::{record_screencasts::RECORDINGS_DIRECTORY, task_error::TaskError};
const RECORDINGS_BRANCH: &str = "refs/heads/recordings";
pub fn publish_recordings() -> Result<(), TaskError> {
if !Path::new(RECORDINGS_DIRECTORY).is_dir() {
return Err(TaskError::RecordingsMissing);
}
let shell = Shell::new()?;
let git_directory = cmd!(shell, "git rev-parse --absolute-git-dir").read()?;
let temporary_directory = shell.create_temp_dir()?;
let _index_override = shell.push_env(
"GIT_INDEX_FILE",
temporary_directory.path().join("recordings-index"),
);
let _git_directory_override = shell.push_env("GIT_DIR", &git_directory);
let _recordings_directory = shell.push_dir(RECORDINGS_DIRECTORY);
cmd!(shell, "git --work-tree=. add --all --force .")
.quiet()
.run()?;
let recordings_tree = cmd!(shell, "git write-tree").read()?;
let recordings_commit = cmd!(
shell,
"git commit-tree {recordings_tree} -m 'chore: sample recordings [skip ci]'"
)
.read()?;
let branch = RECORDINGS_BRANCH;
cmd!(
shell,
"git push --force origin {recordings_commit}:{branch}"
)
.run()?;
Ok(())
}
+7 -2
View File
@@ -13,6 +13,7 @@ const TAPES: [&str; 2] = [
"scripted-demos/tapes/scripted-shutdown.tape",
];
const RECORDING_FRAME_MILLISECONDS: &str = "500";
pub const RECORDINGS_DIRECTORY: &str = "recordings";
fn sorted_entries(directory: &Path) -> Result<Vec<PathBuf>, TaskError> {
let read_failure = |source| TaskError::File {
@@ -106,10 +107,14 @@ fn encode_machine_recording(
}
pub fn record_screencasts(vm_check_outputs: &Path) -> Result<(), TaskError> {
let recordings = Path::new("recordings");
if !recordings.is_dir() {
if !TAPES.iter().all(|tape| Path::new(tape).is_file()) {
return Err(TaskError::NotInRepositoryRoot);
}
let recordings = Path::new(RECORDINGS_DIRECTORY);
fs::create_dir_all(recordings).map_err(|source| TaskError::File {
path: recordings.to_path_buf(),
source,
})?;
let shell = Shell::new()?;
TAPES.iter().try_for_each(|tape| {
let tape_path = Path::new(tape);
+3 -1
View File
@@ -10,8 +10,10 @@ pub enum TaskError {
File { path: PathBuf, source: io::Error },
#[error("{} has no recording frames", .0.display())]
NoRecordingFrames(PathBuf),
#[error("no recordings directory here; run from the repository root")]
#[error("no VHS tapes here; run from the repository root")]
NotInRepositoryRoot,
#[error("no recordings/ directory here; run record-screencasts from the repository root first")]
RecordingsMissing,
#[error("{0} has no ```toml block under its Defaults heading")]
DefaultsBlockMissing(&'static str),
}