On 2016-07-22 17:25, Andrei Borzenkov wrote:
Assuming you are using grub-mkconfig and not editing grub.cfg manually ...
No, I edit "/boot/grub2/custom.cfg" manually.
set GRUB_DEFAULT in /etc/default/grub and run grub2-mckconfig. It can be set to entry number, entry title or entry ID. Entry number is the worst - it can change next time grub-mkconfig runs. Entry title is not unique enough, although in your case it may be enough. ID is recommended way to refer to menu entries. Just add --id some-unique-string like
menuentry 'Main (with uuid)' --id something-that-is-unique { ...
For ID string you can simply use uuidgen which is supposed to return Universally Unique ID. grub-mkconfig scripts usually prefix it with some indication where it comes from (like linux-$uuid or os_prober-$uuid etc). So something like carlos-$uuid would be good :)
And do not forget that if you use submenus, you need to define full path, i.e. for
submenu "My own menus" --id unique-1 { menuentry "First submenu entry" --id unique-2 { ... } ... }
you need to set
GRUB_DEFAULT="unique-1>unique-2"
I see. This is manually entering in the file the entry that I want to boot by default. I'll try this just now. [...] No, it does not work :-( /etc/default/grub: GRUB_DEFAULT=cer-main-001 GRUB_SAVEDEFAULT=true /boot/grub2/custom.cfg: menuentry 'Main (por uuid)' --id cer-main-001 { insmod part_gpt insmod ext2 set root='hd0,gpt5' if search --no-floppy --fs-uuid --set=root e99d9dcb-869d-4a24-94cf-cba32f169b8d ; then chainloader +1 else echo Could not find this OS instance, will not boot (3) sleep 1 fi } By default, it always want to boot the first entry found in "/boot/grub2/grub.cfg", not any of the entries I define in "/boot/grub2/custom.cfg". Those are ignored by this feature. -- Cheers / Saludos, Carlos E. R. (from openSUSE Leap 42.1 x86_64 (test)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org