This page collects ideas on how to restructure and improve the cryptsetup initramfs hook script cryptroot.
List of possible setups that need to be supported
List the devices in a hierarchic order:
physical block device -> plain dm-crypt -> root
two physical block devices -> two luks devices -> lvm vg -> root, swap, ...
two physical block devices -> two luks devices -> btrfs array -> root
two physical block devices -> two luks devices -> mdadm array -> root
two physical block devices -> mdadm array -> luks -> root