Skip to content

Commit 24f0cee

Browse files
committed
Ensure mount/unmount skips 'noauto' entries
Signed-off-by: Joachim Wiberg <[email protected]>
1 parent fee38d4 commit 24f0cee

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/finit.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ static int fsck(int pass)
212212
if (mnt->mnt_passno == 0 || mnt->mnt_passno != pass)
213213
continue;
214214

215+
if (hasmntopt(mnt, "noauto")) {
216+
dbg("Skipping fsck of %s, marked noauto", mnt->mnt_fsname);
217+
continue;
218+
}
219+
215220
/* Device to maybe fsck, */
216221
dev = mnt->mnt_fsname;
217222

@@ -425,6 +430,11 @@ static void fs_swapon(char *cmd, size_t len)
425430
if (strcmp(mnt->mnt_type, MNTTYPE_SWAP))
426431
continue;
427432

433+
if (hasmntopt(mnt, "noauto")) {
434+
dbg("Skipping swap %s, marked noauto", mnt->mnt_fsname);
435+
continue;
436+
}
437+
428438
snprintf(cmd, len, "swapon %s", mnt->mnt_fsname);
429439
run_interactive(cmd, "Enabling swap %s", mnt->mnt_fsname);
430440
}

src/sig.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ static void fs_swapoff(void)
187187
if (strcmp(mnt->mnt_type, MNTTYPE_SWAP))
188188
continue;
189189

190+
if (hasmntopt(mnt, "noauto")) {
191+
dbg("Skipping swap %s, marked noauto", mnt->mnt_fsname);
192+
continue;
193+
}
194+
190195
snprintf(cmd, sizeof(cmd), "swapoff %s", mnt->mnt_fsname);
191196
run_interactive(cmd, "Disabling swap %s", mnt->mnt_fsname);
192197
}

0 commit comments

Comments
 (0)