]> git.ipfire.org Git - thirdparty/systemd.git/commit
units: add initrd-cryptsetup.target
authorJonathan Lebon <jonathan@jlebon.com>
Tue, 20 Oct 2020 20:30:20 +0000 (16:30 -0400)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Oct 2020 20:08:19 +0000 (22:08 +0200)
commit6c5496c492a8d74e54d22bf8824160cab1e63c10
tree5dd28fa028c3d690e41449870037a24bac6a7152
parent69f30d4321c3bc8fa27270e3fd36a7a5b4d0a89e
units: add initrd-cryptsetup.target

For encrypted block devices that we need to unlock from the initramfs,
we currently rely on dracut shipping `cryptsetup.target`. This works,
but doesn't cover the case where the encrypted block device requires
networking (i.e. the `remote-cryptsetup.target` version). That target
however is traditionally dynamically enabled.

Instead, let's rework things here by adding a `initrd-cryptsetup.target`
specifically for initramfs encrypted block device setup. This plays the
role of both `cryptsetup.target` and `remote-cryptsetup.target` in the
initramfs.

Then, adapt `systemd-cryptsetup-generator` to hook all generated
services to this new unit when running from the initrd. This is
analogous to `systemd-fstab-generator` hooking all mounts to
`initrd-fs.target`, regardless of whether they're network-backed or not.
man/systemd.special.xml
src/cryptsetup/cryptsetup-generator.c
units/initrd-cryptsetup.target [new file with mode: 0644]
units/meson.build