How do permanently add kernel command line parameters to grub

Suppose, you want to permanently add/modify a kernel command line parameter to grub, for example we want to specify kernel to reboot after 5 seconds on a panic message. The kernel command line parameter for this.

panic=5

One option is while the grub menu is loading you can press 'e' and add it, but this is not persistent in reboots. To make it permanent, the GRUB provides a configuration option GRUB_CMDLINE_LINUX which adds command-line  arguments to the menu entries for the Linux Kernel.


Open /etc/default/grub using vim, requires sudo permission: sudo vi /etc/default/grub

Save the file : ":wq" command
Then run "update-grub" command to add these commands to /boot/grub/grub.cfg file
Finally reboot to reload the kernel parameters.

Comments

Popular posts from this blog

bb.utils.contains yocto

Difference between RDEPENDS and DEPENDS in Yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig