1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

Kernel+Userland: Split bind-mounting and re-mounting from mount syscall

These 2 are an actual separate types of syscalls, so let's stop using
special flags for bind mounting or re-mounting and instead let userspace
calling directly for this kind of actions.
This commit is contained in:
Liav A 2023-02-25 19:30:28 +02:00 committed by Andrew Kaster
parent 04b44a827a
commit 0bbd9040ef
10 changed files with 204 additions and 42 deletions

View file

@ -401,10 +401,7 @@ static ErrorOr<void> populate_devtmpfs()
static ErrorOr<void> prepare_synthetic_filesystems()
{
// FIXME: Don't hardcode the fs type as the ext2 filesystem and once there's
// more than this filesystem implementation (which is suitable for usage on
// physical storage), find a way to detect it.
TRY(Core::System::mount(-1, "/"sv, "ext2"sv, MS_REMOUNT | MS_NODEV | MS_NOSUID | MS_RDONLY));
TRY(Core::System::remount("/"sv, MS_NODEV | MS_NOSUID | MS_RDONLY));
// FIXME: Find a better way to all of this stuff, without hardcoding all of this!
TRY(Core::System::mount(-1, "/proc"sv, "proc"sv, MS_NOSUID));
TRY(Core::System::mount(-1, "/sys"sv, "sys"sv, 0));