[systemd-devel] [PATCH 2/3] gpt-auto-generator: Generate explicit dependencies on systemd-fsck at .service instead of using FsckPassNo
Thomas Bächler
thomas at archlinux.org
Sun Sep 29 16:34:45 PDT 2013
---
src/gpt-auto-generator/gpt-auto-generator.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index ca54925..97b4742 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -180,7 +180,7 @@ static int add_swap(const char *path, const char *fstype) {
}
static int add_home(const char *path, const char *fstype) {
- _cleanup_free_ char *unit = NULL, *lnk = NULL;
+ _cleanup_free_ char *unit = NULL, *lnk = NULL, *fsck = NULL;
_cleanup_fclose_ FILE *f = NULL;
if (dir_is_empty("/home") <= 0)
@@ -198,19 +198,21 @@ static int add_home(const char *path, const char *fstype) {
return -errno;
}
+ fsck = unit_name_from_path_instance("systemd-fsck", path, ".service");
+
fprintf(f,
"# Automatically generated by systemd-gpt-auto-generator\n\n"
"[Unit]\n"
"DefaultDependencies=no\n"
- "After=" SPECIAL_LOCAL_FS_PRE_TARGET "\n"
+ "Requires=%s\n"
+ "After=" SPECIAL_LOCAL_FS_PRE_TARGET " %s\n"
"Conflicts=" SPECIAL_UMOUNT_TARGET "\n"
"Before=" SPECIAL_UMOUNT_TARGET " " SPECIAL_LOCAL_FS_TARGET "\n\n"
"[Mount]\n"
"What=%s\n"
"Where=/home\n"
- "Type=%s\n"
- "FsckPassNo=2\n",
- path, fstype);
+ "Type=%s\n",
+ fsck, fsck, path, fstype);
fflush(f);
if (ferror(f)) {
--
1.8.4
More information about the systemd-devel
mailing list