summaryrefslogtreecommitdiffstats
path: root/src/fstab-generator/fstab-generator.c
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2020-04-02 08:29:36 +0200
committerFranck Bui <fbui@suse.com>2020-04-09 15:17:09 +0200
commit83cdc870949823b5b9fa04dd76e952d42faab0b1 (patch)
tree28dbf6ba52af8328a644477b1dc4004c75e0e632 /src/fstab-generator/fstab-generator.c
parentmount: mount unit activated by automount unit should be only ordered against ... (diff)
downloadsystemd-83cdc870949823b5b9fa04dd76e952d42faab0b1.tar.xz
systemd-83cdc870949823b5b9fa04dd76e952d42faab0b1.zip
mount: let pid1 alone handle the default dependencies for mount units
fstab-generator was also handling the default ordering dependencies for mount units setup in initrd. To do that it was turning the defaults dependencies off completely and ordered the mount unit against either local-fs.target or initrd-fs.target or initrd-root-fs.target itself. But it had the bad side effect to also remove all other default dependencies as well. Thus if an initrd mount was using _netdev, the network dependencies were missing. In general fstab-generator shouldn't use DefaultDependecies=no because it can handle only a small set of the default dependencies the rest are dealt by pid1. So this patch makes pid1 handle all default dependencies.
Diffstat (limited to 'src/fstab-generator/fstab-generator.c')
-rw-r--r--src/fstab-generator/fstab-generator.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 08c7b76dba..16be342dbf 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -391,12 +391,6 @@ static int add_mount(
"SourcePath=%s\n",
source);
- /* All mounts under /sysroot need to happen later, at initrd-fs.target time. IOW, it's not
- * technically part of the basic initrd filesystem itself, and so shouldn't inherit the default
- * Before=local-fs.target dependency. */
- if (in_initrd() && path_startswith(where, "/sysroot"))
- fprintf(f, "DefaultDependencies=no\n");
-
if (STRPTR_IN_SET(fstype, "nfs", "nfs4") && !(flags & AUTOMOUNT) &&
fstab_test_yes_no_option(opts, "bg\0" "fg\0")) {
/* The default retry timeout that mount.nfs uses for 'bg' mounts
@@ -411,9 +405,6 @@ static int add_mount(
SET_FLAG(flags, NOFAIL, true);
}
- if (!(flags & NOFAIL) && !(flags & AUTOMOUNT))
- fprintf(f, "Before=%s\n", post);
-
if (!(flags & AUTOMOUNT) && opts) {
r = write_after(f, opts);
if (r < 0)