I know that in CentOS 6.x, you can put the following line in /etc/yum.conf which tells yum to keep the last N kernels (by default this is set to five):
installonly_limit=5
However, there are cases when using experimental kernels (such as from ELRepo) where I want to keep a specific kernel around even if there have been 5+ updates to that kernel's package.
Are there edits to be made to /boot/grub/grub.conf or are there configuration options for yum (or dracut) to do this?
You need to have yum version 3.2.26 or above and if you don't have it install yum-utils package which comes with the yumdb script. Using yumdb you can set a certain package to be kept from being removed on updates.