feat: say when the screen is waiting for the system manager
Between the switch to the real root and the new manager answering, the tree stayed empty for seconds and looked stuck. The stage line now says what it is waiting for, and the same holds for the moment after bootvine starts.
This commit is contained in:
4 files changed
+31
-1
No files matched your search
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
},
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user