[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Grub: How to move an item at the top



Franco Martelli composed on 2025-09-17 20:55 (UTC+0200):
...
> my customized kernel is at the second place so every time 
> I boot I have to manually choose the proper kernel image to boot 
> (/boot/vmlinuz-6.12.43).
> I have also noticed that in the root's directory "vmlinuz" symlink does 
> not point to "/boot/vmlinuz-6.12.43":
...
1-Make a unique symlink to the kernel you want at the top, e.g. vmlinuz-fm.
2-copy /etc/grub.d/40_custom to /etc/grub.d/06_custom
3-put a Grub stanza in 06_custom that loads your selected kernel by its symlink

Stanzas in 06_custom will head the list of stanzas created automatically, as they
exist due to 10_linux.

Which will be default is configurable via /etc/default/grub's GRUB_DEFAULT=, with
0 at top of stanza list. If your custom kernel is routinely the second item in the
boot menu, you could set yours to 1 instead of making changes in /etc/grub.d/.

As an alternative, copy 41_custom to 07_custom, but instead of putting your custom
stanzas in the copied file, put them in /boot/grub/custom.cfg, to be called by
07_custom. I've been using this latter method since the month I did my first UEFI
installation.
-- 
Evolution as taught in public schools is, like religion,
	based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata


Reply to: