Another place where the initramfs framework helps is in bringing up computers whose disks are encrypted. Quite early in the boot process, the kernel will have to query the user for the password, and if correct, proceed with mounting the disks, and so on. But, think about this: how can we run a C program executable that is, say, requesting a password without having a C runtime environment in place – a root filesystem containing libraries, the loader program, required kernel modules (for the crypto support perhaps), and so on?
Remember, the kernel itself hasn't yet completed initialization; how can user space apps run? Again, the initramfs framework solves this issue by indeed setting up a temporary user space runtime environment complete with the required root filesystem containing libraries, the loader, kernel modules, and so on, in memory.
Can we verify this? Yes we can! Let's take a peek into the initramfs image file. The lsinitramfs...