| 165 | } |
| 166 | |
| 167 | void VirtualFileSystem::initialize(BAN::StringView root_path) |
| 168 | { |
| 169 | ASSERT(!s_instance); |
| 170 | s_instance = MUST(BAN::RefPtr<VirtualFileSystem>::create()); |
| 171 | |
| 172 | s_instance->m_root_fs = load_root_filesystem(root_path); |
| 173 | if (!s_instance->m_root_fs) |
| 174 | panic("Could not load root filesystem"); |
| 175 | |
| 176 | Credentials root_creds { 0, 0, 0, 0 }; |
| 177 | MUST(s_instance->mount(root_creds, &DevFileSystem::get(), "/dev"_sv)); |
| 178 | |
| 179 | MUST(s_instance->mount(root_creds, &ProcFileSystem::get(), "/proc"_sv)); |
| 180 | |
| 181 | auto tmpfs = MUST(TmpFileSystem::create(-1, 01777, 0, 0)); |
| 182 | MUST(s_instance->mount(root_creds, tmpfs, "/tmp"_sv)); |
| 183 | } |
| 184 | |
| 185 | VirtualFileSystem& VirtualFileSystem::get() |
| 186 | { |
nothing calls this directly
no test coverage detected