On Mon, 3 Jun 2024 at 00:22, Guilhem Moulin <guil...@debian.org> wrote: > > On Mon, 03 Jun 2024 at 00:14:39 +0100, Luca Boccassi wrote: > > On Mon, 3 Jun 2024 at 00:09, Guilhem Moulin <guil...@debian.org> wrote: > >> On Sun, 02 Jun 2024 at 23:35:57 +0100, Luca Boccassi wrote: > >>> I gather the initramfs scripts are not calling a deferred close after > >>> mounting the rootfs in the initrd. If you add that, the device should > >>> be automatically cleaned up when the root filesystem is umounted. > >> > >> initramfs-tools doesn't take the system back on shutdown, so there is > >> nothing src:cryptsetup can do here. > > > > The deferred close is given on the initrd though, immediately after > > mounting, which I think is done by the cryptsetup initramfs hook? > > Deferred close means that it will be closed by the kernel once the > > last mount is gone. So if you call that from the initramfs hook, > > things should work out automatically on shutdown. > > I see, thanks for the explanation. The cryptsetup initramfs scripts are > currently only involved at pre-mount stage and do not try to mount > anything, but we could add another one at post-mount stage for this.
Yeah that should work, thanks.