Forrest logo
back to the mkinitcpio tool

mkinitcpio:tldr:82e9b

mkinitcpio: Generate an initramfs image for a kernel other than the one currently running (the installed kernel releases can be found in `/usr/lib/modules/`).
$ mkinitcpio --kernel ${kernel_version} --generate ${path-to-initramfs-img}
try on your machine

This command is used to generate an initramfs (initial RAM file system) image file for a specific kernel version.

Here's a breakdown of the command:

  • mkinitcpio: This is the name of the command or utility used to create an initramfs image.
  • --kernel ${kernel_version}: This option specifies the kernel version for which the initramfs image is being generated. The value of ${kernel_version} should be replaced with the actual version number, such as 5.4.0-56.
  • --generate ${path-to-initramfs-img}: This option specifies the path and filename of the generated initramfs image file. The value of ${path-to-initramfs-img} should be replaced with the desired destination of the file. For example, /boot/initramfs-linux.img.

When you run this command, the mkinitcpio utility will use the specified kernel version to create an initramfs image file at the provided destination. This initramfs file is a compressed file system that is loaded into RAM during the early stages of the Linux boot process. It contains essential files and drivers needed to initialize and mount the actual root file system, allowing the Linux system to complete the boot process.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mkinitcpio tool