]> git.ipfire.org Git - thirdparty/systemd.git/commit
cryptsetup-generator: imply x-initrd.attach for "usr" and "root" volumes
authorLennart Poettering <lennart@poettering.net>
Thu, 1 Jun 2023 12:40:38 +0000 (14:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 1 Jun 2023 16:49:43 +0000 (18:49 +0200)
commit8ce02b87cece09797c1030c778db4180e1e2ce2e
treee83186f08e2ec425586ad7f369fd4f5ed08e27ac
parentd120ce478dc0043c89899799b5c1aaf62901bea9
cryptsetup-generator: imply x-initrd.attach for "usr" and "root" volumes

Let's imply "x-initrd.attach" for "usr" and "root" volumes, so that
we do not attempt to umount them anymore during shutdown.

The names of these volumes have been mandated by the Discoverable
Partition Spec:

https://uapi-group.org/specifications/specs/discoverable_partitions_specification/#suggested-mode-of-operation

Hence it appears reasonably safe to special case these volume names.

Note that a similar logic is implemented in fstab-generator and in fact
PID 1 to treat the root mount and /usr/ mount specially too, to avoid
trying to umount it at shutdown. (This is what fstab_is_extrinsic()
checks).

This should ensure that if /usr/ or / is for some reason a LUKS medium
we won't try to detach it during runtime, which likely fails, since we
run off it.

Note this also moves an ordering dep towards umount.target under the
x-initrd.attach check, becasue that's where the crucial conflicts dep is
placed too.
src/cryptsetup/cryptsetup-generator.c