From 40674fa5469c7af09095d5dd5cca8eccc728561c Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 30 Jul 2022 20:45:36 +0200 Subject: user: replace the MOUNT macro with MOUNT_AT The old style could be confused with a regular function, where the driver would be executed unconditionally. This should make it more obvious that the driver doesn't get executed in the parent process. --- src/user/bootstrap/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/user/bootstrap/main.c') diff --git a/src/user/bootstrap/main.c b/src/user/bootstrap/main.c index e877b64..fc239cf 100644 --- a/src/user/bootstrap/main.c +++ b/src/user/bootstrap/main.c @@ -15,14 +15,16 @@ void _start(void) { _syscall_memflag(&_bss_start, &_bss_end - &_bss_start, MEMFLAG_PRESENT); /* move everything provided by the kernel to /kdev */ - MOUNT("/kdev/", fs_passthru(NULL)); - if (!fork2_n_mount("/")) { + MOUNT_AT("/kdev/") { fs_passthru(NULL); } + MOUNT_AT("/") { const char *l[] = {"/kdev/", NULL}; fs_whitelist(l); } - if (!fork2_n_mount("/")) fs_dir_inject("/kdev/"); // TODO should be part of fs_whitelist + MOUNT_AT("/") { + fs_dir_inject("/kdev/"); // TODO should be part of fs_whitelist + } - MOUNT("/init/", tar_driver(&_initrd)); + MOUNT_AT("/init/") { tar_driver(&_initrd); } void *init = tar_find("bin/init", 8, &_initrd, ~0) + 512; if (init) { -- cgit v1.2.3