mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Create mount points in fs_init() if they don't exist
In containerized or virtualized environments, standard mount point directories may not exist at boot. Ensure they are created before attempting to mount.
This commit is contained in:
@@ -523,6 +523,10 @@ static void fs_init(void)
|
||||
if (fismnt(fs[i].file))
|
||||
continue;
|
||||
|
||||
/* Create mount point if it doesn't exist */
|
||||
if (mkdir(fs[i].file, 0755) && errno != EEXIST)
|
||||
warn("Failed creating mountpoint %s: %s", fs[i].file, strerror(errno));
|
||||
|
||||
fs_mount(fs[i].spec, fs[i].file, fs[i].type, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user