summaryrefslogtreecommitdiffstats
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorJonathan Lebon <jonathan@jlebon.com>2019-04-10 23:28:15 +0200
committerLennart Poettering <lennart@poettering.net>2019-04-11 17:04:24 +0200
commit30fdb8962ad4bcb6093044e1942975659d44d86b (patch)
treec3fb01990d0b3036ad7cdfa139b5888f6f82a916 /src/fstab-generator
parentMerge pull request #12279 from keszybz/sd-bus-long-signatures (diff)
downloadsystemd-30fdb8962ad4bcb6093044e1942975659d44d86b.tar.xz
systemd-30fdb8962ad4bcb6093044e1942975659d44d86b.zip
fstab-generator: use DefaultDependencies=no for /sysroot mounts
Otherwise we can end up with an ordering cycle. Since d54bab90, all local mounts now gain a default `Before=local-fs.target` dependency. This doesn't make sense for `/sysroot` mounts in the initrd though, since those happen later in the boot process. Closes: #12231
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 612b1789e3..d35f2f993e 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -353,6 +353,12 @@ static int add_mount(
"Documentation=man:fstab(5) man:systemd-fstab-generator(8)\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