Forrest logo
back to the kexec tool

kexec:tldr:301c3

kexec: Load a new kernel.
$ kexec -l ${path-to-kernel} --initrd=${path-to-initrd} --command-line=${arguments}
try on your machine

The command "kexec -l ${path-to-kernel} --initrd=${path-to-initrd} --command-line=${arguments}" is used to load a new kernel into memory and then execute it. Here's an explanation of each part of the command:

  • "kexec": This is the command-line utility which is used to directly boot into a new kernel without rebooting the system.
  • "-l": This option is used to load a new kernel image into memory, without actually executing it.
  • "${path-to-kernel}": This is the path to the new kernel image file that you want to load into memory. It should be specified here.
  • "--initrd=${path-to-initrd}": This option is used to specify the initial ramdisk (initrd) image file that needs to be loaded along with the kernel image. The initrd provides additional files and resources that are necessary for the kernel to boot.
  • "${path-to-initrd}": This is the path to the initrd image file that you want to load along with the kernel. It should be specified here.
  • "--command-line=${arguments}": This option is used to specify the command line arguments that you want to pass to the newly loaded kernel. The command line arguments can be used to configure various aspects of the kernel's behavior and boot process.
  • "${arguments}": This is where you can specify any command line arguments that you want to pass to the new kernel. These arguments should be provided here.

Overall, this command allows you to load a new kernel image file along with an initial ramdisk (if needed) and pass command line arguments to the kernel. Once the command is executed, the new kernel will be loaded into memory but not yet executed. For it to actually run, you will need to use the "kexec -e" command to execute the loaded kernel.

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 kexec tool