diff --git a/bootvine/src/boot_model/job_ingestion.rs b/bootvine/src/boot_model/job_ingestion.rs index 42266ac..4f566f1 100644 --- a/bootvine/src/boot_model/job_ingestion.rs +++ b/bootvine/src/boot_model/job_ingestion.rs @@ -94,6 +94,11 @@ impl BootState { } } + #[must_use] + pub fn awaits_manager(&self) -> bool { + self.root == Root::Unresolved + } + pub fn set_root(&mut self, root: String) { if self.phase == Phase::User && !self.milestone_targets.contains(&root) { self.milestone_targets.push(root.clone()); diff --git a/bootvine/src/boot_view/panel_render_tests.rs b/bootvine/src/boot_view/panel_render_tests.rs index 2af7f26..47696b6 100644 --- a/bootvine/src/boot_view/panel_render_tests.rs +++ b/bootvine/src/boot_view/panel_render_tests.rs @@ -13,6 +13,24 @@ use crate::{ const CRYPTSETUP_MESSAGE: &str = "Please enter passphrase for disk Samsung SSD 980 PRO 1TB (cryptroot):"; +#[test] +fn the_stage_says_when_the_manager_has_not_answered_yet() { + let mut state = BootState::new(Phase::Host); + let lines = render(&state, 500 * MS, 110, 24); + assert!( + lines[1].contains("Stage 2") && lines[1].contains("waiting for the system manager"), + "{}", + lines.join("\n") + ); + state.set_root("graphical.target".to_owned()); + let lines = render(&state, 500 * MS, 110, 24); + assert!( + lines.iter().all(|line| !line.contains("system manager")), + "{}", + lines.join("\n") + ); +} + #[test] fn tree_on_top_timeline_below() { let lines = render(&boot_in_progress(), 12_400 * MS, 110, 24); diff --git a/bootvine/src/boot_view/stage_summary.rs b/bootvine/src/boot_view/stage_summary.rs index 9d8f588..55e6b70 100644 --- a/bootvine/src/boot_view/stage_summary.rs +++ b/bootvine/src/boot_view/stage_summary.rs @@ -15,6 +15,7 @@ use crate::{ }; const SHUTDOWN_SUCCESSOR: &str = "systemd-shutdown"; +const AWAITING_MANAGER: &str = " · waiting for the system manager"; fn padded_phase_label(label: &str) -> String { format!( @@ -115,6 +116,11 @@ impl Stages<'_> { .fg(self.colors.current) .bold(), elapsed.fg(self.colors.current), + if self.state.awaits_manager() { + AWAITING_MANAGER.fg(self.colors.current) + } else { + Span::default() + }, ]) } } diff --git a/docs/guide.md b/docs/guide.md index b1a594e..532cdf9 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -58,7 +58,8 @@ the kernel: under `initrd.target`. - **The switch to the real root**: the initrd moves into the stages at the top, with its time and unit count, and the tree starts again under the - default target. The timeline keeps the initrd's runs, left of the `│`. + default target. Until the new manager answers, the stage line says it is + waiting for it. The timeline keeps the initrd's runs, left of the `│`. - **Stage 2** up to `graphical.target`. - **The handover**: bootvine hands the console back once the default target is reached, or earlier, once the display manager has switched to its own