Mount all filesystems
()
| 26 | |
| 27 | /// Mount all filesystems |
| 28 | pub 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 | } |
no test coverage detected