MCPcopy Create free account
hub / github.com/Starry-OS/StarryOS / mount_all

Function mount_all

api/src/vfs/mod.rs:28–51  ·  view source on GitHub ↗

Mount all filesystems

()

Source from the content-addressed store, hash-verified

26
27/// Mount all filesystems
28pub fn mount_all() -> LinuxResult<()> {
29 let fs = FS_CONTEXT.lock();
30 mount_at(&fs, "/dev", dev::new_devfs())?;
31 mount_at(&fs, "/dev/shm", tmp::MemoryFs::new())?;
32 mount_at(&fs, "/tmp", tmp::MemoryFs::new())?;
33 mount_at(&fs, "/proc", proc::new_procfs())?;
34
35 mount_at(&fs, "/sys", tmp::MemoryFs::new())?;
36 let mut path = PathBuf::new();
37 for comp in Path::new("/sys/class/graphics/fb0/device").components() {
38 path.push(comp.as_str());
39 if fs.resolve(&path).is_err() {
40 fs.create_dir(&path, DIR_PERMISSION)?;
41 }
42 }
43 path.push("subsystem");
44 fs.symlink("whatever", &path)?;
45 drop(fs);
46
47 #[cfg(feature = "dev-log")]
48 dev::bind_dev_log().expect("Failed to bind /dev/log");
49
50 Ok(())
51}

Callers 1

initFunction · 0.85

Calls 5

mount_atFunction · 0.85
new_devfsFunction · 0.85
new_procfsFunction · 0.85
bind_dev_logFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected