Grub2 – Stop the Insanity!
I am one of those people who compiles a lot of new kernels, and have become increasingly frustrated by the user-unfriendliness of grub2..
Now the latest version of grub2 has introduced – for reasons that I cannot fathom – two levels of menu, and relegated most of the multiple-choice kernel version boot options to the secondary menu – euphemistically called ”Advanced options for…..”.
The problem with this is that the conventional ways of pre-selecting the kernel version to boot are broken by this.. The ludicrous assumption would appear to be that the operator is sitting in front of the computer screen/keyboard when it boots, which is not the case when the system is remote – or ‘headless’ (or both..).
There is a useful grub2 configuration tool – grub-customizer – that would work, but only sees the top-level menu, which usually consists of only the last-installed kernel version, and (if installed) the MSWin boot..
http://launchpad.net/grub-customizer
After much fruitless searching among the mostly-out-of-date info online, I decided to simply try to revert the menu to the older grub2 pre-2.0 single-level one, and this was actually quite easy.
Simply download the source to a 1.99 version of grub2 – I used 1.99-rc1 – untar it, and go the the utils/grub.d directory. There you will find the older version of the configuration parameter file that generates the entries for grub.cfg when grub2-mkconfig is run.. The file you need is 10_linux_in, which will need to be renamed to just 10_linux for Fedora systems..
Copy this file to /etc/grub.d on your system, and make it executable (# chmod 0755 10_linux). Then edit the first few lines to correctly reference the exec, prefix, etc.
For Fedora, this will be:
............. prefix="/usr" exec_prefix="/usr" bindir="/usr" libdir="/usr/share" . ${libdir}/grub/grub-mkconfig_lib export TEXTDOMAIN=grub export TEXTDOMAINDIR="${datarootdir}/locale" .............
The rest of the contents should be OK as they are..
Once this has been done, simply recreate grub.cfg:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Then, if you (re)run grub-customizer, you will see all the bootable kernel versions, and can re-sequence them as needed…
Comments
Grub2 – Stop the Insanity! — No Comments