summaryrefslogtreecommitdiff
path: root/src/fstab-generator/fstab-generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fstab-generator/fstab-generator.c')
-rw-r--r--src/fstab-generator/fstab-generator.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index a7536f8f7e..77247dee5e 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -209,17 +209,30 @@ static int add_mount(
"Before=%s\n",
post);
+ if (passno > 0) {
+ _cleanup_free_ char *fsck = NULL;
+
+ fsck = unit_name_from_path_instance("systemd-fsck", what, ".service");
+ if (!fsck)
+ return log_oom();
+
+ fprintf(f,
+ "Requires=%s\n"
+ "After=%s\n",
+ fsck,
+ fsck);
+ }
+
+
fprintf(f,
"\n"
"[Mount]\n"
"What=%s\n"
"Where=%s\n"
- "Type=%s\n"
- "FsckPassNo=%i\n",
+ "Type=%s\n",
what,
where,
- type,
- passno);
+ type);
if (!isempty(opts) &&
!streq(opts, "defaults"))