in /boot i have 3 kernels. One is a custom kernel 4.11, the other two are suse kernels 4.4.62 and 4.4.70
How do i make grub2 show the kernel version in the boot menu and how do i make the boot menu list the custom kernel last and the newest kernel first(e.g make newest kernel the default)
If there is a future kernel update i want that to end up being the default also
After a lot of reading and a lot of experimenting here is what I came up with
(of course su to root first for all of this)
In /etc/default/grub add this line to eliminate the submenu
GRUB_DISABLE_SUBMENU=y
Then in /etc/grub.d/10_linux.rpmorig
add this line near the top to disable it so you can see the kernel’s that will be booted by each menu entry
#! /bin/sh
set -e
exit 0 # <== add the the exit 0 to prevent the script from running, renaming the file wont work
It drove me nuts having every menu entry with the same title of ‘OpenSuse Leap 42.2’
How was one to know what they were selecting? dumb IMHO
Now run
grub2-mkconfig -o /boot/grub2/grub.cfg
and voila! you have a generally single level menu with informative titles
The only remaining issue is to be able to change the menu order, but at least you can now set a default boot option in
/etc/default/grub by changing GRUB_DEFAULT=0 to whatever, and it should point to the correct menu entry
Opinion: Why they chose to ditch grub legacy and go with grub2 remains a mystery, grub2 is horrible and generally not understandable by ordinary human beings. Makes me feel like we are leaning towards Windows once again. At least they should make grub legacy an option when installing Leap 42
I would have been happy with that and for the corner cases requiring a grub2 setup it would still be an option
Who’s “they” ?
The answer is simple: grub-legacy is no longer maintained. And, we ( the openSUSE Project ) don’t want to ship unmaintained software for obvious reasons.
I’ve never had any issues in adjusting the bootloader configs using the Yast module.
To prevent 10_Linux (or any of the sections) just remove ‘executable’ from it in /etc/grub.d.
chmod -x /etc/grub.d/10_linux
If you remove x from all entries except 00_header and 90_persistent, you can create a menu.lst type entry within 90_persistent and amend it in any order you want.
You would have to redo those changes to the grub.d files every time there is a grub change and amend your entries manually in 90_persistent when the kernels change.