Ask Your Question

How to update grub.cfg along with kernel properly?

asked 2012-08-25 13:43:19 -0500

maxyan gravatar image

updated 2012-08-25 13:43:46 -0500

I have all config in my grub.d set up properly. The output of grub-mkconfig and works fine. When I update the kernel the new entry "Fedora [kernel version]" is added directly to my grub.cfg, on the first place. It seems like the distro is running some script after each kernel update. How can I simply invoke grub-mkconfig instead?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-08-25 17:04:42 -0500

jmt gravatar image

updated 2012-08-25 17:11:12 -0500

The postinstall scriptlet of the kernel package runs

/sbin/new-kernel-pkg --package kernel --install kernel-version

It seems that new-kernel-pkg which is a part of the grubby package does not run grub2-mkconfig as it should on systems using GRUB2.

As far as I can see, the best option at this point is to run

grub2-mkconfig >/boot/grub2/grub.cfg

manually after installing a new kernel.

Of course you can patch new-kernel-pkg if you like. The script, however, seems a bit hairy.

edit flag offensive delete link more



@maxyan: that won't work. As soon as the package is updated, it'll get reverted. There was a discussion on grubby vs grub-mkconfig on the fedora devel list. You can google for it if you want.

FranciscoD_ gravatar imageFranciscoD_ ( 2012-08-26 19:29:36 -0500 )edit

Question Tools


Asked: 2012-08-25 13:43:19 -0500

Seen: 9,579 times

Last updated: Aug 25 '12