summaryrefslogtreecommitdiff
path: root/src/cryptsetup/cryptsetup-generator.c
diff options
context:
space:
mode:
authorLorenz Hübschle-Schneider <dev@4z2.de>2018-06-26 19:41:30 +0200
committerLennart Poettering <lennart@poettering.net>2018-06-27 16:57:17 +0200
commitb90cbe6638560b9e42343e705a561b73b6dca39f (patch)
tree232e820260591a134be22d68afa94d394492078b /src/cryptsetup/cryptsetup-generator.c
parent04e075b572b168a183cde29480dbb30d027d4fe7 (diff)
downloadsystemd-b90cbe6638560b9e42343e705a561b73b6dca39f.tar.gz
cryptsetup: Add dependency on loopback setup to generated units
For loopback volumes, the generated unit needs to depend on systemd-tmpfiles-setup-dev.service to ensure that loopback support is loaded. Fixes #9308
Diffstat (limited to 'src/cryptsetup/cryptsetup-generator.c')
-rw-r--r--src/cryptsetup/cryptsetup-generator.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index f5a81829b9..d8e65c0098 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -151,8 +151,13 @@ static int create_disk(
fputs("Before=dev-mapper-%i.swap\n",
f);
} else
+ /* For loopback devices, add systemd-tmpfiles-setup-dev.service
+ dependency to ensure that loopback support is available in
+ the kernel (/dev/loop-control needs to exist) */
fprintf(f,
- "RequiresMountsFor=%s\n",
+ "RequiresMountsFor=%s\n"
+ "Requires=systemd-tmpfiles-setup-dev.service\n"
+ "After=systemd-tmpfiles-setup-dev.service\n",
u_escaped);
r = generator_write_timeouts(arg_dest, device, name, options, &filtered);