From 5989f61b4b1d63f05a8dc505c8ef90da6e49cb38 Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 23 Sep 2024 15:36:17 -0500 Subject: [PATCH] Wait for the devfs to initialize before mounting it --- src/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index b8ccb98..54627a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,15 +75,20 @@ fn main() { syslog_client.subscribe_to_text(); syslog_client.subscribe_to_binary("devfs".to_string(), vec![0, 1]); syslog_client.subscribe_to_binary("tarfs".to_string(), vec![0]); + let mut msg_handler = SyslogMessageHandler::new(); let vfs_pid = run_initrd_proc(&initrd, "bin/vfs"); - run_initrd_proc(&initrd, "bin/devfs"); let vfs_client = vfs_rpc::Client::new(vfs_pid); + run_initrd_proc(&initrd, "bin/devfs"); + loop { + let msg = msg_handler.get_message(); + if msg.from == "devfs" { + break; + } + } vfs_client .mount(Path::new("/dummy"), "devfs", Path::new("/dev")) .unwrap(); run_initrd_proc(&initrd, "bin/tarfs"); - let mut msg_handler = SyslogMessageHandler::new(); - loop { let msg = msg_handler.get_message(); if msg.from == "tarfs" {