diff options
author | Thomas Bächler <thomas@archlinux.org> | 2013-09-30 01:34:45 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-10-19 12:23:17 +0200 |
commit | 4c8bda2442bfc6d84a5deb241dc29efcb81bf3af (patch) | |
tree | 04a12877332dffe96bb0647f5bce6b6e647f0e6a /src | |
parent | 64e70e4b86d3f732d3513189312f6220d1d5cfbc (diff) |
gpt-auto-generator: Generate explicit dependencies on systemd-fsck@.service instead of using FsckPassNo
[tomegun: check for OOM]
Diffstat (limited to 'src')
-rw-r--r-- | src/gpt-auto-generator/gpt-auto-generator.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index fae4b7112c..25440e771e 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -182,7 +182,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) @@ -200,19 +200,23 @@ static int add_home(const char *path, const char *fstype) { return -errno; } + fsck = unit_name_from_path_instance("systemd-fsck", path, ".service"); + if (!fsck) + return log_oom(); + 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)) { |