From f4ad6d177a7cc554c552f2625faed886df9f6aec Mon Sep 17 00:00:00 2001 From: pjht Date: Tue, 19 Nov 2024 11:24:59 -0600 Subject: [PATCH] Start and mount tmpfs on boot --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6e51da5..9d51c36 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,6 +75,7 @@ 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]); + syslog_client.subscribe_to_binary("tmpfs".to_string(), vec![0]); let mut msg_handler = SyslogMessageHandler::new(); let proc_man_pid = run_initrd_proc(&initrd, "bin/proc_man"); let proc_man_client = proc_man_rpc::Client::new(proc_man_pid); @@ -96,6 +97,7 @@ fn main() { vfs_client .mount(Path::new("/dummy"), "devfs", Path::new("/dev")) .unwrap(); + run_initrd_proc(&initrd, "bin/tarfs"); loop { let msg = msg_handler.get_message(); @@ -110,6 +112,16 @@ fn main() { vfs_client .mount(Path::new("/dev/initrd"), "tarfs", Path::new("/")) .unwrap(); + Command::new("/bin/tmpfs").spawn().unwrap(); + loop { + let msg = msg_handler.get_message(); + if msg.from == "tmpfs" { + break; + } + } + vfs_client + .mount(Path::new("/dummy"), "tmpfs", Path::new("/tmp")) + .unwrap(); Command::new("/bin/partserv").spawn().unwrap(); Command::new("/bin/ext2").spawn().unwrap(); Command::new("/bin/pci").spawn().unwrap();