We already do this in initrd-network.
Partially reverts commit 901163c0c707d36323400394bf6e75adc4621e2f. 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.
Also, drop boot.initrd.postEarlyDeviceCommands since preLVMCommands should work fine.