mirror of
https://github.com/troglobit/finit.git
synced 2026-11-02 13:20:32 +00:00
Ensure mount/unmount skips 'noauto' entries
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
2 files changed
+15
No files matched your search
+10
@@ -212,6 +212,11 @@ static int fsck(int pass)
|
|||||||
if (mnt->mnt_passno == 0 || mnt->mnt_passno != pass)
|
if (mnt->mnt_passno == 0 || mnt->mnt_passno != pass)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (hasmntopt(mnt, "noauto")) {
|
||||||
|
dbg("Skipping fsck of %s, marked noauto", mnt->mnt_fsname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Device to maybe fsck, */
|
/* Device to maybe fsck, */
|
||||||
dev = mnt->mnt_fsname;
|
dev = mnt->mnt_fsname;
|
||||||
|
|
||||||
@@ -425,6 +430,11 @@ static void fs_swapon(char *cmd, size_t len)
|
|||||||
if (strcmp(mnt->mnt_type, MNTTYPE_SWAP))
|
if (strcmp(mnt->mnt_type, MNTTYPE_SWAP))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (hasmntopt(mnt, "noauto")) {
|
||||||
|
dbg("Skipping swap %s, marked noauto", mnt->mnt_fsname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(cmd, len, "swapon %s", mnt->mnt_fsname);
|
snprintf(cmd, len, "swapon %s", mnt->mnt_fsname);
|
||||||
run_interactive(cmd, "Enabling swap %s", mnt->mnt_fsname);
|
run_interactive(cmd, "Enabling swap %s", mnt->mnt_fsname);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,6 +187,11 @@ static void fs_swapoff(void)
|
|||||||
if (strcmp(mnt->mnt_type, MNTTYPE_SWAP))
|
if (strcmp(mnt->mnt_type, MNTTYPE_SWAP))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (hasmntopt(mnt, "noauto")) {
|
||||||
|
dbg("Skipping swap %s, marked noauto", mnt->mnt_fsname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(cmd, sizeof(cmd), "swapoff %s", mnt->mnt_fsname);
|
snprintf(cmd, sizeof(cmd), "swapoff %s", mnt->mnt_fsname);
|
||||||
run_interactive(cmd, "Disabling swap %s", mnt->mnt_fsname);
|
run_interactive(cmd, "Disabling swap %s", mnt->mnt_fsname);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user