Dracut

Dracut is an initramfs infrastructure and aims to have as little as possible hard-coded into the initramfs. It originated from the Fedora Project and was ported to Gentoo in the 2010 Google Summer of Code. For more detailed information, refer to the documentation at kernel.org.

Installation
Dracut works through its modules (not kernel modules). The modules take care of various common tasks during the boot process. By default, the optional modules are not installed. Installation of those can be controlled using the DRACUT_MODULES variable in /etc/make.conf.

Since Dracut is not yet stable in Portage, add it to the package keywords first.

Before you can use the images generated by dracut, your kernel must include initramfs support. The ebuild will warn you if your kernel is missing the required option:

Default Images
Once you have installed dracut, you can use it to build an initramfs image. The simplest way to do this is to just run

The initramfs image created this way is a generic image, which will include all installed modules and system tools that it can find, suitable for booting a variety of machines. If you are producing an initramfs for just a single machine, you can specify that dracut should go into host-only mode:

The produced image will contain only those elements used by the local machine for booting. Certain modules behave differently in host-only mode. The kernel-modules module, for example, will only include the tools and modules used by the current rootfs file system, and the i18n module will install the fonts and keymaps for the local machine. Otherwise, every available file system, font, etc. would be included.

By default, dracut will produce an image suitable for booting the currently active kernel; it will pull the kernel modules needed for that kernel, etc. The output will be written into your /boot folder (which you should already have mounted), in a file called /boot/initramfs- .img. You can override both options by specifying a new file name and kernel version on the command line, in that order. Both parameters are optional, but if you want to override the kernel version and keep the default file name you need to pass a placeholder empty string as the first parameter:

Adding Modules
By default, dracut will include most installed modules automatically. In host-only mode, modules that are not relevant to the local machine are skipped. Additionally, certain modules are disabled by default, and need to be manually enabled.

You can override these options in two ways: command line, or configuration file. Editing your configuration file will set up dracut to be re-run easily when you change kernels or other boot-time options. Options specified in /etc/dracut.conf can be overridden by files in /etc/dracut.conf.d, which are installed by various dracut-aware packages. Both options can be overridden by command-line parameters. The following configuration options deal with the default modules list:

Default Modules
When installed without any use flags, dracut installs a basic set of modules that can boot a system using a locally attached block device for its rootfs. The purpose of each module is to arrange for files to be included in the final initramfs image. In addition, dracut exposes hooks that run at certain points, which modules can hook into to perform required boot actions.

Booting The initramfs
Once you have the image built, the final step is to include the image in the boot loader. To do this, simply add a line in your grub.conf:

Any parameters you need to pass to the dracut modules are passed on the kernel command line. If you are net booting, the DHCP server can also provide command-line parameters. The dracut scripts parse the kernel command line very early in the boot process and use the information found there to adjust their behavior. The list of options, by module, can be found in the man dracut.cmdline page.

NFS Boot
For an NFS boot, you need only 3 modules and the nfs dracut module.

Booting is done with the following line in your PXE config. The rd.ip=auto let's it auto detect the NFS settings through DHCP. The NFS boot path is provided to the client through the DHCP option "root-path" with the following value: :

NBD Boot
For an NBD boot, you need only 3 modules and the nbd dracut module.

Booting is done with the following line in your PXE config. The rd.ip=auto let's it auto detect the NBD settings through DHCP. The NBD boot path is provided to the client through the DHCP option "root-path" with the following value: nbd:::

Other Filesystems
Other filesystems than the ones that are available through the Dracut modules can be installed using the filesystems parameter. To include kernel modules, the kernel-modules Dracut module also has to be included. This module is installed by default.

Custom Modules
This stub paragraph refers to this description for now.