mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
fs_init(): skip mounting proc/dev/sys if already mounted
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
d25c1d5564
commit
09b9e26b2d
1 file changed
+9
@@ -295,6 +295,15 @@ static void fs_init(void)
|
|||||||
for (i = 0; i < NELEMS(fs); i++) {
|
for (i = 0; i < NELEMS(fs); i++) {
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if already mounted, we may be running in a
|
||||||
|
* container, or an initramfs ran before us. The
|
||||||
|
* function fismnt() reliles on /proc/mounts being
|
||||||
|
* unique for each chroot/container.
|
||||||
|
*/
|
||||||
|
if (fismnt(fs[i].file))
|
||||||
|
continue;
|
||||||
|
|
||||||
rc = mount(fs[i].spec, fs[i].file, fs[i].type, 0, NULL);
|
rc = mount(fs[i].spec, fs[i].file, fs[i].type, 0, NULL);
|
||||||
if (rc && errno != EBUSY)
|
if (rc && errno != EBUSY)
|
||||||
_pe("Failed mounting %s on %s", fs[i].spec, fs[i].file);
|
_pe("Failed mounting %s on %s", fs[i].spec, fs[i].file);
|
||||||
|
|||||||
Reference in new issue
Block a user