Keep processing syslog messages after starting phase 2

This commit is contained in:
pjht 2024-09-10 21:06:31 -05:00
parent 37895459bc
commit 3dcccb2ba2
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -99,7 +99,7 @@ fn main() {
.send_text_message("init", "Started the tar archive FS") .send_text_message("init", "Started the tar archive FS")
.unwrap(); .unwrap();
let mut msg_handler= SyslogMessageHandler::new(); let mut msg_handler = SyslogMessageHandler::new();
loop { loop {
let msg = msg_handler.get_message(); let msg = msg_handler.get_message();
@ -130,13 +130,17 @@ fn main() {
.send_text_message("init", "Mounted the initrd as the root FS") .send_text_message("init", "Mounted the initrd as the root FS")
.unwrap(); .unwrap();
Command::new("/bin/serial_driver").spawn().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(); msg_handler.process_messages();
} }
Command::new("/bin/partserv").spawn().unwrap(); Command::new("/bin/partserv").spawn().unwrap();
Command::new("/bin/ext2").spawn().unwrap(); Command::new("/bin/ext2").spawn().unwrap();
Command::new("/bin/pci").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(); msg_handler.process_messages();
} }
@ -148,8 +152,7 @@ fn main() {
) )
.unwrap(); .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(); msg_handler.process_messages();
} }
@ -174,6 +177,10 @@ fn main() {
.unwrap(); .unwrap();
Command::new("/bin/init_phase2").spawn().unwrap(); Command::new("/bin/init_phase2").spawn().unwrap();
loop {
msg_handler.process_messages();
}
} }
fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 { fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 {