Ensure mount/unmount skips 'noauto' entries

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-11-27 11:30:27 +01:00
parent c23952cd9e
commit 309cc7f741
2 changed files with 15 additions and 0 deletions
+10
View File
@@ -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);
}
+5
View File
@@ -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);
}