We already do this in initrd-network.
Partially reverts commit 901163c0c7. This has broken remote SSH into initrd because ${cfg.shell} is not expanded. Also, nsswitch is useless without libnss_files.so which are installed by initrd-ssh.
901163c0c7
Also, drop boot.initrd.postEarlyDeviceCommands since preLVMCommands should work fine.