Ubuntu 240.4 systemd-cryptsetup now has an external dependency.
The comment based hook is destroyed during early install process. Use python to manipulate the autoinstall file in a more sophisticated way. Also refactor the initramfs hook material to be standalone files.