mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Ensure mount/unmount skips 'noauto' entries
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+10
@@ -212,6 +212,11 @@ static int fsck(int pass)
|
||||
if (mnt->mnt_passno == 0 || mnt->mnt_passno != pass)
|
||||
continue;
|
||||
|
||||
if (hasmntopt(mnt, "noauto")) {
|
||||
dbg("Skipping fsck of %s, marked noauto", mnt->mnt_fsname);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Device to maybe fsck, */
|
||||
dev = mnt->mnt_fsname;
|
||||
|
||||
@@ -425,6 +430,11 @@ static void fs_swapon(char *cmd, size_t len)
|
||||
if (strcmp(mnt->mnt_type, MNTTYPE_SWAP))
|
||||
continue;
|
||||
|
||||
if (hasmntopt(mnt, "noauto")) {
|
||||
dbg("Skipping swap %s, marked noauto", mnt->mnt_fsname);
|
||||
continue;
|
||||
}
|
||||
|
||||
snprintf(cmd, len, "swapon %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))
|
||||
continue;
|
||||
|
||||
if (hasmntopt(mnt, "noauto")) {
|
||||
dbg("Skipping swap %s, marked noauto", mnt->mnt_fsname);
|
||||
continue;
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "swapoff %s", mnt->mnt_fsname);
|
||||
run_interactive(cmd, "Disabling swap %s", mnt->mnt_fsname);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user