I've just setup a proof-of-concept UEFI, PXE, NFS diskless booting system. For the NFS booting to work, I needed to create a custom initramfs using dracut-network including modules for nfs, network, and base.Eventually, there will be many different filesystems (operating systems) on the NFS, each one with multiple kernels (from updates/debug). I want it to be relatively simple to create/update any of these OSs.How can I build one initramfs that will work with any generic distro kernel? (Is this even possible? Other architectural suggestions regarding the project are welcome too).
Creating generic initramfs that is kernel-independent
kernel;initramfs;dracut
Either the modules you need in order to mount the root filesystem (like nfs, the necessary network interface drivers, and so on) are built in to the kernel, or else they will need to be present in the initramfs. The former is unlikely, because distro kernels don't tend to have those modules linked in statically (they go for a minimum set, counting on the initramfs for the rest). The latter won't solve your problem, because you'll have to supply modules that go with any of the kernels that the user might be using.In other words, you probably can't.