mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00: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:
1 parent
9396cd1d26
commit
39044adcf8
1 file changed
+4
@@ -523,6 +523,10 @@ static void fs_init(void)
|
|||||||
if (fismnt(fs[i].file))
|
if (fismnt(fs[i].file))
|
||||||
continue;
|
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);
|
fs_mount(fs[i].spec, fs[i].file, fs[i].type, 0, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user