initramfs

from Wikipedia, the free encyclopedia

initramfs stands for initial ram filesystem (which translates as the source file system in the main memory ) and is the successor to initrd . The initramfs is a compressed archive that contains files required for the system start. It can from the Linux kernel at boot as root are hooked. Then a program ( init ) on the initramfs is started. The started program can fulfill different tasks. In the case of embedded systems , the entire functionality of the system can be contained in initramfs. Personal computers often only use the initramfs as an intermediate step to load drivers and make other preparations for starting the actual system. The initramfs and initrd made it possible to make the boot process under Linux more flexible and to outsource functionality from the kernel to the user space.

Boot process

Starting with version 2.5.46, the Linux kernel can boot from an initramfs. The initramfs archive can be contained in the kernel itself or loaded from a file into the main memory by the boot loader . The kernel decompresses the initramfs archive and then mounts the unpacked archive as the root directory. Next, an attempt is made to start the / init program from the initramfs. If the start fails, the kernel tries to mount the actual root device and start / sbin / init there.

The initramfs itself is a cpio archive that usually contains a Unix shell (often BusyBox ) and other basic programs. In this case / init is a simple shell script that links the programs contained in initramfs in the desired way. But it is also possible that / init is a C program that was linked against a small variant of the libc . The last task of / init is usually to mount the actual root device via the root directory and to start / sbin / init.

Changes to initrd

  • No file system driver has to be permanently compiled into the kernel
  • The size of the initramfs is not subject to any fixed upper limit
  • Accesses to the initramfs are not buffered, which saves memory
  • Different cpio archives can be linked

Individual evidence

  1. Linux Weekly News . November 7, 2002, http://lwn.net/Articles/14776/

Web links