dracut.cmdline - Linux
Overview
dracut.cmdline is a utility used to modify the kernel command line passed to the initramfs image during the Linux boot process. It allows for dynamic modification and injection of additional parameters into the kernel command line, providing increased flexibility and customization options for system administrators.
Syntax
dracut.cmdline [options] kernel-command-line-argument
Options/Flags
- –add (also -a): Appends the specified argument to the existing kernel command line.
- –delete (also -d): Deletes the specified argument from the kernel command line.
- –replace (also -r): Replaces the specified argument with the provided value.
- –search (also -s): Searches for the specified argument in the kernel command line and reports its location.
- –verbose (also -v): Outputs additional information during the process.
- –help (also -h): Displays the help screen.
Examples
Append a new argument to the command line:
dracut.cmdline --add console=ttyS0
Delete an existing argument from the command line:
dracut.cmdline --delete "console=tty0"
Replace an existing argument with a new value:
dracut.cmdline --replace "root=/dev/sda1" "root=/dev/sda2"
Search for a specific argument in the command line:
dracut.cmdline --search console
Common Issues
- Incorrectly formatted arguments can lead to errors.
- Overriding certain critical kernel parameters (e.g., root device) may result in boot failures.
Integration
dracut.cmdline can be used in conjunction with other commands to enhance system configuration and deployment:
- initramfs-tools: Generate custom initramfs images with modified command lines.
- systemd: Set persistent kernel command line parameters for system-wide use.
Related Commands
- initramfs-tools: Create and manage initramfs images.
- mkinitcpio: Generate initramfs images based on predefined profiles.
- systemd-bootctl: Manage system and kernel boot configurations.