In the initramfs scheme, the kernel executes /init as its first process that is not expected to exit. Some systems use the dracut package to create an initramfs image. This scheme has the advantage of not requiring an intermediate file system or block drivers to be compiled into the kernel. The archive is unpacked by the kernel into a special instance of a tmpfs that becomes the initial root file system. In the initramfs scheme (available since the Linux kernel 2.6.13), the image may be a cpio archive (optionally compressed). Once the initial root file system is up, the kernel executes /linuxrc as its first process when it exits, the kernel assumes that the real root file system has been mounted and executes /sbin/init to begin the normal user-space boot process. Many distributions originally used compressed ext2 file system images, while the others (including Debian 3.1) used cramfs in order to boot on memory-limited systems, since the cramfs image can be mounted in-place without requiring extra space for decompression. The driver for that file system must be compiled statically into the kernel. In the initrd scheme, the image may be a file system image (optionally compressed), which is made available in a special block device ( /dev/ram) that is then mounted as the initial root file system. At the end of its boot sequence, the kernel tries to determine the format of the image from its first few blocks of data, which can lead either to the initrd or initramfs scheme. The bootloader will load the kernel and initial root file system image into memory and then start the kernel, passing in the memory address of the image. This can be the root file system itself, a boot image on an optical disc, a small partition on a local disk (a boot partition, usually using ext2 or FAT file systems), or a TFTP server (on systems that can boot from Ethernet). See also: Linux startup process mkinitcpio, a program to generate initramfs on Arch Linux and related distributionsĪn image of this initial root file system (along with the kernel image) must be stored somewhere accessible by the Linux bootloader or the boot firmware of the computer. This root file-system can contain user-space helpers which do the hardware detection, module loading and device discovery necessary to get the real root file-system mounted. To avoid having to hardcode handling for so many special cases into the kernel, an initial boot stage with a temporary root file-system – now dubbed early user space – is used. On next boot, this image has to be made accessible before it can be loaded back into memory. Īnother complication is kernel support for hibernation, which suspends the computer to disk by dumping an image of the entire contents of memory to a swap partition or a regular file, then powering off. All of these require special preparations to mount. To further complicate matters, the root file system may be on a software RAID volume, LVM, NFS (on diskless workstations), or on an encrypted partition. This static-compiled kernel approach also leaves modules in kernel memory which are no longer used or needed, and raises the problem of detecting and loading the modules necessary to mount the root file system at boot time, or for that matter, deducing where or what the root file system is. The device drivers for this generic kernel image are included as loadable kernel modules because statically compiling many drivers into one kernel causes the kernel image to be much larger, perhaps too large to boot on computers with limited memory, or in some cases to cause boot-time crashes or other problems due to probing for nonexistent or conflicting hardware. Many Linux distributions ship a single, generic Linux kernel image – one that the distribution's developers create specifically to boot on a wide variety of hardware. Both are commonly used to make preparations before the real root file system can be mounted. initrd and initramfs (from INITial RAM File System) refer to two different methods of achieving this. In Linux systems, initrd ( initial ramdisk) is a scheme for loading a temporary root file system into memory, to be used as part of the Linux startup process. Temporary root file system loaded during early boot of Linux operating system
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |