Adding Options To Grub

Home » CentOS » Adding Options To Grub
CentOS No Comments

So I want to add a few options to the kernel (say iommu support). I have been told before to avoid using grub2-mkconfig because it would apply the changes to all currently available (to boot from) boot kernels. Instead, I should edit just the latest kernel entry in the grub.cfg file, adding the option to the line that used to start with “linux16” in CentOS6. This way, if it went boink, all I had to do is reboot, pick another kernel from the grub menu and off I
went. And, it seems that every future kernel upgrade would incorporate this change.

Looking at a CentOS7.7 setup, I take the equivalent line in
/boot/grub/grub.conf is

kernel /boot/vmlinuz-3.10.0-123.4.4.el7.x86_64 console=hvc0
xencons=tty0 root=/dev/xvda ro

I am now looking into a CentOS8 and its grub.cfg
(/boot/efi/EFI/CentOS/grub.cfg in this case) looks rather different. Is what I have described above still the safest way to customize the kernel? Or is there a cleaner way to do the same while still leaving me the option to go back to the grub menu and pick an undisturbed kernel?