From 3dcccb2ba22f7e4168376c3c16eeae9976c22a24 Mon Sep 17 00:00:00 2001 From: pjht Date: Tue, 10 Sep 2024 21:06:31 -0500 Subject: [PATCH] Keep processing syslog messages after starting phase 2 --- src/main.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9872c17..9ec538c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -99,7 +99,7 @@ fn main() { .send_text_message("init", "Started the tar archive FS") .unwrap(); - let mut msg_handler= SyslogMessageHandler::new(); + let mut msg_handler = SyslogMessageHandler::new(); loop { let msg = msg_handler.get_message(); @@ -130,13 +130,17 @@ fn main() { .send_text_message("init", "Mounted the initrd as the root FS") .unwrap(); Command::new("/bin/serial_driver").spawn().unwrap(); - while !msg_handler.registered_devices.iter().any(|x| x=="ttyS0") { + while !msg_handler.registered_devices.iter().any(|x| x == "ttyS0") { msg_handler.process_messages(); } Command::new("/bin/partserv").spawn().unwrap(); Command::new("/bin/ext2").spawn().unwrap(); Command::new("/bin/pci").spawn().unwrap(); - while !msg_handler.registered_devices.iter().any(|x| x=="ahci0d0p1") { + while !msg_handler + .registered_devices + .iter() + .any(|x| x == "ahci0d0p1") + { msg_handler.process_messages(); } @@ -148,8 +152,7 @@ fn main() { ) .unwrap(); - - while !msg_handler.registered_devices.iter().any(|x| x=="bga0") { + while !msg_handler.registered_devices.iter().any(|x| x == "bga0") { msg_handler.process_messages(); } @@ -174,6 +177,10 @@ fn main() { .unwrap(); Command::new("/bin/init_phase2").spawn().unwrap(); + + loop { + msg_handler.process_messages(); + } } fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 {