Create an empty root if initrd failed to be loaded

This commit is contained in:
Alex 2023-05-11 18:34:49 +03:00
parent 149d8ba790
commit 28ec505b78
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -426,6 +426,15 @@ EXTERNC NIF void Main()
}
}
if (vfs->GetRootNode()->Children.size() == 0)
{
VirtualFileSystem::FileSystemOperations null_op = {
.Name = "null",
};
vfs->CreateRoot("/", &null_op);
}
if (!vfs->PathExists("/system"))
vfs->Create("/system", NodeFlags::DIRECTORY);