diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-06-01 15:00:27 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-06-01 18:49:43 +0200 |
commit | ce49a479d296648033611a4ce5fde929efb49354 (patch) | |
tree | c72791171175afa013d6637266421d85bd82d899 /src/cryptsetup/cryptsetup-generator.c | |
parent | veritysetup-generator: only generate one set of deps on systemd-tmpfiles-setu... (diff) | |
download | systemd-ce49a479d296648033611a4ce5fde929efb49354.tar.xz systemd-ce49a479d296648033611a4ce5fde929efb49354.zip |
{crypt|verity}setup: replace dep on systemd-tmpfiles-setup-dev.service by modprobe@loop.service
Both should have the same effect: the /dev/loop-control devices should
become available. systemd-tmpfiles-setup-dev.service creates the device
node "dry" based on modalias data, while modprobe@loop.service creates
it fully, because the module backing it is loaded properly. This should
shorten the deps chain a bit, simplify things and allows us to focus on
the stuff we actually need (i.e. the loopback infra) instead of all
entrypoints anyone might possibly need (i.e. the device nodes)
Diffstat (limited to 'src/cryptsetup/cryptsetup-generator.c')
-rw-r--r-- | src/cryptsetup/cryptsetup-generator.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index e00d4d4126..a22d932342 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -506,13 +506,13 @@ static int create_disk( "After=%s\n", d, d); 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) */ + /* For loopback devices make sure to explicitly load loop.ko, as this code might run very + * early where device nodes created via systemd-tmpfiles-setup-dev.service might not be + * around yet. Hence let's sync on the module itself. */ fprintf(f, "RequiresMountsFor=%s\n" - "Requires=systemd-tmpfiles-setup-dev.service\n" - "After=systemd-tmpfiles-setup-dev.service\n", + "Wants=modprobe@loop.service\n" + "After=modprobe@loop.service\n", u_escaped); r = generator_write_timeouts(arg_dest, device, name, options, &filtered); |