Move mounting the shared_memory ramfs to launch_daemon.

The directory is created there, so we should also perform the
mount operation there. If we don't, the first boot of a new
Haiku image will not have the ramfs shared_memory, since of
course the kernel can't mount it at a nonexistent directory.
This commit is contained in:
Augustin Cavalier
2024-06-25 19:09:38 -04:00
parent 146690fec4
commit 0caf909cec
2 changed files with 10 additions and 5 deletions
@@ -7,6 +7,8 @@
//! Empty main temporary directory
#include <fs_volume.h>
#include "InitSharedMemoryDirectoryJob.h"
@@ -20,5 +22,12 @@ InitSharedMemoryDirectoryJob::InitSharedMemoryDirectoryJob()
status_t
InitSharedMemoryDirectoryJob::Execute()
{
return CreateAndEmpty("/var/shared_memory");
status_t status = CreateAndEmpty("/var/shared_memory");
if (status != B_OK)
return status;
status = fs_mount_volume("/var/shared_memory", NULL, "ramfs", 0, NULL);
if (status < B_OK)
return status;
return B_OK;
}
-4
View File
@@ -555,10 +555,6 @@ vfs_mount_boot_file_system(kernel_args* args)
}
}
status = _kern_mount("/boot/system/var/shared_memory", NULL, "ramfs", 0, NULL, 0);
if (status < B_OK)
dprintf("Failed to mount shared memory FS: %s\n", strerror(status));
// Now that packagefs is mounted, the boot volume is really ready.
gBootDevice = bootDevice;