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()
|
||||
},
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user