dracut.conf - Linux


Overview

dracut.conf allows fine-tuning system configuration during boot with immediate dracut configuration. It provides a more granular control over the initramfs image creation process.

Syntax

dracut.conf [OPTIONS]

Options/Flags

  • –add-drivers DRIVER1 DRIVER2 …: Add additional drivers to the initramfs image.
  • –add-hooks HOOK1 HOOK2 …: Add additional hooks to the initramfs image.
  • –add-files FILE1 FILE2 …: Add arbitrary files to the initramfs image.
  • –add-kernelargs KERNELARG1 KERNELARG2 …: Add kernel command-line arguments to be passed to the initramfs.
  • –add-modules MODULE1 MODULE2 …: Add additional kernel modules to the initramfs image.
  • –add-shell-layers SHELL_LAYER1 SHELL_LAYER2 …: Add additional shell layers to the initramfs image.
  • –dont-add-drivers DRIVER1 DRIVER2 …: Exclude drivers from the initramfs image.
  • –dont-add-hooks HOOK1 HOOK2 …: Exclude hooks from the initramfs image.
  • –dont-add-files FILE1 FILE2 …: Exclude files from the initramfs image.
  • –dont-add-kernelargs KERNELARG1 KERNELARG2 …: Exclude kernel command-line arguments from being passed to the initramfs.
  • –dont-add-modules MODULE1 MODULE2 …: Exclude kernel modules from the initramfs image.
  • –dont-add-shell-layers SHELL_LAYER1 SHELL_LAYER2 …: Exclude shell layers from the initramfs image.

Examples

Example 1: Add the "iwlwifi" driver to the initramfs image:

dracut.conf --add-drivers iwlwifi

Example 2: Exclude the "aufs" module from the initramfs image:

dracut.conf --dont-add-modules aufs

Example 3: Add the "/etc/resolv.conf" file to the initramfs image:

dracut.conf --add-files /etc/resolv.conf

Common Issues

  • If you encounter issues with drivers not being loaded properly, check that they are properly configured and added to dracut.conf.
  • If the initramfs image size is too large, consider excluding unnecessary files or drivers.
  • For complex configurations, it may be necessary to use a separate config file to avoid command-line length limitations.

Integration

dracut.conf can be used in conjunction with other commands like mkinitcpio and update-initramfs for managing and updating the initramfs image.

Related Commands

  • mkinitcpio
  • update-initramfs