I found a working config for me: simply changing crypt to systemd-cryptsetup, no need to include other files.
Relevant bugs:
- With encrypted root + unencrypted boot + systemd, dracut may generate an initrd incapable of decrypting the root disk without showing any warnings or errors · Issue #684 · dracut-ng/dracut-ng · GitHub
- #1078792 - unbootable system after installing dracut on a standard Debian installation - #2 - Debian Bug report logs
Basically it’s what I suspected, that there’s a bug where crypt module doesn’t work if systemd is enabled.
I’ve been also wondering why we have to manually add crypt or systemd-cryptsetup. After studying the code, my theory is the detached header prevents dracut from automatically detecting the filesystem type.
@merowing I’m not sure why your config works for you but not for me. I’d guess either you don’t have systemd module enabled, or you have some other LUKS encrypted devices (without detached header), which makes dracut to include systemd-cryptsetup. Perhaps you can verify using lsinitrd /boot/initramfs-...