initramfs

Initramfs is for initial ram filesystem ( loosely translated as home file system in memory) and is the successor of the initrd. The initramfs is a compressed archive containing needed for the system startup files. It can be hung from the Linux kernel at boot time as root. Then one on the initramfs existing program ( init) starts. The started program can perform different tasks. For embedded systems can be included all the functionality of the system in the initramfs. Personal computer using the initramfs often only as an intermediate step to load drivers and make other preparations for the start of the actual system. By the initramfs or initrd it was possible to make the boot process on Linux flexible and outsource functionality from the kernel into userspace.

Boot

The Linux kernel since version 2.5.46 booting from an initramfs. The initramfs archive can even be included in the kernel or loaded by the boot loader from a file into memory. The kernel decompresses the initramfs archive and then hangs the unpacked archive as a root directory. Next, an attempt is made to start the program / ​​init from initramfs. Fails to start, the kernel tries to mount the real root device and / start there sbin / init.

The initramfs is a cpio archive itself, which is usually a Unix shell (often BusyBox ), and other basic programs. In this case, / init a simple shell script that links the programs included in the initramfs in the desired manner. It is also possible that / init is a C program that is linked against a small variant of libc. The final task of / init it is usually to mount the real root device from the root directory and / start sbin / init.

Changes compared with initrd

  • In the kernel, a file system driver must be compiled directly
  • The size of the initramfs is not subject to fixed upper limit
  • Accesses to the initramfs are not buffered, so memory is saved
  • Various cpio archives can be concatenated
412766
de