Hello we had a discussion on IRC about implementing savedefault. We've found 3 possible solutions:
1) just add support for it in grub-mkimage in following way:
load_env
menuentry "menu entry 1" {
   default=0
   save_env
        ....
}
menuentry "menu entry 2" {
   default=1
   save_env
        ....
}

This method has disadvantage of the necessity of counting entries in grub-mkconfig. This is easily broken OS-specific script count entries wrong. Also it breaks if user adds entries manually in the middle of the file
2) Export a variable selected_menu. Then syntax would be sth like
load_env

menuentry "menu entry 1" {
   default=$selected_menu
   save_env
        ....
}
menuentry "menu entry 2" {
   default=$selected_menu
   save_env
        ....
}
3) Add label support syntax would be sth like:
default=ubuntu
menuentry --label ubuntu "Ubuntu" {
        ....
}
And for savedefault it would be something like
load_env
menuentry --label linux_<random id> "Linux" {
   default=linux_<random id>
   save_env
        ....
}


--

Regards
Vladimir 'phcoder' Serbinenko


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to